forked from cheind/image-align
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
60 lines (48 loc) · 1.55 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
cmake_minimum_required(VERSION 2.8)
project(image-alignment)
if (WIN32)
set(OpenCV_STATIC OFF)
set(OpenCV_SHARED ON)
add_definitions("-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS")
endif()
find_package(OpenCV REQUIRED)
set(IMAGEALIGN_USE_OPENMP OFF CACHE BOOL "Build Image Align with OpenMP support")
if(IMAGEALIGN_USE_OPENMP)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
message(STATUS "Compiling with OpenMP support")
endif()
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${OpenCV_INCLUDE_DIRS} "inc")
# Library
add_library(ialign
inc/imagealign/imagealign.h
inc/imagealign/config.h
inc/imagealign/gradient.h
inc/imagealign/sampling.h
inc/imagealign/warp.h
inc/imagealign/warp_image.h
inc/imagealign/image_pyramid.h
inc/imagealign/align_base.h
inc/imagealign/forward_additive.h
inc/imagealign/forward_compositional.h
inc/imagealign/inverse_compositional.h
src/unused.cpp
)
target_link_libraries(ialign ${OpenCV_LIBRARIES})
# Samples
add_executable(example_align examples/align.cpp)
target_link_libraries(example_align ialign ${OpenCV_LIBRARIES})
add_executable(example_optflow examples/optical_flow.cpp)
target_link_libraries(example_optflow ialign ${OpenCV_LIBRARIES})
# Tests
add_executable(tests
tests/catch.hpp
tests/warp.cpp
tests/sampling.cpp
tests/algorithms.cpp
tests/regression.cpp
)
target_link_libraries(tests ialign ${OpenCV_LIBRARIES})