-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
39 lines (34 loc) · 1.12 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
cmake_minimum_required(VERSION 3.13)
project(shortest_path)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS_RELEASE_INIT "-Wall")
# Test for errors with AddressSanitizer
if(XSAN STREQUAL "ASAN")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif()
if(XSAN STREQUAL "UBSAN")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
add_compile_options(-fsanitize=undefined)
add_link_options(-fsanitize=undefined)
endif()
if(XSAN STREQUAL "MSAN")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
add_compile_options(-fsanitize=leak)
add_link_options(-fsanitize=leak)
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE)
endif()
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_DEBUG_LIBS OFF)
set(Boost_USE_RELEASE_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.71 REQUIRED)
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
set(SOURCE_FILES demo.cpp)
add_executable(demo ${SOURCE_FILES})
target_link_libraries(demo ${OpenCV_LIBS} )