-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
53 lines (46 loc) · 1.57 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
project(CCL C CXX)
cmake_minimum_required(VERSION 3.0)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wpedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wpedantic -Wno-deprecated")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -UNDEBUG")
set(WERROR ON CACHE BOOL "Option to disable -Werror flag.")
set(PGO_DIR "${PROJECT_BINARY_DIR}/profiling"
CACHE STRING "Directory where PGO data is placed.")
if (WERROR)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif()
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
find_package(Boost "1.55.0" COMPONENTS filesystem program_options REQUIRED)
find_package(OpenMP REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Boost COMPONENTS filesystem regex)
find_package(Ceres REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(Gflags REQUIRED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
add_definitions(
${OpenCV_DEFINITIONS}
${Boost_DEFINITIONS}
${CERES_DEFINITIONS}
${EIGEN3_DEFINITIONS}
${GFLAGS_DEFINITIONS})
include_directories(
${OpenCV_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${CERES_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS})
link_directories(
${OpenCV_LIBRARY_DIRS}
${Boost_LIBRARY_DIRS}
${CERES_LIBRARY_DIRS}
${EIGEN3_LIBRARY_DIRS})
link_libraries(
${OpenCV_LIBRARIES}
${Boost_LIBRARIES}
${CERES_LIBRARIES}
${EIGEN3_LIBRARIES})
add_subdirectory(src)