-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (56 loc) · 1.49 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
70
71
72
73
74
# Make sure to do "cmake -DCMAKE_C_COMPILER=/usr/bin/gcc" before running this the first time.
# after that, it _should_ be cached.
cmake_minimum_required(VERSION 3.14)
# TODO: do this from cmake options instead.
SET(CMAKE_BUILD_TYPE Debug)
PROJECT (RTree)
set(CMAKE_VERBOSE_MAKEFILE ON)
# GoogleTest requires at least C++11
SET(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -O2")
INCLUDE(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
add_executable(
all_tests
src/BBox.c
src/Node.c
src/PriorityQueue.c
src/RTree.c
src/Point.c
tests/all_tests.cc
tests/node_test.cc
tests/RTree_test.cc
tests/point_tests.cc
tests/bbox_tests.cc
tests/priority_queue_test.cc
)
target_link_libraries(
all_tests
gtest_main
)
include(GoogleTest)
gtest_discover_tests(all_tests)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(Glib REQUIRED)
include_directories(${Glib_INCLUDE_DIRS})
set(LIBS ${LIBS} ${Glib_LIBRARIES})
#main
add_executable(
rtree
src/main.c
src/BBox.c
src/Node.c
src/RTree.c
src/Point.c
src/PriorityQueue.c
)
target_link_libraries(rtree ${LIBS} m)
target_link_libraries(all_tests ${LIBS} m)
message(${Glib_INCLUDE_DIRS})