-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (40 loc) · 1.33 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
cmake_minimum_required (VERSION 3.4)
project (guess_factor)
option(PROFILE "Enable profile mode" OFF)
option(COVERAGE "Enable coverage mode" OFF)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/extern/cmake)
#OpenMP
find_package(OpenMP REQUIRED)
if(PROFILE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg ")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg ")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg ")
endif()
if(COVERAGE)
include(CodeCoverage)
APPEND_COVERAGE_COMPILER_FLAGS()
endif()
add_subdirectory (guessfactor)
add_executable(guess_factor guessfactor/main.cpp)
target_link_libraries(guess_factor libguessfactor)
install(TARGETS guess_factor)
#IF(not ${NDEBUG})
add_subdirectory(extern/pybind11)
pybind11_add_module(guessfactor guessfactor/py_main.cpp)
target_link_libraries(guessfactor PRIVATE libguessfactor)
#target_compile_definitions(guessfactor PRIVATE VERSION_INFO=${EXAMPLE_VERSION_INFO})
#endif()
if(COVERAGE)
SETUP_TARGET_FOR_COVERAGE_LCOV(
NAME coverage
EXECUTABLE ctest --output-on-failure #-j ${n_cores} # Executable in PROJECT_BINARY_DIR
DEPENDENCIES
test_loops
test_test
EXCLUDE "/usr/*"
EXCLUDE "${PROJECT_SOURCE_DIR}/extern/*"
)
endif()