-
Notifications
You must be signed in to change notification settings - Fork 28
/
CMakeLists.txt
100 lines (65 loc) · 2.62 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
cmake_minimum_required(VERSION 2.8)
project( Bilateral_solver )
set(CMAKE_BUILD_TYPE "Release")
#set(CMAKE_BUILD_TYPE "Debug")
# Check C++11 or C++0x support
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_definitions(-DCOMPILEDWITHC11)
message(STATUS "Using flag -std=c++11.")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
add_definitions(-DCOMPILEDWITHC0X)
message(STATUS "Using flag -std=c++0x.")
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
FIND_PACKAGE( OpenMP REQUIRED)
if(OPENMP_FOUND)
message("OPENMP FOUND")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
set(OpenCV_DIR "/home/wangkuan/lib/opencv3/share/OpenCV")
set(Eigen3_DIR "/home/wangkuan/lib/eigen3/share/eigen3/cmake")
find_package(OpenCV REQUIRED )
find_package(Eigen3 REQUIRED)
message( ${OpenCV_DIR})
message( ${Eigen3_DIR})
include_directories(
${OpenCV_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
add_library(${PROJECT_NAME} SHARED
ICCG.cpp
InputImage.cpp
BilateralGrid.cpp
)
target_link_libraries(${PROJECT_NAME}
${OpenCV_LIBS}
${EIGEN3_LIBS}
)
#add_executable( Colorize colorization.cpp)
#target_link_libraries( Colorize ${PROJECT_NAME} )
#add_executable( Depthsuperres depthsuperresolution.cpp)
#target_link_libraries( Depthsuperres ${PROJECT_NAME} )
#add_executable( Latticefilter permutohedral_lattice.cpp)
#target_link_libraries( Latticefilter ${PROJECT_NAME} )
#add_executable( depth_solver depth.cpp BilateralSolver.hpp)
#target_link_libraries( depth_solver ${PROJECT_NAME} )
#add_executable( color_solver color.cpp BilateralSolver.hpp)
#target_link_libraries( color_solver ${PROJECT_NAME} )
add_executable(bilater BilateralSolver.cpp BilateralSolver.hpp)
target_link_libraries(bilater ${PROJECT_NAME} )
add_executable(colorize new_color.cpp)
target_link_libraries(colorize ${PROJECT_NAME} )
add_executable(colorize_test color.cpp)
target_link_libraries(colorize_test ${PROJECT_NAME} )
#add_executable(SparseMatrix Sparse-Matrix/src/SparseMatrix/SparseMatrix.cpp Sparse-Matrix/tests/run.cpp)
#target_link_libraries( SparseMatrix ${PROJECT_NAME} )