-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
69 lines (52 loc) · 2.41 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
68
69
# Specify the minimum version for CMake
cmake_minimum_required(VERSION 2.8)
# Project's name
project(SearchTrees)
# Set the output folder where your program will be created
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb -O3 -flto -march=native -mtune=native")
#find libraries
find_package(Armadillo REQUIRED)
include_directories(${ARMADILLO_INCLUDE_DIRS})
#check C++11 support:
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -ggdb")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -ggdb")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
#check openmp support
CHECK_CXX_COMPILER_FLAG("-fopenmp" COMPILER_SUPPORTS_OPENMP)
if (COMPILER_SUPPORTS_OPENMP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
endif()
# The following folder will be included
include_directories("${PROJECT_SOURCE_DIR}")
include_directories("${PROJECT_SOURCE_DIR}/bruteforce")
include_directories("${PROJECT_SOURCE_DIR}/kdtree")
include_directories("${PROJECT_SOURCE_DIR}/balltree")
include_directories("${PROJECT_SOURCE_DIR}/covertree")
include_directories("${PROJECT_SOURCE_DIR}/testing")
include_directories("${PROJECT_SOURCE_DIR}/thesisexperiments")
#create executables
add_executable(UnitTests ${PROJECT_SOURCE_DIR}/UnitTests.cpp)
add_executable(ThesisDataSizeTests ${PROJECT_SOURCE_DIR}/ThesisDataSizeTests.cpp)
add_executable(ThesisLeafLimitTests ${PROJECT_SOURCE_DIR}/ThesisLeafLimitTests.cpp)
add_executable(ThesisSpillTreeTests ${PROJECT_SOURCE_DIR}/ThesisSpillTreeTests.cpp)
add_executable(ThesisScaleApproxTests ${PROJECT_SOURCE_DIR}/ThesisScaleApproxTests.cpp)
target_link_libraries(UnitTests
${ARMADILLO_LIBRARIES})
target_link_libraries(ThesisDataSizeTests
${ARMADILLO_LIBRARIES})
target_link_libraries(ThesisLeafLimitTests
${ARMADILLO_LIBRARIES})
target_link_libraries(ThesisSpillTreeTests
${ARMADILLO_LIBRARIES})
target_link_libraries(ThesisScaleApproxTests
${ARMADILLO_LIBRARIES})