-
Notifications
You must be signed in to change notification settings - Fork 32
/
CMakeLists.txt
44 lines (35 loc) · 1.08 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
cmake_minimum_required(VERSION 2.8)
project(online_place_recognition)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic")
# ubuntu 16.04
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
# Enable Release mode
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -O3")
# Enable Debug mode
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g -O0")
# set(CMAKE_BUILD_TYPE Debug)
find_package( OpenCV REQUIRED )
## libyaml-cpp
find_package (yaml-cpp REQUIRED)
include_directories(src)
add_subdirectory(src)
add_subdirectory(apps)
# GOOGLE TESTING PART
add_subdirectory(gtest)
enable_testing()
set(PROJECT_TEST_NAME ${PROJECT_NAME}_test)
file(GLOB TEST_SRC_FILES ${CMAKE_SOURCE_DIR}/test/*.cpp)
add_executable(${PROJECT_TEST_NAME} ${TEST_SRC_FILES})
target_link_libraries(${PROJECT_TEST_NAME}
online_database
cost_matrix_database
successor_manager
online_localizer
dimensions_hashing
pthread
gtest
gtest_main
${OpenCV_LIBS}
)
add_test(NAME ${PROJECT_NAME}
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_TEST_NAME})