-
Notifications
You must be signed in to change notification settings - Fork 18
/
CMakeLists.txt
33 lines (25 loc) · 1.14 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
cmake_minimum_required(VERSION 3.0)
project(learned_indices CXX)
option(LEARNED_INDICES_BUILD_TESTS "Whether to build tests" ON)
set(CMAKE_CXX_STANDARD 11)
# Add nn_cpp
add_subdirectory(external/nn_cpp)
find_package(Boost REQUIRED)
file(GLOB cpp_btree_sources external/cpp-btree/*.h)
add_library(cpp_btree STATIC ${cpp_btree_sources})
target_include_directories(cpp_btree PUBLIC cpp_btree)
set_target_properties(cpp_btree PROPERTIES LINKER_LANGUAGE CXX)
add_executable(learned_indices src/main.cpp)
target_link_libraries(learned_indices cpp_btree nn_cpp)
if (LEARNED_INDICES_BUILD_TESTS)
find_package(Boost COMPONENTS unit_test_framework)
if (Boost_FOUND)
enable_testing()
add_executable(btree_test tests/BtreeTests.cpp)
target_link_libraries(btree_test ${Boost_LIBRARIES} cpp_btree)
add_test(NAME btree_test WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND btree_test)
add_executable(nn_index_test tests/NetworkIndexTests.cpp)
target_link_libraries(nn_index_test ${Boost_LIBRARIES} nn_cpp)
add_test(NAME nn_index_test WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND nn_index_test)
endif()
endif()