-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
69 lines (47 loc) · 1.62 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
# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html
# Sets the minimum version of CMake required to build the native library.
cmake_minimum_required(VERSION 3.4.1)
project(sourbbn-lib)
#Use C++11 standard with -fPIC
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# add the CMakeFile that defines catch2--used for unit testing
add_subdirectory(3rd_party/catch2)
add_subdirectory(3rd_party/sqlite3)
include_directories(3rd_party/sqlite3/sqlite3)
#Adds the library with no build products
file(GLOB sour_SRC "src/*cpp")
file(GLOB sour_INC "include/sourbbn/*hpp")
add_library(sourbbn-lib SHARED ${sour_SRC})
set_target_properties(sourbbn-lib PROPERTIES PUBLIC_HEADER "${sour_INC}")
#Include the header files not tests or examples
target_include_directories(sourbbn-lib PUBLIC include)
target_link_libraries(sourbbn-lib sqlite3)
install(TARGETS sourbbn-lib
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include/sourbbn)
##########################################################
# Unit tests
set( CMAKE_CXX_FLAGS " -pthread " )
enable_testing()
add_executable(unit_tests test/unit_tests.cpp)
add_executable(scratch_test test/scratch_test.cpp)
add_executable(multi_query_test test/multi_query_test.cpp)
target_link_libraries(unit_tests
sourbbn-lib
Catch2::Test
sqlite3
${CMAKE_DL_LIBS}
)
target_link_libraries(scratch_test
sourbbn-lib
sqlite3
${CMAKE_DL_LIBS}
)
target_link_libraries(multi_query_test
sourbbn-lib
sqlite3
${CMAKE_DL_LIBS}
)
#add_test(test_all unit_tests)