-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
43 lines (33 loc) · 1.24 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
cmake_minimum_required(VERSION 3.12)
project(kdtree LANGUAGES CXX)
option(KDTREE_EXAMPLES "build examples" OFF)
# kdtree
add_library(kdtree INTERFACE)
target_compile_features(kdtree INTERFACE cxx_std_20)
target_include_directories(kdtree INTERFACE include)
if(KDTREE_TESTS)
add_subdirectory(tests)
endif()
if(KDTREE_EXAMPLES)
# SFML
find_package(SFML 2.5 COMPONENTS graphics REQUIRED)
# OpenGL
find_package(OpenGL REQUIRED)
# externals
add_subdirectory(externals)
# examples
add_library(examples INTERFACE)
target_compile_features(examples INTERFACE cxx_std_17)
target_include_directories(examples INTERFACE examples)
target_link_libraries(examples INTERFACE kdtree)
target_link_libraries(examples INTERFACE sfml-graphics sfml-window sfml-system)
target_link_libraries(examples INTERFACE OpenGL::GL)
target_link_libraries(examples INTERFACE imgui)
target_link_libraries(examples INTERFACE imgui-sfml)
add_executable(search examples/search.cpp)
set_target_properties(search PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(search PRIVATE examples)
add_executable(physics examples/physics.cpp)
set_target_properties(physics PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(physics PRIVATE examples)
endif()