-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
196 lines (134 loc) · 5.38 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# openPablo CMakeLists.txt
# --- cmake settings
#
cmake_minimum_required (VERSION 2.8)
# --- project settings
#
PROJECT (openpablo)
set (openpablo_VERSION_MAJOR 0)
set (openpablo_VERSION_MINOR 1)
set (openpablo_LIB_VERSION 1)
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
# should doc-generation (doxygen, manual) be run?
set (compile_docs OFF)
# --- extra options
#
# option(USE_CAMERA_SUPPORT "Detect and use camera support if available." ON)
# --- specific os things
#
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# linux specific code
SET(OperatingSystem "Linux")
message("-- Linux build detected.")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# OSX specific code
SET(OperatingSystem "Mac OS X")
message("-- OSX build detected.")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(WIN32)
# windows specific code
SET(OperatingSystem "Win")
message("-- Windows build detected.")
endif(WIN32)
# --- avoid source tree pollution
#
If(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-source builds are not permitted. Make a separate folder for building:\nmkdir build; cd build; cmake ..\nBefore that, remove the files already created:\nrm -rf CMakeCache.txt CMakeFiles")
endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
# --- required packages
#
find_package(Boost COMPONENTS system filesystem REQUIRED)
find_package(Exiv2 REQUIRED)
find_package(Logog REQUIRED)
find_package(ImageMagick COMPONENTS Magick++ REQUIRED)
find_package(ImageMagick COMPONENTS MagickCore REQUIRED)
find_package(LCMS2 REQUIRED)
find_package(Lensfun REQUIRED)
find_package(LibMagic REQUIRED)
find_package(LIBPODOFO REQUIRED)
find_package(LibRaw REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Qt COMPONENTS QtOpenGL QtXml REQUIRED)
find_package(Qt4 4.7 REQUIRED QtCore QtGui QtXml)
find_package(RawTherapeeEngine REQUIRED)
# --- RAWTHERAPEE
# check for libraries
find_package(PkgConfig)
pkg_check_modules (GTK REQUIRED gtk+-2.0>=2.12)
pkg_check_modules (GLIB2 REQUIRED glib-2.0>=2.16)
pkg_check_modules (GLIBMM REQUIRED glibmm-2.4>=2.16)
pkg_check_modules (GTKMM REQUIRED gtkmm-2.4>=2.12)
pkg_check_modules (GIO REQUIRED gio-2.0>=2.16)
pkg_check_modules (GIOMM REQUIRED giomm-2.4>=2.12)
pkg_check_modules (GTHREAD REQUIRED gthread-2.0>=2.16)
pkg_check_modules (GOBJECT REQUIRED gobject-2.0>=2.16)
pkg_check_modules (SIGC REQUIRED sigc++-2.0)
#----
# --- find dependencies
#
IF (UNIX)
FIND_PACKAGE(PkgConfig)
ENDIF (UNIX)
IF(WIN32)
set(OPENPABLO_SHARED "0" CACHE STRING "Build shared internal libraries" )
ELSE(WIN32)
set(OPENPABLO_SHARED "1" CACHE STRING "Build shared internal libraries" )
ENDIF(WIN32)
add_definitions(-Wall -W -ggdb)
include_directories(${ImageMagick_INCLUDE_DIRS})
include_directories(${LIBPODOFO_INCLUDE_DIR})
include_directories(${EXIV2_INCLUDE_DIR})
include_directories(${LENSFUN_INCLUDE_DIR})
include_directories(${LibMagic_INCLUDE_DIR})
# include_directories(${RawTherapeeEngine_INCLUDE_DIR})
include_directories(${LOGOG_INCLUDE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_BINARY_DIR}/src)
#include_directories(${CMAKE_SOURCE_DIR}/src/processors)
include(${QT_USE_FILE})
# --- add subdirectories
add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(doc)
# --- add 3rd party libraries
#
#add_subdirectory(3rdparty/json_spirit)
#include_directories (${JSONSPIRIT_SOURCE_DIR}/json_spirit)
#link_directories (${JSONSPIRIT_BINARY_DIR}/json_spirit)
#SET(SRC openpablo)
#install (FILES openpablo DESTINATION "${PROJECT_BINARY_DIR}/bin")
set(PROJECT_BINARY_DIR ${PROJECT_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
# --- build a CPack driven installer package
#
include (InstallRequiredSystemLibraries)
set (CPACK_RESOURCE_FILE_LICENSE
"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
set (CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
include (CPack)
# --- copy over some files
#
file(COPY ${PROJECT_SOURCE_DIR}/data DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${PROJECT_SOURCE_DIR}/tests DESTINATION ${CMAKE_CURRENT_BINARY_DIR} FILES_MATCHING PATTERN *)
#
# ----------------------------------------------------------------------------
# add a target to generate API documentation with Doxygen
# ----------------------------------------------------------------------------#
#
find_package(Doxygen)
if(DOXYGEN_FOUND)
message("Doxygen template file is ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in")
configure_file(${PROJECT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
if(compile_docs)
add_custom_target(doxygen ALL ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM)
else(compile_docs)
# add_custom_target(doxygen ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
# COMMENT "Generating API documentation with Doxygen" VERBATIM)
endif(compile_docs)
endif(DOXYGEN_FOUND)