-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
67 lines (49 loc) · 1.56 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
64
65
66
67
cmake_minimum_required(VERSION 2.8)
PROJECT(autoneedle)
FIND_PACKAGE(VTK REQUIRED)
FIND_PACKAGE(GTest REQUIRED)
INCLUDE(${VTK_USE_FILE})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse3")
ADD_CUSTOM_COMMAND(
OUTPUT
${PROJECT_SOURCE_DIR}/gen_src/generatedCode.h
COMMAND
python ${PROJECT_SOURCE_DIR}/tools/GenerateCode.py
WORKING_DIRECTORY
${PROJECT_SOURCE_DIR}/
DEPENDS
${PROJECT_SOURCE_DIR}/tools/GenerateCode.py
${PROJECT_SOURCE_DIR}/tools/CodeToC.py
)
ADD_CUSTOM_TARGET(
generatedCode
ALL
DEPENDS
${PROJECT_SOURCE_DIR}/gen_src/generatedCode.h
)
SET( source
src/needle.cxx
src/needlematrix.cxx
src/sparsediagonalmatrix.cxx
src/sparsediagonalmatrixOpt.cxx
)
INCLUDE_DIRECTORIES(
gen_src/
3rdparty/cml-1_0_2/
include/
${GTEST_INCLUDE_DIR}
)
ADD_LIBRARY( needlelib ${source} )
ADD_DEPENDENCIES( needlelib generatedCode )
ADD_EXECUTABLE( autoneedle src/main.cxx src/Rendering.cxx)
TARGET_LINK_LIBRARIES(autoneedle ${VTK_LIBRARIES})
TARGET_LINK_LIBRARIES(autoneedle needlelib)
ADD_EXECUTABLE( tests tests/testing.cxx )
TARGET_LINK_LIBRARIES( tests ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY} pthread needlelib )
ADD_EXECUTABLE( testsMatrix tests/testingDiagonalSparseMatrix.cxx tests/testingDiagonalSparseMatrixOpt.cxx)
TARGET_LINK_LIBRARIES( testsMatrix ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY} pthread needlelib )
ADD_EXECUTABLE( testsSpeed tests/speedTestMatrix.cxx )
TARGET_LINK_LIBRARIES( testsSpeed ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY} pthread needlelib )
ENABLE_TESTING()
ADD_TEST( testNeedle tests )
ADD_TEST( testMatrix testsMatrix )