-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
69 lines (54 loc) · 2.05 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
63
cmake_minimum_required (VERSION 2.6)
project (MESHDOCTORSIMP)
# compilers
enable_language(CXX)
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
# The version number.
set (MESHDOCTORSIMP_VERSION_MAJOR 1)
set (MESHDOCTORSIMP_VERSION_MINOR 0)
set (MESHDOCTORSIMP_PATCH_VERSION 0)
# include the header
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/RobustPredicates")
# add the subdirectory
add_subdirectory(RobustPredicates)
# all the headers
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src")
# add the subdirectory
add_subdirectory(src)
# add the flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ")
#
# Method to define an executable
#
function(add_meshSimplification_executable arg1 arg2)
# add executable
add_executable(${arg1} ${arg2})
target_link_libraries(${arg1} meshSimplification)
target_link_libraries(${arg1} predicates)
target_link_libraries(${arg1} "/usr/lib/libblas/libblas.so.3.6.0")
target_link_libraries(${arg1} "/usr/lib/lapack/liblapack.so.3.6.0")
# add the link
endfunction(add_meshSimplification_executable)
#
# other mains for tests
#
enable_testing()
file(GLOB APP_SOURCES unitTests/*.cpp)
foreach(testsourcefile ${APP_SOURCES})
# I used a simple string replace, to cut off .cpp.
string(REPLACE ".cpp" "" testnameNoExtension ${testsourcefile})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/unitTests/" "" perfectTestName ${testnameNoExtension})
# create the executable
add_meshSimplification_executable(${perfectTestName} ${testsourcefile})
# create the test
add_test("${perfectTestName}" ${perfectTestName})
endforeach(testsourcefile ${APP_SOURCES})
file(GLOB BIN_SOURCES bin/*.cpp)
foreach(testsourcefile ${BIN_SOURCES})
# I used a simple string replace, to cut off .cpp.
string(REPLACE ".cpp" "" testnameNoExtension ${testsourcefile})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/bin/" "" perfectTestName ${testnameNoExtension})
# create the executable
add_meshSimplification_executable(${perfectTestName} ${testsourcefile})
# create the test
endforeach(testsourcefile ${BIN_SOURCES})