-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
executable file
·59 lines (46 loc) · 1.89 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
cmake_minimum_required(VERSION 3.0)
project( MeshFlow CXX )
#### Environment
if (UNIX AND NOT APPLE) #Ubuntu...
message(STATUS ">>> Linux")
set(OpenCV_DIR /home/mhirano/opencv-3.4.1-tuned/build)
include_directories(/usr/include)
link_directories(/usr/lib/x86_64-linux-gnu)
else(APPLE)
message(STATUS ">>> Mac")
set(OpenCV_DIR /Users/mhirano/opencv-3.4.1-tuned/release)
# Add include directory (environment specific)
include_directories(/usr/local/include)
endif()
# OpenCV
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/include )
######## ######## ######## ######## ######## ######## ######## ########
# Compiler settings
######## ######## ######## ######## ######## ######## ######## ########
# Check C++14 support and activate
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
if(COMPILER_SUPPORTS_CXX14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
set(CMAKE_CXX_STANDARD 14) # C++14...
set(CMAKE_CXX_STANDARD_REQUIRED ON) #...is required...
set(CMAKE_CXX_EXTENSIONS OFF) #...without compiler extensions like gnu++11
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++14 support.")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
endif()
set(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -g -pg")
message(STATUS "${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_RELEASE "-DRELEASE -O3 -DNDEBUG -march=native")
message(STATUS "${CMAKE_CXX_FLAGS_RELEASE}")
######## ######## ######## ######## ######## ######## ######## ########
set( src
${PROJECT_SOURCE_DIR}/src/main.cpp
${PROJECT_SOURCE_DIR}/src/VideoIO.cpp
${PROJECT_SOURCE_DIR}/src/Mesh.cpp
${PROJECT_SOURCE_DIR}/src/MeshFlow.cpp
${PROJECT_SOURCE_DIR}/src/Fast_klt.cpp
)
add_executable( ${CMAKE_PROJECT_NAME} ${src} )
target_link_libraries( ${CMAKE_PROJECT_NAME} ${OpenCV_LIBS})