forked from amkozlov/raxml-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
46 lines (30 loc) · 1.28 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
find_package (GTest)
if(NOT GTEST_FOUND)
message (STATUS "GTest not found")
message (WARNING "Skipping building tests.")
return()
endif()
message (STATUS "Building tests")
file (GLOB_RECURSE RAXML_TEST_SOURCES ${PROJECT_SOURCE_DIR}/test/src/*.cpp ${RAXML_SOURCES})
# sources list now has 2 Main.cpp, old has to be removed
list(REMOVE_ITEM RAXML_TEST_SOURCES "${PROJECT_SOURCE_DIR}/src/main.cpp")
include_directories (${PROJECT_SOURCE_DIR})
set (EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/test/bin)
add_executable (raxml_test_module ${RAXML_TEST_SOURCES})
target_link_libraries (raxml_test_module ${RAXML_LIBS})
if(GMP_FOUND)
target_link_libraries(raxml_test_module ${GMP_LIBRARIES})
endif()
target_link_libraries (raxml_test_module ${GTEST_BOTH_LIBRARIES} -pthread)
target_link_libraries (raxml_test_module ${MPI_CXX_LIBRARIES})
if(MPI_COMPILE_FLAGS)
set_target_properties(raxml_test_module PROPERTIES
COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")
endif()
if(MPI_LINK_FLAGS)
set_target_properties(raxml_test_module PROPERTIES
LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()
set_target_properties (raxml_test_module PROPERTIES OUTPUT_NAME raxml_test)
set_target_properties (raxml_test_module PROPERTIES PREFIX "")
add_test (raxml_test ${PROJECT_SOURCE_DIR}/test/bin/raxml_test)