-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
63 lines (51 loc) · 2.08 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
cmake_minimum_required(VERSION 2.6)
project(tpofinder)
# General settings
set(BUILD_SHARED_LIBS true)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
add_definitions(-std=c++0x)
# OpenCV
find_package(OpenCV 2.4 REQUIRED)
# Boost
find_package(Boost COMPONENTS filesystem program_options system)
# Sources and headers
file(GLOB srcs src/*.cpp)
file(GLOB tsts test/test*.cpp)
include_directories("${PROJECT_SOURCE_DIR}/include")
include_directories("${PROJECT_BINARY_DIR}/include")
# Configure headers
configure_file(
"${PROJECT_SOURCE_DIR}/include/tpofinder/configure.h.in"
"${PROJECT_BINARY_DIR}/include/tpofinder/configure.h")
# Library construction
add_library(${PROJECT_NAME} ${srcs})
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
# Executables
add_executable(model_homography apps/model_homography.cpp)
add_executable(sequence_homography apps/sequence_homography.cpp)
add_executable(invert_homography apps/invert_homography.cpp)
add_executable(tpofind apps/tpofind.cpp)
target_link_libraries(model_homography ${PROJECT_NAME})
target_link_libraries(sequence_homography ${PROJECT_NAME})
target_link_libraries(invert_homography ${PROJECT_NAME})
target_link_libraries(tpofind ${PROJECT_NAME})
# Data
file(COPY "${PROJECT_SOURCE_DIR}/data" DESTINATION "${PROJECT_BINARY_DIR}")
# Testing
enable_testing()
# Set up gest; see also
# http://groups.google.com/group/googletestframework/browse_thread/thread/d1259032b859e5a3
# for a discussion on how to best integrate gtest with a project that uses
# cmake. Here, don't use FindGTest but rather ship gtest along with the source
# as a tar.gz which can be handled by cmake.
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xvzf ${PROJECT_SOURCE_DIR}/gtest-1.6.0.tar.gz
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_subdirectory(${CMAKE_BINARY_DIR}/gtest-1.6.0)
include_directories(${CMAKE_BINARY_DIR}/gtest-1.6.0/include)
set(GTest_LIBRARIES gtest)
add_executable(utest ${tsts})
target_link_libraries(utest ${GTest_LIBRARIES} ${PROJECT_NAME})