forked from mint-lab/3dv_tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
32 lines (28 loc) · 855 Bytes
/
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
cmake_minimum_required(VERSION 3.8)
project(3dv_tutorial)
# Find external packages and specify their locations
find_package(OpenCV REQUIRED)
find_package(Ceres REQUIRED)
# Specify project files and locations
set(EXAMPLE_DIR "${CMAKE_SOURCE_DIR}/examples")
file(GLOB EXAMPLE_FILES ${EXAMPLE_DIR}/*.cpp)
# Set common configuration
include_directories(
${OpenCV_INCLUDE_DIRS}
${Ceres_INCLUDE_DIRS}
)
link_directories(
${OpenCV_LIB_DIRS}
${Ceres_LIB_DIRS}
)
link_libraries(
${OpenCV_LIBS}
${CERES_LIBRARIES}
)
add_compile_definitions(GLOG_NO_ABBREVIATED_SEVERITIES)
# Add an executable
foreach(example_file ${EXAMPLE_FILES})
string(REPLACE ".cpp" "" example_name ${example_file})
string(REPLACE "${EXAMPLE_DIR}/" "" example_name ${example_name})
add_executable(${example_name} ${example_file})
endforeach()