-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
27 lines (24 loc) · 972 Bytes
/
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
project(Spatify LANGUAGES CXX)
add_library(Spatify INTERFACE)
# if can find tbb, link tbb to Spatify
option(SPATIFY_ENABLE_GUI "Enable GUI support" OFF)
find_package(TBB)
if(TBB_FOUND)
target_link_libraries(Spatify INTERFACE TBB::tbb)
target_compile_definitions(Spatify INTERFACE USE_TBB)
endif()
target_include_directories(Spatify INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(Spatify INTERFACE ${EXTERNAL_PATH}/glm)
# Add test
add_executable(spatial-hash tests/spatial-hash.cc)
target_link_libraries(spatial-hash Spatify)
set(test_srcs tests/test-morton-encode-decode.cc)
foreach(test_src ${test_srcs})
get_filename_component(test_name ${test_src} NAME_WE)
add_executable(${test_name} ${test_src})
target_link_libraries(${test_name} PUBLIC Spatify gtest gtest_main)
add_test(NAME ${test_name} CONFIGURATIONS Release COMMAND ${test_name})
endforeach()