-
Notifications
You must be signed in to change notification settings - Fork 25
/
CMakeLists.txt
286 lines (238 loc) · 9.41 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# Project: PlexyDesk # License: LGPL3
# Project Author: [email protected]
# CMAKE files by: [email protected]
# PhobosK ([email protected])
PROJECT(PlexyDesktop)
# Project variables that need to be defined manually
SET(LIB_MAJOR 0)
SET(LIB_MINOR 6)
SET(LIB_RELEASE 6)
SET(APPLICATION_INTERNAL_VERSION 20121008)
SET(APPLICATION_DATE 2012-10-08)
SET(APPLICATION_EXE_NAME plexydesk)
SET(PLEXY_UI_CORE_LIBRARY plexydeskuicore)
SET(PLEXY_CORE_LIBRARY plexydeskcore)
# Auto defined project variables
SET(APPLICATION_NAME "${PROJECT_NAME}")
SET(APPLICATION_MAIN_VERSION "${LIB_MAJOR}.${LIB_MINOR}.${LIB_RELEASE}")
SET(RESOURCES_DEST_DIR share/plexy/themepack/default/resources)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
CMAKE_POLICY(SET CMP0003 OLD)
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmakemodules)
# Needed/optional packages definitions
FIND_PACKAGE(Qt4 4.7.0 COMPONENTS QtCore QtGui QtOpenGL QtXml QtDeclarative QtSql QtSvg REQUIRED)
FIND_PACKAGE(FFMPEG) #optional
FIND_PACKAGE(OpenCV) #optional
FIND_PACKAGE(QImageBlitz REQUIRED)
FIND_PACKAGE(OpenGL)
FIND_PACKAGE(BISON REQUIRED)
FIND_PACKAGE(FLEX REQUIRED)
# Global variable CMAKE_BUILD_TYPE handling
# None (CMAKE_C_FLAGS or CMAKE_CXX_FLAGS used)
# Debug (CMAKE_C_FLAGS_DEBUG or CMAKE_CXX_FLAGS_DEBUG)
# Release (CMAKE_C_FLAGS_RELEASE or CMAKE_CXX_FLAGS_RELEASE)
# RelWithDebInfo (CMAKE_C_FLAGS_RELWITHDEBINFO or CMAKE_CXX_FLAGS_RELWITHDEBINFO
# MinSizeRel (CMAKE_C_FLAGS_MINSIZEREL or CMAKE_CXX_FLAGS_MINSIZEREL)
# By default we should set it to Release. This can be overridden by a -D command
# line switch.
IF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release
CACHE
STRING "Specify build type: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF (NOT CMAKE_BUILD_TYPE)
# Check if we use any Debug in the final release and if so use console in Windows
# For the targets add ${WIN_APPLICATION} as second argument if you want a non
# console application like:
# example: ADD_EXECUTABLE(exe_target ${WIN_APPLICATION} ${sourceFiles})
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
MESSAGE(STATUS "Setting Debug flags ...")
SET(WIN_APPLICATION "")
ELSE(CMAKE_BUILD_TYPE MATCHES "Debug")
# Note: the WIN32 is ignored on other platforms than Windows
SET(WIN_APPLICATION "WIN32")
ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
# Check on Windows if we have used CMAKE_INSTALL_PREFIX or default it to
# outsource special ready path
# Set the install prefix
IF(WIN32)
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/${APPLICATION_EXE_NAME}-ready-build")
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
ENDIF(WIN32)
INCLUDE(PkgConfigGetVar)
INCLUDE(GNUInstallDirs)
# *** QT vars handling ***
# This will cause cmake to include and link against the OpenGL module.
# Set all flags first and then use the QT_USE_FILE to set everything.
# Note that QT_USE_FILE also sets QT_DEFINITIONS
SET(QT_USE_OPENGL TRUE)
SET(QT_USE_QTMAIN TRUE)
#SET(QT_USE_QTMULTIMEDIA TRUE)
SET(QT_USE_QTNETWORK TRUE)
SET(QT_USE_QTXML TRUE)
SET(QT_USE_QTSVG TRUE)
SET(QT_USE_QTSQL TRUE)
SET(QT_USE_QTTEST TRUE)
IF (NOT WIN32)
IF (NOT APPLE)
SET(QT_USE_QTDBUS TRUE)
ENDIF (NOT APPLE)
ENDIF (NOT WIN32)
SET(QT_USE_QTWEBKIT TRUE)
SET(QT_USE_QTXMLPATTERNS TRUE)
SET(QT_USE_QTSCRIPT TRUE)
SET(QT_USE_QTDECLARATIVE TRUE)
INCLUDE(${QT_USE_FILE})
SET(QT_IMPORTS_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/qt4/imports)
# On Windows we use a predefined QT_IMPORTS_INSTALL_DIR
IF (NOT WIN32)
# Workaround for platforms that do not provide it (Ubuntu)
IF(NOT QT_IMPORTS_DIR)
MESSAGE("QT_IMPORTS_DIR not present...\nUsing a built in one: ${CMAKE_INSTALL_FULL_LIBDIR}/qt4/imports")
SET(QT_IMPORTS_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/qt4/imports)
ELSE(NOT QT_IMPORTS_DIR)
# Making QT_IMPORTS_INSTALL_DIR relative. This is a dirty hack but should work
STRING(REGEX REPLACE "^/usr/" "" QT_IMPORTS_INSTALL_DIR "${QT_IMPORTS_DIR}")
MESSAGE(STATUS "Relative QT Imports path set to: ${QT_IMPORTS_INSTALL_DIR}")
ENDIF(NOT QT_IMPORTS_DIR)
ENDIF(NOT WIN32)
INCLUDE_DIRECTORIES (
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
)
IF(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
ENDIF(MSVC)
IF(WIN32)
SET(FFMPEG_INCLUDE_DIR ${CMAKE_BINARY_DIR}/win32/ffmpeg/include)
SET(FFMPEG_LIBRARIES avcodec avdevice avformat avutil)
SET(FFMPEG_FOUND TRUE)
ENDIF(WIN32)
CONFIGURE_FILE(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
#blackberry 10 sdk
CONFIGURE_FILE(dist/bb10/plexydesk-bb10.xml.cmake ${CMAKE_CURRENT_BINARY_DIR}/plexydesk-bb10.xml)
CONFIGURE_FILE(dist/bb10/plexydesk-create-package.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/plexydesk-create-package.sh)
#doxygen
find_package (Doxygen)
CONFIGURE_FILE(plexydesk.Doxyfile.cmake ${CMAKE_CURRENT_BINARY_DIR}/plexydesk.Doxyfile )
if (DOXYGEN_FOUND)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/docs/api/)
add_custom_target (doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/plexydesk.Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs/api
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif (DOXYGEN_FOUND)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/runner/plexydesk.cmake.desktop"
"${CMAKE_CURRENT_BINARY_DIR}/runner/plexydesk.desktop"
@ONLY)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/dist/windows/make_nsis_installer.cmake.nsi"
"${CMAKE_CURRENT_BINARY_DIR}/dist/windows/make_nsis_installer.nsi"
@ONLY)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmakemodules/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
# *** Windows Resource file handling ***
# Put all the resource files for Windows in this section using the pattern bellow
# For every rc file a "CONFIGURE_FILE" and a "IF(MINGW)" is needed
# Then add the resource to the sources files as "resourceFiles" and use them
# in the final target to be compiled (for an example see the runner/CMakeLists.txt)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/dist/windows/${APPLICATION_EXE_NAME}_windres.rc.in"
"${CMAKE_CURRENT_BINARY_DIR}/dist/windows/${APPLICATION_EXE_NAME}_windres.rc")
IF(MINGW)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/wally_rc.o
COMMAND windres.exe
-I ${CMAKE_CURRENT_SOURCE_DIR}/dist/windows
-o ${CMAKE_CURRENT_BINARY_DIR}/dist/windows/${APPLICATION_EXE_NAME}_rc.o
-i ${CMAKE_CURRENT_BINARY_DIR}/dist/windows/windres.rc
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dist/windows
COMMENT "Generating windows RC file ...")
ENDIF(MINGW)
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/base/qt4
${CMAKE_BINARY_DIR}/base/qt4
${CMAKE_SOURCE_DIR}/base/core
${CMAKE_BINARY_DIR}/base/core
${CMAKE_SOURCE_DIR}/runner
${CMAKE_BINARY_DIR}/runner
${CMAKE_SOURCE_DIR}/3rdparty/json-cpp
${CMAKE_SOURCE_DIR}/3rdparty/json-cpp/json/
${CMAKE_SOURCE_DIR}/dist/windows
${CMAKE_BINARY_DIR}/dist/windows
${QT_INCLUDE_DIR}
)
IF (NOT APPLE)
IF (UNIX)
# *** LINUX ONLY ***
#ADD_SUBDIRECTORY(panel)
#ADD_SUBDIRECTORY(social)
#ADD_SUBDIRECTORY(social/accountsmanager)
# UI widgets
#ADD_SUBDIRECTORY(extensions/widgets/cpu)
# Data plugins
# ************
ENDIF (UNIX)
IF(NOT WIN32)
IF(FFMPEG_FOUND)
# ADD_SUBDIRECTORY(extensions/data/videoengine)
ENDIF(FFMPEG_FOUND)
ENDIF(NOT WIN32)
ENDIF (NOT APPLE)
IF(WIN32)
ADD_SUBDIRECTORY(dist/windows)
ENDIF(WIN32)
if (CMAKE_SYSTEM_NAME MATCHES "QNX")
set (QNX 1)
endif (CMAKE_SYSTEM_NAME MATCHES "QNX")
if (NOT QNX)
ADD_SUBDIRECTORY(extensions/data/facebook)
ADD_SUBDIRECTORY(extensions/facebook/authwin)
ADD_SUBDIRECTORY(3rdparty/json-cpp/)
ENDIF(NOT QNX)
# *** ALL PLATFORMS ***
ADD_SUBDIRECTORY(3rdparty/mime)
ADD_SUBDIRECTORY(base/qt4)
ADD_SUBDIRECTORY(base/core)
ADD_SUBDIRECTORY(extensions/widgets/clock)
ADD_SUBDIRECTORY(extensions/widgets/photoframe)
ADD_SUBDIRECTORY(extensions/widgets/folderwidget)
ADD_SUBDIRECTORY(extensions/backdrop/classicdrop)
ADD_SUBDIRECTORY(extensions/widgets/youtubewidget)
ADD_SUBDIRECTORY(extensions/widgets/mobilemonitor)
ADD_SUBDIRECTORY(runner)
#if (APPLE)
#ADD_SUBDIRECTORY(extensions/backdrop/mac_background)
#endif (APPLE)
# *** Desktop UI Plugins ***
ADD_SUBDIRECTORY(extensions/desktop/plexy)
# *** UI widgets - ALL PLATFORMS ***
# Youtube is diabled ListView is now at extensions/widgets
#ADD_SUBDIRECTORY(extensions/widgets/youtubewidget)
# *** Data plugins - ALL PLATFORMS ***
ADD_SUBDIRECTORY(extensions/data/rest)
ADD_SUBDIRECTORY(extensions/data/timer)
ADD_SUBDIRECTORY(extensions/data/bbconn)
# Youtube is diabled ListView is now at extensions/widgets
#ADD_SUBDIRECTORY(extensions/data/utube)
# *** Themes and themepacks - ALL PLATFORMS ***
ADD_SUBDIRECTORY(artwork)
# *** Removed from building - ALL PLATFORMS ***
#ADD_SUBDIRECTORY(3rdparty/cair)
#ADD_SUBDIRECTORY(extensions/widgets/demowidget)
#post build
If (QNX)
add_custom_target (package sh ${CMAKE_CURRENT_BINARY_DIR}/plexydesk-create-package.sh
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}
COMMENT "Create Package for Blackberry 10" VERBATIM
)
endif (QNX)