-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (27 loc) · 1.3 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
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(solve_snp)
set (CMAKE_CXX_FLAGS "-march=native -msse4.2 -mfpmath=sse")
find_package(OpenCV REQUIRED)
find_package(Ceres REQUIRED)
if(OPENMP_FOUND)
MESSAGE("OpenMP found")
if(UNIX)
SET(CMAKE_C_FLAGS_RELEASE "-O3 -Wall -Wextra -Wunused-variable -g -fPIC -msse2 -msse3 -msse4 -ffast-math")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -Wextra -Wunused-variable -g -fPIC -msse2 -msse3 -msse4 -ffast-math")
endif(UNIX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
else(OPENMP_FOUND)
MESSAGE("OpenMP not found")
if(UNIX)
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3 -Wall -std=c++0x -Wunused-variable -Wno-unknown-pragmas -g -fPIC -msse2 -msse3 -msse4 -ffast-math")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -Wall -std=c++0x -Wno-unknown-pragmas -Wunused-variable -g -fPIC -msse2 -msse3 -msse4 -ffast-math")
endif(UNIX)
endif(OPENMP_FOUND)
include_directories(${OpenCV_INCLUDE_DIRS}
${CERES_INCLUDE_DIRS}
include)
add_executable (demo demo.cpp solveSnP.cpp)
target_link_libraries (demo ${OpenCV_LIBRARIES}
${CERES_LIBRARIES}
${OPENMP_LIBRARIES})