-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
86 lines (64 loc) · 2.49 KB
/
CMakeLists.txt
File metadata and controls
86 lines (64 loc) · 2.49 KB
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
cmake_minimum_required(VERSION 2.8.4)
project(lpm)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
########################################
# Boost
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.49.0 REQUIRED program_options)
include_directories(${Boost_INCLUDE_DIR})
set(LINK_LIBS ${LINK_LIBS} ${Boost_LIBRARIES})
########################################
# OpenGL + Co
find_package(OpenGL REQUIRED)
#find_package(GLM REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
pkg_search_module(FREETYPE REQUIRED freetype2)
include_directories(${GLFW_INCLUDE_DIRS}
${GLM_INCLUDE_DIRS}
${OpenGL_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS})
link_directories(${GLFW_LIBRARY_DIRS}
${GLM_LIBRARY_DIRS}
${FREETYPE_LIBRARY_DIRS}
${OpenGL_LIBRARY_DIRS})
set(LINK_LIBS ${LINK_LIBS} ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} ${FREETYPE_LIBRARIES})
#######################################
# YAML CPP
pkg_check_modules(YAMLCPP REQUIRED yaml-cpp)
include_directories(${YAMLCPP_INCLUDE_DIRS})
link_directories(${YAMLCPP_LIBRARY_DIRS})
set(LINK_LIBS ${LINK_LIBS} ${YAMLCPP_LIBRARIES})
########################################
# IRIS
find_package(IRIS REQUIRED)
include_directories(${IRIS_INCLUDE_DIRS})
link_directories(${IRIS_LIBRARY_DIRS})
set(LINK_LIBS ${LINK_LIBS} ${IRIS_LIBRARIES})
#########################################
# Linux
if(NOT APPLE)
pkg_search_module(GLEW REQUIRED glew)
include_directories(${GLEW_INCLUDE_DIRS})
link_directories(${GLEW_LIBRARY_DIRS})
set(LINK_LIBS ${LINK_LIBS} ${GLEW_LIBRARIES})
set(LINK_LIBS ${LINK_LIBS} -lstdc++ -lm)
endif()
#########################################
set(lpm_SOURCES lpm.cc)
add_executable(lpm ${lpm_SOURCES})
target_link_libraries(lpm ${LINK_LIBS})
set(LEDPhotoSpectrum_SOURCES LEDPhotoSpectrum.cc cfg.cc)
add_executable(lpm-LEDPhotoSpectrum ${LEDPhotoSpectrum_SOURCES})
target_link_libraries(lpm-LEDPhotoSpectrum ${LINK_LIBS})
set(ledPWMthresholder_SOURCES ledPWMthresholder.cc cfg.cc)
add_executable(lpm-ledPWMthresholder ${ledPWMthresholder_SOURCES})
target_link_libraries(lpm-ledPWMthresholder ${LINK_LIBS})
#########################################
# installation
install(TARGETS lpm lpm-LEDPhotoSpectrum lpm-ledPWMthresholder
RUNTIME DESTINATION bin
COMPONENT applications)