-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
95 lines (75 loc) · 4.69 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
cmake_minimum_required(VERSION 3.7)
project(self_o_mat)
set(CMAKE_CXX_STANDARD 14)
if(VERBOSE)
message("Verbose is set, adding definition")
add_definitions(-DVERBOSE)
endif()
add_definitions(-DVERBOSE)
# Generate protobuf files on file change
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/api.pb.cc ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/api.pb.h
DEPENDS api.proto
COMMAND /bin/sh ${CMAKE_CURRENT_SOURCE_DIR}/compile_protobuf.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
find_package(OpenCV REQUIRED)
find_package(Boost REQUIRED)
if(Boost_FOUND)
if(${Boost_VERSION} VERSION_GREATER_EQUAL 1.70)
find_package(Boost REQUIRED COMPONENTS system thread filesystem chrono)
else()
find_package(Boost REQUIRED COMPONENTS system thread filesystem)
endif()
endif()
find_package(Cups REQUIRED)
find_package(Protobuf REQUIRED)
include_directories(src)
include_directories(dependencies)
include_directories(/usr/include/gphoto2)
include_directories(/opt/libjpeg-turbo/include)
include_directories(${Boost_INCLUDE_DIR})
include_directories(${CUPS_INCLUDE_DIR})
include_directories(${Protobuf_INCLUDE_DIRS})
include_directories(${Protobuf_INCLUDE_DIR})
include_directories(dependencies/served/src)
OPTION (SERVED_BUILD_TESTS "Build served unit test suite" OFF)
OPTION (SERVED_BUILD_EXAMPLES "Build served examples" OFF)
add_subdirectory(dependencies/served)
if(USE_SPI)
message("We have wiring pi!")
add_definitions(-DUSE_SPI)
else()
message("We don't have wiring pi!")
endif()
add_executable(self_o_mat.app src/main.cpp src/logic/BoothLogic.cpp src/logic/BoothLogic.h src/ui/BoothGui.cpp src/ui/BoothGui.h
src/camera/ICamera.h src/camera/OpenCVCamera.cpp src/camera/OpenCVCamera.h src/camera/GphotoCamera.cpp src/camera/GphotoCamera.h
src/ui/FPSCounter.h src/camera/NopCamera.h src/logic/ImageProcessor.cpp src/logic/ImageProcessor.h src/ui/IGui.h src/tools/ILogger.h
src/tools/ConsoleLogger.cpp src/tools/ConsoleLogger.h src/tools/buffers.h src/tools/buffers.cpp src/tools/imageinfo.h src/logic/PrinterManager.cpp
src/logic/PrinterManager.h src/api/BoothApi.h src/api/BoothApi.cpp src/protobuf/api.pb.cc src/protobuf/api.pb.h src/ui/NopGui.cpp
src/ui/NopGui.h src/tools/JpegDecoder.cpp src/tools/JpegDecoder.h src/tools/verbose.h src/tools/blocking_reader.h
src/camera/controllers/BaseController.h src/camera/controllers/TriggerController.cpp src/camera/controllers/NikonViewfinderController.h
src/camera/controllers/TriggerController.h src/camera/controllers/BaseController.cpp src/camera/controllers/FocusController.cpp
src/camera/controllers/FocusController.h src/camera/controllers/InfoController.cpp src/camera/controllers/InfoController.h
src/camera/controllers/ApertureController.h src/camera/controllers/ExposureCorrectionController.h src/camera/controllers/ChoiceRangeController.cpp
src/camera/controllers/ChoiceRangeController.h src/tools/readfile.h src/tools/readfile.cpp src/tools/cobs.h src/tools/cobs.cpp src/logic/SelfomatController.cpp src/logic/SelfomatController.h src/logic/filters/IImageFilter.h src/logic/filters/BasicImageFilter.cpp src/logic/filters/BasicImageFilter.h src/logic/filters/IImageFilter.cpp src/tools/FilesystemLogger.cpp src/tools/FilesystemLogger.h src/tools/verbose.cpp)
target_link_libraries(self_o_mat.app ${Boost_LIBRARIES})
target_link_libraries(self_o_mat.app gphoto2)
target_link_libraries(self_o_mat.app turbojpeg)
target_link_libraries(self_o_mat.app sfml-system)
target_link_libraries(self_o_mat.app sfml-graphics)
target_link_libraries(self_o_mat.app sfml-window)
target_link_libraries(self_o_mat.app ${OpenCV_LIBS})
target_link_libraries(self_o_mat.app ${CUPS_LIBRARIES})
target_link_libraries(self_o_mat.app served)
target_link_libraries(self_o_mat.app protobuf)
add_executable(filter_test src/main_filter.cpp src/logic/filters/IImageFilter.h src/logic/filters/BasicImageFilter.cpp src/logic/filters/BasicImageFilter.h src/logic/filters/IImageFilter.cpp)
target_link_libraries(filter_test ${Boost_LIBRARIES})
target_link_libraries(filter_test ${OpenCV_LIBS})
add_executable(opencv_info src/main_opencv_info.cpp)
target_link_libraries(opencv_info ${OpenCV_LIBS})
if(USE_SPI)
target_link_libraries(self_o_mat.app wiringPi)
endif()
add_custom_target(WITH_APP /bin/sh ${CMAKE_CURRENT_SOURCE_DIR}/deploy_app.sh ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(PACK /bin/sh ${CMAKE_CURRENT_SOURCE_DIR}/pack.sh ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies(PACK self_o_mat.app)
add_dependencies(self_o_mat.app WITH_APP)