forked from roc-streaming/openfec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (48 loc) · 1.7 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
cmake_minimum_required(VERSION 3.0.2)
##project
project(openfec C)
include(GNUInstallDirs)
execute_process(
OUTPUT_VARIABLE GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND git describe --tags --abbrev=0
)
string(REGEX MATCH "v?([0-9.]+)" RESULT ${GIT_TAG})
set(GIT_TAG "${CMAKE_MATCH_1}")
message(STATUS "Detected version from git: ${GIT_TAG}")
set(PROJECT_VERSION "${GIT_TAG}")
set(PROJECT_DESCRIPTION "Application-Level Forward Erasure Correction implementation library")
ENABLE_TESTING()
if (PROFILING STREQUAL "ON")
else(PROFILING STREQUAL "ON")
endif(PROFILING STREQUAL "ON")
if (DEBUG STREQUAL "ON")
# Debug mode
ADD_DEFINITIONS(-DOF_DEBUG)
set(CMAKE_BUILD_TYPE Debug)
message(STATUS "Debug mode ON" )
else(DEBUG STREQUAL "ON")
# Release mode
set(CMAKE_BUILD_TYPE Release)
set(OPTIMIZE "3" CACHE STRING "Set optimization level (0-3 or DEFAULT)")
if (NOT OPTIMIZE STREQUAL "DEFAULT")
string(REGEX REPLACE "(-O[A-Za-z0-9]+)" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REGEX REPLACE "(-O[A-Za-z0-9]+)" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O${OPTIMIZE}")
endif()
message(STATUS "Debug mode OFF")
message(STATUS "Optimization level ${OPTIMIZE}")
endif (DEBUG STREQUAL "ON")
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
MARK_AS_ADVANCED(
LIBRARY_OUTPUT_PATH
EXECUTABLE_OUTPUT_PATH
)
link_directories(${LIBRARY_OUTPUT_PATH})
add_subdirectory(pc)
add_subdirectory(src)
add_subdirectory(applis/eperftool)
add_subdirectory(applis/howto_examples/simple_client_server)
add_subdirectory(tools/descr_stats_v1.2)
add_subdirectory(tests)