-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (54 loc) · 2.36 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
60
61
62
63
64
65
cmake_minimum_required(VERSION 3.3.4)
project(new_pnp VERSION 0.0.1 DESCRIPTION "new and faster PnP library")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations -O3 -march=native ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -O3 -march=native")
include_directories(${CMAKE_SOURCE_DIR}/src)
find_package(Eigen3 3.3.4 REQUIRED)
# TODO: optional add mkl support for faster and more accurate results
#set(MKLROOT "/home/$USER/intel/compilers_and_libraries_2020.1.217/linux/mkl/")
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ltbb -D__STDC_CONSTANT_MACROS")
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")
find_package( OpenCV 3.2.0 REQUIRED )
set(source_files
${PROJECT_SOURCE_DIR}/PnPProblem.cpp
${PROJECT_SOURCE_DIR}/Utils_pnp/Definitions.h
${PROJECT_SOURCE_DIR}/Utils_pnp/GeneralUtils.cpp
${PROJECT_SOURCE_DIR}/Utils_pnp/Parsing.cpp
${PROJECT_SOURCE_DIR}/src/DualVar.cpp
${PROJECT_SOURCE_DIR}/src/PnpBarrierMethodSolver.cpp
${PROJECT_SOURCE_DIR}/src/PnpInput.cpp
${PROJECT_SOURCE_DIR}/src/PnpLocalSearch.cpp
${PROJECT_SOURCE_DIR}/src/PnpObjective.cpp
${PROJECT_SOURCE_DIR}/src/PnpProblemSolver.cpp
${PROJECT_SOURCE_DIR}/src/PnpResult.cpp
${PROJECT_SOURCE_DIR}/src/QuaternionVector.cpp
)
# TODO: library creation file and directory
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
add_library(${PROJECT_NAME} SHARED
${source_files}
)
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
# TODO: public headers file
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER
include/PnpProblemSolver.h
# PnPProblem.h
)
include_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/Utils_pnp
${EIGEN3_INCLUDE_DIR}
${OpenCV_INCLUDE_DIRS}
)
include_directories(-Idependencies/include -Ldependencies/lib)
target_include_directories(${PROJECT_NAME} PRIVATE include)
target_include_directories(${PROJECT_NAME} PRIVATE src)
target_link_libraries(${PROJECT_NAME}
${OpenCV_LIBS}
${EIGEN3_LIBS}
)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
add_executable(sample_rotation examples/test_simple_rotation.cpp)
target_link_libraries(sample_rotation ${PROJECT_NAME})