-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
58 lines (45 loc) · 2.37 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
cmake_minimum_required(VERSION 3.5)
project(HoughTransform)
set(CMAKE_CXX_STANDARD 14)
set(CXX_STANDARD_REQUIRED)
#----------------------------------------------------------------------------------------------------#
#External libraries
#----------------------------------------------------------------------------------------------------#
set(STB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/stb)
set(CXXOPTS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/cxxopts/include)
set(CEREAL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/cereal-master/include)
set(CATCH2_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/catch2)
#Eigen
find_package (Eigen3 REQUIRED NO_MODULE)
add_subdirectory(third_party/eigen)
#Stb
add_library(stb INTERFACE)
target_include_directories(stb INTERFACE ${STB_INCLUDE_DIR})
#Cxxopts
add_library(cxxopts INTERFACE)
target_include_directories(cxxopts INTERFACE ${CXXOPTS_INCLUDE_DIR})
#Config4cpp
add_library(config4cpp INTERFACE)
target_include_directories(config4cpp INTERFACE ${CONFIG4CPP_INCLUDE_DIR})
#Cereal
add_library(cereal INTERFACE)
target_include_directories(cereal INTERFACE ${CEREAL_INCLUDE_DIR})
#Catch2
add_subdirectory(third_party/Catch2)
#----------------------------------------------------------------------------------------------------#
# Main library
#----------------------------------------------------------------------------------------------------#
add_library(hough_lib STATIC src/recursive_hough_transform.cpp src/eigen_utils.cpp src/rectangle_detection.cpp src/io.cpp
src/process_image.cpp src/rectangle_utils.cpp src/rectangle_detection.cpp include/eigen_utils.hpp include/rectangle_detection.hpp include/io.hpp include/config.hpp include/process_image.hpp
include/recursive_hough_transform.hpp)
target_include_directories(hough_lib PUBLIC include)
target_link_libraries(hough_lib PUBLIC Eigen3::Eigen PUBLIC cereal PRIVATE stb)
#----------------------------------------------------------------------------------------------------#
# Source code
#----------------------------------------------------------------------------------------------------#
add_subdirectory(apps)
#----------------------------------------------------------------------------------------------------#
# Tests
#----------------------------------------------------------------------------------------------------#
enable_testing()
add_subdirectory(tests)