Subversion Repositories Scribus

Rev

Rev 21474 | Rev 21487 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
10215 cbradney 1
##############################################################################################################
2
########## CMake Setup                                                                              ##########
3
 
9680 cbradney 4
#Set our CMake minimum version
18447 craig 5
#Require 2.8.9 for Qt5
21377 craig 6
#Require 3.1.0 for Qt 5.7 C++ 11 easy support
20014 craig 7
#Require 3.2.0 for add_custom_target with byproducts
21377 craig 8
CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0 FATAL_ERROR)
5758 cbradney 9
 
9680 cbradney 10
#Pretty colors
5142 cbradney 11
SET(CMAKE_COLOR_MAKEFILE ON)
20014 craig 12
#Don't force verbose
9715 avox 13
SET(CMAKE_VERBOSE_MAKEFILE OFF)
9680 cbradney 14
#Include current dir
5142 cbradney 15
SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)
21013 craig 16
#Don't allow in source builds
21016 craig 17
#SET(CMAKE_DISABLE_SOURCE_CHANGES ON)
18
#SET(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
21013 craig 19
 
20
 
10459 cbradney 21
#RPATH setup - more below too
10327 cbradney 22
IF (WANT_NORPATH OR WANT_DISTROBUILD)
20014 craig 23
	SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
10327 cbradney 24
ELSE (WANT_NORPATH OR WANT_DISTROBUILD)
20014 craig 25
	SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
10327 cbradney 26
ENDIF (WANT_NORPATH OR WANT_DISTROBUILD)
10459 cbradney 27
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
9715 avox 28
SET(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
8902 cbradney 29
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
30
 
10215 cbradney 31
INCLUDE(CheckIncludeFile)
32
INCLUDE(CheckCCompilerFlag)
33
INCLUDE(CheckCXXCompilerFlag)
34
INCLUDE(CheckTypeSize)
35
INCLUDE(TestBigEndian)
20023 craig 36
INCLUDE(GNUInstallDirs)
21325 craig 37
#INCLUDE(FeatureSummary)
10215 cbradney 38
 
16856 craig 39
#ENABLE_TESTING()
40
 
9680 cbradney 41
#Set the custom CMake module directory where our include/lib finders are
5142 cbradney 42
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
9680 cbradney 43
 
10215 cbradney 44
##############################################################################################################
45
########## toplevel compiler flags                                                                  ##########
15099 cbradney 46
MESSAGE(STATUS "Shared Library Flags: ${CMAKE_SHARED_LIBRARY_C_FLAGS}")
10215 cbradney 47
 
9680 cbradney 48
#Project Setup
5142 cbradney 49
PROJECT(scribus)
9680 cbradney 50
#Set our version values
14911 cbradney 51
#Final version is ${VERSION} = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_SUFFIX}
14373 cbradney 52
#where VERSION_SUFFIX is of the form "", "svn" or "Nsvn" (N being the minor patch level)
5396 cbradney 53
SET (VERSION_MAJOR "1")
13511 mrdocs 54
SET (VERSION_MINOR "5")
21334 craig 55
SET (VERSION_PATCH "3")
56
SET (VERSION_SUFFIX "svn")
14911 cbradney 57
SET (VERSION ${VERSION_MAJOR})
58
IF (VERSION_MINOR GREATER -1)
20014 craig 59
	SET (VERSION ${VERSION}.${VERSION_MINOR})
14911 cbradney 60
ENDIF (VERSION_MINOR GREATER -1)
61
IF (VERSION_PATCH GREATER -1)
20014 craig 62
	SET (VERSION ${VERSION}.${VERSION_PATCH})
14911 cbradney 63
ENDIF (VERSION_PATCH GREATER -1)
64
IF (VERSION_SUFFIX)
20014 craig 65
	SET (VERSION ${VERSION}.${VERSION_SUFFIX})
14911 cbradney 66
ENDIF (VERSION_SUFFIX)
20014 craig 67
MESSAGE(STATUS "Scribus ${VERSION} will be built and installed into ${CMAKE_INSTALL_PREFIX}")
5142 cbradney 68
 
9680 cbradney 69
#Set the permissions to be used when installing plugins
5142 cbradney 70
SET(PLUGIN_PERMISSIONS WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE WORLD_READ GROUP_READ OWNER_READ OWNER_WRITE)
71
 
9680 cbradney 72
#Our main directory is scribus
5379 cbradney 73
SET(MAIN_DIR_NAME "scribus")
9680 cbradney 74
 
10215 cbradney 75
##############################################################################################################
10238 cbradney 76
########## check for the CPU we build for                                                           ##########
77
 
78
EXECUTE_PROCESS(
20014 craig 79
	COMMAND ${CMAKE_C_COMPILER} -dumpmachine
80
	OUTPUT_VARIABLE MACHINE
81
	OUTPUT_STRIP_TRAILING_WHITESPACE
10238 cbradney 82
)
20014 craig 83
 
84
## Find out what machine/cpu we are running on
14373 cbradney 85
MESSAGE(STATUS  "Machine: ${MACHINE}, void pointer size: ${CMAKE_SIZEOF_VOID_P}")
19233 craig 86
STRING(REGEX MATCH "(i[0-9]86-*)|(athlon-*)|(pentium-*)" _machine_x86 "${MACHINE}")
10238 cbradney 87
IF (_machine_x86)
20014 craig 88
	MESSAGE(STATUS "Found target X86")
89
	SET(ARCH_X86 1)
10238 cbradney 90
ENDIF (_machine_x86)
91
 
92
STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _machine_x86_64 "${MACHINE}")
93
IF (_machine_x86_64)
19233 craig 94
	MESSAGE(STATUS "Found target X86_64")
95
	SET(ARCH_X86_64 1)
10238 cbradney 96
ENDIF (_machine_x86_64)
97
 
20014 craig 98
STRING(REGEX MATCH "(sparc64-*)|(SPARC64-*)" _machine_sparc_64 "${MACHINE}")
99
IF (_machine_sparc_64)
100
	MESSAGE(STATUS "Found target SPARC 64")
101
	SET(ARCH_SPARC_64 1)
102
ENDIF (_machine_sparc_64)
103
 
104
STRING(REGEX MATCH "(mips64-*)|(MIPS64-*)" _machine_mips_64 "${MACHINE}")
105
IF (_machine_mips_64)
106
	MESSAGE(STATUS "Found target MIPS 64")
107
	SET(ARCH_MIPS_64 1)
108
ENDIF (_machine_mips_64)
109
 
110
STRING(REGEX MATCH "(ppc-*)|(powerpc-*)" _machine_ppc "${MACHINE}")
111
IF (_machine_ppc)
112
	MESSAGE(STATUS "Found target PPC")
113
	SET(ARCH_PPC 1)
114
ENDIF (_machine_ppc)
115
 
116
STRING(REGEX MATCH "(ppc64-*)|(PPC64-*)|(powerpc64-*)" _machine_ppc_64 "${MACHINE}")
117
IF (_machine_ppc_64)
118
	MESSAGE(STATUS "Found target PPC64")
119
	SET(ARCH_PPC_64 1)
120
ENDIF (_machine_ppc_64)
121
 
122
STRING(REGEX MATCH "(sparc-*)" _machine_sparc "${MACHINE}")
123
IF (_machine_sparc)
124
	MESSAGE(STATUS "Found target Sparc")
125
	SET(ARCH_SPARC 1)
126
ENDIF (_machine_sparc)
127
 
128
STRING(REGEX MATCH "(sparcv9-*)" _machine_sparcv9 "${MACHINE}")
129
IF (_machine_sparcv9)
130
	MESSAGE(STATUS "Found target Sparc v9")
131
	SET(ARCH_SPARCV9 1)
132
ENDIF (_machine_sparcv9)
133
 
134
STRING(REGEX MATCH "(sparc64-*)" _machine_sparc64 "${MACHINE}")
135
IF (_machine_sparc64)
136
	MESSAGE(STATUS "Found target Sparc64")
137
	SET(ARCH_SPARC64 1)
138
	SET(ARCH64BIT 1)
139
ENDIF (_machine_sparc64)
140
 
20469 craig 141
STRING(REGEX MATCH "(hppa*)" _machine_hppa "${MACHINE}")
142
IF (_machine_hppa)
143
	MESSAGE(STATUS "Found target Hppa")
144
	SET(ARCH_HPPA 1)
145
ENDIF (_machine_hppa)
146
 
147
# We need to pass -fPIC to lib2geom on amd64, mips, mipsel, and hppa. See:
148
# http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3 and
149
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559133
150
 
151
IF (ARCH_X86_64 EQUAL 1 OR ARCH_HPPA EQUAL 1 OR ARCH_MIPS EQUAL 1 OR ARCH_MIPS_64 EQUAL 1 OR ARCH_PPC_64 EQUAL 1)
152
	SET(CMAKE_CXX_FLAGS_FPIC "-fPIC")
153
ENDIF (ARCH_X86_64 EQUAL 1 OR ARCH_HPPA EQUAL 1 OR ARCH_MIPS EQUAL 1 OR ARCH_MIPS_64 EQUAL 1 OR ARCH_PPC_64 EQUAL 1)
154
 
20014 craig 155
## Do our Apple OSX version setup
19233 craig 156
IF (APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND (ARCH_X86 EQUAL 1 OR ARCH_X86_64 EQUAL 1))
157
	STRING(REGEX REPLACE ".*-darwin([0-9]+).*" "\\1" _apple_ver "${MACHINE}")
21452 craig 158
	IF (_apple_ver EQUAL "16")
159
	    MESSAGE(STATUS "Found macOS Sierra Target: Apple, 64 bit, X86")
160
		SET(APPLE_10_12_X 1 CACHE TYPE BOOL)
161
	ENDIF (_apple_ver EQUAL "16")
20460 craig 162
	IF (_apple_ver EQUAL "15")
163
		MESSAGE(STATUS "Found OSX El Capitan Target: Apple, 64 bit, X86")
164
		SET(APPLE_10_11_X 1 CACHE TYPE BOOL)
165
	ENDIF (_apple_ver EQUAL "15")
19233 craig 166
	IF (_apple_ver EQUAL "14")
167
		MESSAGE(STATUS "Found OSX Yosemite Target: Apple, 64 bit, X86")
168
		SET(APPLE_10_10_X 1 CACHE TYPE BOOL)
169
	ENDIF (_apple_ver EQUAL "14")
170
	IF (_apple_ver EQUAL "13")
171
		MESSAGE(STATUS "Found OSX Mavericks Target: Apple, 64 bit, X86")
172
		SET(APPLE_10_9_X 1 CACHE TYPE BOOL)
173
	ENDIF (_apple_ver EQUAL "13")
174
	IF (_apple_ver EQUAL "12")
175
		MESSAGE(STATUS "Found OSX Mountain Lion Target: Apple, 64 bit, X86")
176
		SET(APPLE_10_8_X 1 CACHE TYPE BOOL)
177
	ENDIF (_apple_ver EQUAL "12")
178
	IF (_apple_ver EQUAL "11")
179
		MESSAGE(STATUS "Found OSX Lion Target: Apple, 64 bit, X86")
180
		SET(APPLE_10_7_X 1 CACHE TYPE BOOL)
181
	ENDIF (_apple_ver EQUAL "11")
182
	IF (_apple_ver EQUAL "10")
183
		MESSAGE(STATUS "Found OSX Snow Leopard Target: Apple, 64 bit, X86")
184
		SET(APPLE_10_6_X 1 CACHE TYPE BOOL)
185
	ENDIF (_apple_ver EQUAL "10")
186
	IF (_apple_ver EQUAL "9")
19353 craig 187
		MESSAGE(STATUS "Found OSX Leopard Target: Apple, 32 bit, X86")
19242 craig 188
		SET(APPLE_10_5_X 1 CACHE TYPE BOOL)
19233 craig 189
	ENDIF (_apple_ver EQUAL "9")
190
	UNSET(ARCH_X86)
191
ENDIF (APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND (ARCH_X86 EQUAL 1 OR ARCH_X86_64 EQUAL 1))
192
 
193
 
11407 cbradney 194
#convert any 64 bit build into generic 64 tag for below
19222 fschmid 195
IF (ARCH_X86_64 OR ARCH_SPARC_64 OR ARCH_MIPS_64 OR ARCH_PPC_64)
20014 craig 196
	SET(ARCH64BIT 1)
19222 fschmid 197
ENDIF (ARCH_X86_64 OR ARCH_SPARC_64 OR ARCH_MIPS_64 OR ARCH_PPC_64)
11407 cbradney 198
 
199
MESSAGE(STATUS "Building for target ${MACHINE}")
200
 
10238 cbradney 201
##############################################################################################################
10215 cbradney 202
########## Versioning Setup                                                                         ##########
203
 
9409 cbradney 204
#On Apple, we ignore the versioning tag so all items are "scribus" not "scribus-version"
9508 cbradney 205
IF (NOT BUILD_OSX_BUNDLE)
20014 craig 206
	SET(BUILD_OSX_BUNDLE ${APPLE} CACHE TYPE BOOL)
9508 cbradney 207
ENDIF (NOT BUILD_OSX_BUNDLE)
208
 
9680 cbradney 209
#Simplify future conditionals for Apple
210
IF (APPLE AND BUILD_OSX_BUNDLE)
20014 craig 211
	SET(APPLEBUNDLE TRUE CACHE TYPE BOOL)
9680 cbradney 212
ENDIF (APPLE AND BUILD_OSX_BUNDLE)
213
 
214
#Announce we cached a version request before, overridden below for OSX
9508 cbradney 215
IF(TAG_VERSION)
20014 craig 216
	IF (NOT APPLEBUNDLE)
217
		MESSAGE(STATUS "Previously selected version tag: ${TAG_VERSION}")
218
	ENDIF (NOT APPLEBUNDLE)
219
	SET(WANT_VERSIONING 1)
220
	SET(CACHED_VERSIONING 1)
9508 cbradney 221
ENDIF(TAG_VERSION)
222
 
9680 cbradney 223
#Remove version tags on OSX so our bundle is Scribus.app
18766 craig 224
IF (APPLEBUNDLE OR WIN32)
225
	IF (WANT_VERSIONING OR CACHED_VERSIONING)
226
		MESSAGE(STATUS "Ignoring version tag on Win32 or OSX when building bundle")
227
		SET(WANT_VERSIONING 0)
228
		SET(CACHED_VERSIONING 0)
229
	ENDIF (WANT_VERSIONING OR CACHED_VERSIONING)
18770 jghali 230
ENDIF (APPLEBUNDLE OR WIN32)
9508 cbradney 231
 
20014 craig 232
#Store our version string if required
6891 cbradney 233
IF (WANT_VERSIONING AND NOT CACHED_VERSIONING)
20014 craig 234
	IF (NOT CUSTOM_VERSIONTAG)
235
		SET(TAG_VERSION "-${VERSION}" CACHE TYPE STRING)
236
	ELSE (NOT CUSTOM_VERSIONTAG)
237
		SET(TAG_VERSION ${CUSTOM_VERSIONTAG} CACHE TYPE STRING)
238
	ENDIF (NOT CUSTOM_VERSIONTAG)
6891 cbradney 239
ENDIF (WANT_VERSIONING AND NOT CACHED_VERSIONING)
5379 cbradney 240
 
10215 cbradney 241
##############################################################################################################
242
########## Install/Directory Setup                                                                  ##########
243
 
12457 avox 244
IF (APPLEBUNDLE)
19631 craig 245
SET (APPLE_APP_DIR "${CMAKE_INSTALL_PREFIX}")
20014 craig 246
	IF ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/Contents/?$")
247
		# all ok
248
	ELSE ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/Contents/?$")
249
		IF ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/?$")
250
			# add "/Contents" subpath
251
			SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/Contents")
252
		ELSE ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/?$")
253
			# no bundle name spcified, use appname and version
254
			SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/Scribus${VERSION}.app/Contents")
255
		ENDIF ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/?$")
256
	ENDIF ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/Contents/?$")
257
	MESSAGE(STATUS "APPLEBUNDLE install prefix: ${APPLE_APP_DIR}")
12457 avox 258
ENDIF (APPLEBUNDLE)
259
 
260
 
19353 craig 261
#Setup all the directories we will use
13271 fschmid 262
CMAKE_POLICY(SET CMP0005 OLD)
20023 craig 263
#SHARE
16347 malex 264
IF(WANT_VERSIONING)
20023 craig 265
	SET(SHAREDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}${TAG_VERSION}/")
16345 malex 266
ELSE(WANT_VERSIONING)
20023 craig 267
	SET(SHAREDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}/")
16345 malex 268
ENDIF(WANT_VERSIONING)
20023 craig 269
IF(NOT IS_ABSOLUTE ${SHAREDIR})
270
	ADD_DEFINITIONS("-DSHAREDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SHAREDIR}\\\"")
271
ELSE()
272
	ADD_DEFINITIONS("-DSHAREDIR=\\\"${SHAREDIR}\\\"")
273
ENDIF()
9680 cbradney 274
 
9409 cbradney 275
#SHARE - use the default on Apple as TAG_VERSION is empty
14949 jghali 276
IF(WIN32 OR OS2)
20023 craig 277
	SET(DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/")
14949 jghali 278
ELSE (WIN32 OR OS2)
20014 craig 279
	IF(TAG_VERSION OR BUILD_OSX_BUNDLE)
20023 craig 280
		SET(DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${MAIN_DIR_NAME}${TAG_VERSION}/")
20014 craig 281
	ELSE(TAG_VERSION OR BUILD_OSX_BUNDLE)
282
		IF(NOT WANT_VERSIONING)
20023 craig 283
			SET(DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${MAIN_DIR_NAME}/")
20014 craig 284
		ELSE(NOT WANT_VERSIONING)
20023 craig 285
			SET(DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${MAIN_DIR_NAME}-${VERSION}/")
20014 craig 286
		ENDIF(NOT WANT_VERSIONING)
287
	ENDIF (TAG_VERSION OR BUILD_OSX_BUNDLE)
14949 jghali 288
ENDIF (WIN32 OR OS2)
20023 craig 289
IF(NOT IS_ABSOLUTE ${DOCDIR})
290
	ADD_DEFINITIONS("-DDOCDIR=\\\"${CMAKE_INSTALL_PREFIX}/${DOCDIR}\\\"")
291
ELSE()
292
	ADD_DEFINITIONS("-DDOCDIR=\\\"${DOCDIR}\\\"")
293
ENDIF()
9680 cbradney 294
 
18763 craig 295
#ICONS
10779 craig 296
IF(WIN32)
20023 craig 297
	SET(ICONDIR "${CMAKE_INSTALL_DATAROOTDIR}/icons/")
10779 craig 298
ELSE(WIN32)
20023 craig 299
	SET(ICONDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}${TAG_VERSION}/icons/")
10779 craig 300
ENDIF(WIN32)
20023 craig 301
IF(NOT IS_ABSOLUTE ${ICONDIR})
302
	ADD_DEFINITIONS("-DICONDIR=\\\"${CMAKE_INSTALL_PREFIX}/${ICONDIR}\\\"")
303
ELSE()
304
	ADD_DEFINITIONS("-DICONDIR=\\\"${ICONDIR}\\\"")
305
ENDIF()
9680 cbradney 306
 
7269 cbradney 307
#SAMPLES
20023 craig 308
SET(SAMPLESDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}${TAG_VERSION}/samples/")
309
IF(NOT IS_ABSOLUTE ${SAMPLESDIR})
310
	ADD_DEFINITIONS("-DSAMPLESDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SAMPLESDIR}\\\"")
311
ELSE()
312
	ADD_DEFINITIONS("-DSAMPLESDIR=\\\"${SAMPLESDIR}\\\"")
313
ENDIF()
9680 cbradney 314
 
7269 cbradney 315
#SCRIPTS
20023 craig 316
SET(SCRIPTSDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}${TAG_VERSION}/scripts/")
317
IF(NOT IS_ABSOLUTE ${SCRIPTSDIR})
318
	ADD_DEFINITIONS("-DSCRIPTSDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SCRIPTSDIR}\\\"")
319
ELSE()
320
	ADD_DEFINITIONS("-DSCRIPTSDIR=\\\"${SCRIPTSDIR}\\\"")
321
ENDIF()
9680 cbradney 322
 
7269 cbradney 323
#TEMPLATES
10779 craig 324
IF(WIN32)
20023 craig 325
	SET(TEMPLATEDIR "${CMAKE_INSTALL_DATAROOTDIR}/templates/")
10779 craig 326
ELSE(WIN32)
20023 craig 327
	SET(TEMPLATEDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}${TAG_VERSION}/templates/")
10779 craig 328
ENDIF(WIN32)
20023 craig 329
IF(NOT IS_ABSOLUTE ${TEMPLATEDIR})
330
	ADD_DEFINITIONS("-DTEMPLATEDIR=\\\"${CMAKE_INSTALL_PREFIX}/${TEMPLATEDIR}\\\"")
331
ELSE()
332
	ADD_DEFINITIONS("-DTEMPLATEDIR=\\\"${TEMPLATEDIR}\\\"")
333
ENDIF()
9680 cbradney 334
 
18763 craig 335
#QML
18764 jghali 336
IF(WIN32)
20023 craig 337
	SET(QMLDIR "${CMAKE_INSTALL_DATAROOTDIR}/qml/")
18764 jghali 338
ELSE(WIN32)
20023 craig 339
	SET(QMLDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}${TAG_VERSION}/qml/")
18764 jghali 340
ENDIF(WIN32)
18763 craig 341
ADD_DEFINITIONS("-DQMLDIR=\\\"${CMAKE_INSTALL_PREFIX}/${QMLDIR}\\\"")
342
 
9660 cbradney 343
#DESKTOP
20023 craig 344
SET(DESKTOPDIR "${CMAKE_INSTALL_DATAROOTDIR}/applications/")
345
IF(NOT IS_ABSOLUTE ${DESKTOPDIR})
346
	ADD_DEFINITIONS("-DDESKTOPDIR=\\\"${CMAKE_INSTALL_PREFIX}/${DESKTOPDIR}\\\"")
347
ELSE()
348
	ADD_DEFINITIONS("-DDESKTOPDIR=\\\"${DESKTOPDIR}\\\"")
349
ENDIF()
9680 cbradney 350
 
21230 mrdocs 351
#APPDATA
21419 craig 352
SET(APPDATADIR "${CMAKE_INSTALL_DATAROOTDIR}/metainfo/")
21230 mrdocs 353
IF(NOT IS_ABSOLUTE ${APPDATADIRR})
354
    ADD_DEFINITIONS("-DAPPDATADIR=\\\"${CMAKE_INSTALL_PREFIX}/${APPDATADIR}\\\"")
355
ELSE()
356
    ADD_DEFINITIONS("-DAPPDATADIR=\\\"${APPDATADIR}\\\"")
357
ENDIF()
358
 
359
 
13066 subik 360
# APPLICATION_DATA_DIR
361
# It allows specify the user configuration directory in the compile time.
362
# Example: I want to use special ~/.scribus135svn config directory for my trunk
363
#          cmake -DAPPLICATION_DATA_DIR=.scribus135svn ...
364
IF (APPLICATION_DATA_DIR)
13171 cbradney 365
	MESSAGE(STATUS "Using ApplicationDataDir ${APPLICATION_DATA_DIR} instead of the platform default.")
20014 craig 366
	ADD_DEFINITIONS("-DAPPLICATION_DATA_DIR=\\\"${APPLICATION_DATA_DIR}\\\"")
13066 subik 367
ELSE (APPLICATION_DATA_DIR)
20014 craig 368
	MESSAGE(STATUS "Using standard ApplicationDataDir. You can change it with -DAPPLICATION_DATA_DIR")
13066 subik 369
ENDIF (APPLICATION_DATA_DIR)
370
 
10161 cbradney 371
#LIB LOCATION - lib or lib64 normally
7269 cbradney 372
#LIB
10161 cbradney 373
IF(WANT_LIB64)
19631 craig 374
	IF(NOT ARCH_X86_64)
375
		MESSAGE(STATUS "WARNING: BUILDING 64 Bit build on non 64 bit architecture")
376
	ENDIF(NOT ARCH_X86_64)
377
	 SET(LIB_SUFFIX "64" CACHE TYPE STRING)
10161 cbradney 378
ENDIF(WANT_LIB64)
10239 cbradney 379
SET(LIB_DIR_NAME "lib${LIB_SUFFIX}")
19631 craig 380
IF (APPLEBUNDLE)
19676 craig 381
	SET(LIBDIR "lib/")
19631 craig 382
ELSE (APPLEBUNDLE)
383
	SET(LIBDIR "${LIB_DIR_NAME}/${MAIN_DIR_NAME}${TAG_VERSION}/")
384
ENDIF (APPLEBUNDLE)
5142 cbradney 385
ADD_DEFINITIONS("-DLIBDIR=\\\"${CMAKE_INSTALL_PREFIX}/${LIBDIR}\\\"")
9680 cbradney 386
 
7269 cbradney 387
#PLUGINS
10779 craig 388
IF(WIN32)
19631 craig 389
	SET(PLUGINDIR "plugins")
10781 craig 390
ELSE(WIN32)
19631 craig 391
	IF (APPLEBUNDLE)
392
		SET(PLUGINDIR "${LIBDIR}")
393
	ELSE (APPLEBUNDLE)
394
		SET(PLUGINDIR "${LIB_DIR_NAME}/${MAIN_DIR_NAME}${TAG_VERSION}/plugins/")
395
	ENDIF (APPLEBUNDLE)
10779 craig 396
ENDIF(WIN32)
5142 cbradney 397
ADD_DEFINITIONS("-DPLUGINDIR=\\\"${CMAKE_INSTALL_PREFIX}/${PLUGINDIR}\\\"")
9680 cbradney 398
 
18763 craig 399
 
9660 cbradney 400
#INCLUDE
401
SET(INCLUDEDIR "include/${MAIN_DIR_NAME}${TAG_VERSION}/")
402
#NO ADD DEFINITIONS, WE ONLY INSTALL WITH IT
9680 cbradney 403
 
7269 cbradney 404
#RPATH
10459 cbradney 405
IF (WANT_NORPATH OR WANT_DISTROBUILD)
20014 craig 406
	set(CMAKE_INSTALL_RPATH "")
10459 cbradney 407
ELSE (WANT_NORPATH OR WANT_DISTROBUILD)
20014 craig 408
	set(CMAKE_INSTALL_RPATH ${PLUGINDIR})
10459 cbradney 409
ENDIF (WANT_NORPATH OR WANT_DISTROBUILD)
5142 cbradney 410
 
6319 mrdocs 411
# Set the XDG mime stuff
20023 craig 412
SET(MIMEDIR "${CMAKE_INSTALL_DATAROOTDIR}/mime/packages/")
6319 mrdocs 413
 
10215 cbradney 414
##############################################################################################################
415
########## Build Setup                                                                              ##########
6319 mrdocs 416
 
9680 cbradney 417
#Convert our simpler command line option to the CMake style
5142 cbradney 418
#None, Debug, Release, .. or custom ones
7943 cbradney 419
# SET(WANT_DEBUG 1)
5142 cbradney 420
IF(WANT_DEBUG)
20014 craig 421
	SET(CMAKE_BUILD_TYPE Debug)
13238 cbradney 422
ENDIF(WANT_DEBUG)
423
IF (WANT_RELEASEWITHDEBUG)
20014 craig 424
	SET(CMAKE_BUILD_TYPE RelWithDebInfo)
13238 cbradney 425
ENDIF (WANT_RELEASEWITHDEBUG)
426
IF(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
20014 craig 427
	SET(CMAKE_BUILD_TYPE RELEASE)
13238 cbradney 428
ENDIF(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
5142 cbradney 429
 
13238 cbradney 430
 
431
 
9680 cbradney 432
#Based on our build type, setup our build options
5468 avox 433
IF(APPLE)
21452 craig 434
    IF(APPLE_10_12_X)
435
	    SET(OSXMINVER "10.12" CACHE TYPE STRING)
436
		IF (WANT_OSX_SDK)
437
		    IF(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk"))
438
			    SET(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk")
439
			ELSEIF(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk"))
440
			    SET(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk")
441
			ENDIF()
442
		ENDIF (WANT_OSX_SDK)
443
	ENDIF(APPLE_10_12_X)
20460 craig 444
	IF(APPLE_10_11_X)
445
		SET(OSXMINVER "10.11" CACHE TYPE STRING)
446
		IF (WANT_OSX_SDK)
447
			SET(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk")
448
		ENDIF (WANT_OSX_SDK)
449
	ENDIF(APPLE_10_11_X)
19229 craig 450
	IF(APPLE_10_10_X)
451
		SET(OSXMINVER "10.10" CACHE TYPE STRING)
20681 craig 452
		SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.10")
19260 craig 453
		IF (WANT_OSX_SDK)
20681 craig 454
			IF(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk"))
455
				SET(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk")
456
			ELSEIF(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk"))
457
				SET(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk")
458
			ENDIF()
19260 craig 459
		ENDIF (WANT_OSX_SDK)
19229 craig 460
	ENDIF(APPLE_10_10_X)
461
	IF(APPLE_10_9_X)
462
		SET(OSXMINVER "10.9" CACHE TYPE STRING)
19260 craig 463
		IF (WANT_OSX_SDK)
464
			SET(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk")
465
		ENDIF (WANT_OSX_SDK)
19229 craig 466
	ENDIF(APPLE_10_9_X)
467
	IF(APPLE_10_8_X)
468
		SET(OSXMINVER "10.8" CACHE TYPE STRING)
19260 craig 469
		IF (WANT_OSX_SDK)
470
			SET(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk")
471
		ENDIF (WANT_OSX_SDK)
19229 craig 472
	ENDIF(APPLE_10_8_X)
473
	IF(APPLE_10_7_X)
474
		SET(OSXMINVER "10.7" CACHE TYPE STRING)
19260 craig 475
		IF (WANT_OSX_SDK)
476
			SET(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk")
477
		ENDIF (WANT_OSX_SDK)
19229 craig 478
	ENDIF(APPLE_10_7_X)
479
	IF(APPLE_10_6_X)
480
		SET(OSXMINVER "10.6" CACHE TYPE STRING)
19260 craig 481
		IF (WANT_OSX_SDK)
482
			SET(CMAKE_OSX_SYSROOT "/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk")
483
		ENDIF (WANT_OSX_SDK)
19229 craig 484
	ENDIF(APPLE_10_6_X)
485
	IF(APPLE_10_5_X)
486
		SET(OSXMINVER "10.5" CACHE TYPE STRING)
19260 craig 487
		IF (WANT_OSX_SDK)
488
			SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk")
489
		ENDIF (WANT_OSX_SDK)
19229 craig 490
	ENDIF(APPLE_10_5_X)
491
	IF(APPLE_10_4_X)
492
		SET(OSXMINVER "10.4" CACHE TYPE STRING)
19260 craig 493
		IF (WANT_OSX_SDK)
494
			SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk")
495
		ENDIF (WANT_OSX_SDK)
19229 craig 496
	ENDIF(APPLE_10_4_X)
19233 craig 497
	# gcc/mac
498
	IF(WANT_UNIVERSAL_BUNDLE)
499
		MESSAGE("Setting Universal (PPC/i386) Architecture for OSX Build/Bundle")
500
		SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" )
501
		SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "ppc;i386" )
19260 craig 502
		IF (WANT_OSX_SDK)
503
			SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.4")
504
		ENDIF (WANT_OSX_SDK)
19233 craig 505
	ELSE(WANT_UNIVERSAL_BUNDLE)
506
		IF(ARCH_PPC OR ARCH_PPC_64)
507
			MESSAGE("Setting PPC Architecture for OSX Build/Bundle")
508
			SET(CMAKE_OSX_ARCHITECTURES "ppc" )
509
			SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "ppc" )
510
		ELSE(ARCH_PPC OR ARCH_PPC_64)
19260 craig 511
			IF (WANT_OSX_SDK)
512
				SET(CMAKE_OSX_DEPLOYMENT_TARGET "${OSXMINVER}")
513
			ENDIF (WANT_OSX_SDK)
21454 craig 514
			IF(APPLE_10_6_X OR APPLE_10_7_X OR APPLE_10_8_X OR APPLE_10_9_X OR APPLE_10_10_X OR APPLE_10_11_X OR APPLE_10_12_X)
19233 craig 515
				MESSAGE("Setting x86_64 Architecture for OSX Build/Bundle")
516
				SET(CMAKE_OSX_ARCHITECTURES "x86_64" )
517
				SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "x86_64" )
21454 craig 518
			ELSE(APPLE_10_6_X OR APPLE_10_7_X OR APPLE_10_8_X OR APPLE_10_9_X OR APPLE_10_10_X OR APPLE_10_11_X OR APPLE_10_12_X)
19233 craig 519
				MESSAGE("Setting i386 Architecture for OSX Build/Bundle")
520
				SET(CMAKE_OSX_ARCHITECTURES "i386" )
521
				SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "i386" )
21454 craig 522
			ENDIF(APPLE_10_6_X OR APPLE_10_7_X OR APPLE_10_8_X OR APPLE_10_9_X OR APPLE_10_10_X OR APPLE_10_11_X OR APPLE_10_12_X)
19233 craig 523
		ENDIF(ARCH_PPC OR ARCH_PPC_64)
524
	ENDIF(WANT_UNIVERSAL_BUNDLE)
525
	MESSAGE(STATUS "${CMAKE_OSX_ARCHITECTURES} ${CMAKE_OSX_SYSROOT}")
526
	SET(ENV{MACOSX_DEPLOYMENT_TARGET} ${OSXMINVER} )
527
	SET(ENV{LD_PREBIND} 1 )
528
	SET(ENV{LD_PREBIND_ALLOW_OVERLAP} 1 )
529
	IF (WANT_DEBUG)
21377 craig 530
	    SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
20103 avox 531
		SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
19233 craig 532
	ENDIF (WANT_DEBUG)
533
	IF (WANT_RELEASEWITHDEBUG)
21377 craig 534
	    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
20103 avox 535
		SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
19233 craig 536
	ENDIF (WANT_RELEASEWITHDEBUG)
537
	IF (NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
21377 craig 538
	    SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
19233 craig 539
		SET(CMAKE_C_FLAGS_RELEASE "-O2 -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
540
	ENDIF (NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
5468 avox 541
ELSE(APPLE)
19233 craig 542
	IF(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
543
		# Windows build with Visual Studio
544
		# Surely there's a better way to identify the compiler?
545
		SET(CMAKE_CXX_FLAGS_DEBUG)
546
		SET(CMAKE_C_FLAGS_DEBUG)
547
	ELSE(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
548
		# vanilla gcc
20103 avox 549
		SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall -fstrict-aliasing")
550
		SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -fstrict-aliasing")
19233 craig 551
		IF (_machine_x86 OR _machine_x86_64)
552
			SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC")
553
			SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fPIC")
554
		ENDIF (_machine_x86 OR _machine_x86_64)
555
	ENDIF(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
5468 avox 556
ENDIF(APPLE)
9680 cbradney 557
 
10750 craig 558
IF(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
19233 craig 559
	SET(CMAKE_CXX_FLAGS_RELEASE)
560
	SET(CMAKE_C_FLAGS_RELEASE)
10750 craig 561
ELSE(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
21377 craig 562
    SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall -fPIC")
19233 craig 563
	SET(CMAKE_C_FLAGS_RELEASE "-O2 -Wall -fPIC")
20103 avox 564
#	ADD_DEFINITIONS(-DNDEBUG)
10750 craig 565
ENDIF(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
5142 cbradney 566
 
10750 craig 567
IF(WIN32)
20014 craig 568
	ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN
569
					-DAVOID_WIN32_FILEIO
570
					-D_CRT_SECURE_NO_DEPRECATE
571
					-D_USE_MATH_DEFINES
572
					-DCOMPILE_PLUGIN_AS_DLL
573
					)
574
	SET(BUILD_WINDOWS_VERSION 1)
575
	SET(DLL_USE_NATIVE_API 1)
10750 craig 576
ENDIF(WIN32)
577
 
10215 cbradney 578
##############################################################################################################
579
########## Find Dependencies                                                                        ##########
5466 cbradney 580
 
9680 cbradney 581
#<< Qt
21180 jghali 582
SET (QT_MIN_VERSION "5.3.0")
20014 craig 583
SET(CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake")
584
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
585
FIND_PACKAGE(Qt5Core REQUIRED)
586
IF(Qt5Core_FOUND)
21377 craig 587
    MESSAGE(STATUS "----- USE QT 5-----")
20014 craig 588
ELSE(Qt5Core_FOUND)
21377 craig 589
    MESSAGE(FATAL_ERROR "ERROR: No QT 5 found")
20014 craig 590
ENDIF(Qt5Core_FOUND)
591
FIND_PACKAGE(Qt5Widgets REQUIRED)
592
IF(Qt5Widgets_FOUND)
21377 craig 593
    MESSAGE(STATUS "----- USE QT Widgets-----")
20014 craig 594
ELSE(Qt5Widgets_FOUND)
21377 craig 595
    MESSAGE(FATAL_ERROR "ERROR: No QT Widgets found")
20014 craig 596
ENDIF(Qt5Widgets_FOUND)
597
FIND_PACKAGE(Qt5Gui REQUIRED)
598
IF(Qt5Gui_FOUND)
21377 craig 599
    MESSAGE(STATUS "----- USE Qt5Gui -----")
20014 craig 600
ELSE(Qt5Gui_FOUND)
21377 craig 601
    MESSAGE(FATAL_ERROR "ERROR: Qt5Gui found")
20014 craig 602
ENDIF(Qt5Gui_FOUND)
603
FIND_PACKAGE(Qt5Xml REQUIRED)
604
IF(Qt5Xml_FOUND)
21377 craig 605
    MESSAGE(STATUS "----- USE QT 5 XML -----")
20014 craig 606
ELSE(Qt5Xml_FOUND)
21377 craig 607
    MESSAGE(FATAL_ERROR "ERROR: No QT 5 XML found")
20014 craig 608
ENDIF(Qt5Xml_FOUND)
609
FIND_PACKAGE(Qt5Network REQUIRED)
610
IF(Qt5Network_FOUND)
21377 craig 611
    MESSAGE(STATUS "----- USE Qt5Network -----")
20014 craig 612
ELSE(Qt5Network_FOUND)
21377 craig 613
    MESSAGE(FATAL_ERROR "ERROR: No Qt5Network found")
20014 craig 614
ENDIF(Qt5Network_FOUND)
615
FIND_PACKAGE(Qt5OpenGL REQUIRED)
616
IF(Qt5OpenGL_FOUND)
21377 craig 617
    MESSAGE(STATUS "----- USE Qt5OpenGL -----")
20014 craig 618
ELSE(Qt5OpenGL_FOUND)
21377 craig 619
    MESSAGE(FATAL_ERROR "ERROR: No Qt5OpenGL found")
20014 craig 620
ENDIF(Qt5OpenGL_FOUND)
621
FIND_PACKAGE(Qt5LinguistTools REQUIRED)
622
IF(Qt5LinguistTools_FOUND)
21377 craig 623
    MESSAGE(STATUS "----- USE Qt5LinguistTools -----")
20014 craig 624
ELSE(Qt5LinguistTools_FOUND)
21377 craig 625
    MESSAGE(FATAL_ERROR "ERROR: No Qt5LinguistTools found")
20014 craig 626
ENDIF(Qt5LinguistTools_FOUND)
627
FIND_PACKAGE(Qt5Quick REQUIRED)
628
IF(Qt5Quick_FOUND)
21377 craig 629
    MESSAGE(STATUS "----- USE Qt5Quick -----")
20014 craig 630
ELSE(Qt5Quick_FOUND)
21377 craig 631
    MESSAGE(FATAL_ERROR "ERROR: No Qt5Quick found")
20014 craig 632
ENDIF(Qt5Quick_FOUND)
633
FIND_PACKAGE(Qt5PrintSupport REQUIRED)
634
IF(Qt5PrintSupport_FOUND)
21377 craig 635
    MESSAGE(STATUS "----- USE Qt5PrintSupport -----")
20014 craig 636
ELSE(Qt5PrintSupport_FOUND)
21377 craig 637
    MESSAGE(FATAL_ERROR "ERROR: No Qt5PrintSupport found")
20014 craig 638
ENDIF(Qt5PrintSupport_FOUND)
639
INCLUDE_DIRECTORIES(${Qt5Core_INCLUDE_DIRS})
640
ADD_DEFINITIONS(${Qt5Core_DEFINITIONS})
641
INCLUDE_DIRECTORIES(${Qt5Widgets_INCLUDE_DIRS})
642
ADD_DEFINITIONS(${Qt5Widgets_DEFINITIONS})
643
INCLUDE_DIRECTORIES(${Qt5Gui_INCLUDE_DIRS})
644
ADD_DEFINITIONS(${Qt5Gui_DEFINITIONS})
645
INCLUDE_DIRECTORIES(${Qt5Xml_INCLUDE_DIRS})
646
ADD_DEFINITIONS(${Qt5Xml_DEFINITIONS})
647
INCLUDE_DIRECTORIES(${Qt5Network_INCLUDE_DIRS})
648
ADD_DEFINITIONS(${Qt5Network_DEFINITIONS})
649
INCLUDE_DIRECTORIES(${Qt5OpenGL_INCLUDE_DIRS})
650
ADD_DEFINITIONS(${Qt5OpenGL_DEFINITIONS})
651
INCLUDE_DIRECTORIES(${Qt5Quick_INCLUDE_DIRS})
652
ADD_DEFINITIONS(${Qt5Quick_DEFINITIONS})
653
INCLUDE_DIRECTORIES(${Qt5PrintSupport_INCLUDE_DIRS})
654
ADD_DEFINITIONS(${Qt5PrintSupport_DEFINITIONS})
21377 craig 655
 
656
MESSAGE(STATUS "Qt VERSION: ${Qt5Widgets_VERSION}")
21379 craig 657
IF (NOT WANT_CPP11 AND Qt5Widgets_VERSION_MAJOR EQUAL 5 AND Qt5Widgets_VERSION_MINOR GREATER 6)
21474 jghali 658
	MESSAGE(STATUS "Your Qt version is 5.7.0 or superior, enabling C++11 compiler features")
21469 craig 659
	SET(WANT_CPP11 1)
21379 craig 660
ENDIF (NOT WANT_CPP11 AND Qt5Widgets_VERSION_MAJOR EQUAL 5 AND Qt5Widgets_VERSION_MINOR GREATER 6)
9680 cbradney 661
#>> Qt
662
 
21469 craig 663
 
664
#C++11 Support
665
IF(WANT_CPP11)
21474 jghali 666
	MESSAGE(STATUS "Enabling C++11 compiler features")
21469 craig 667
	set(CMAKE_CXX_STANDARD 11)
668
ENDIF(WANT_CPP11)
669
 
10818 craig 670
#<< ZLIB, PNG
671
IF (WIN32)
20014 craig 672
	# On win32 we can use Qt's zlib and libpng, so we use some
673
	# custom cmake includes. This permits us to honour the
674
	# USE_QT_ZLIB_PNGLIB flag if passed.
675
	SET(PNG_DIR ${CMAKE_MODULE_PATH})
676
	SET(ZLIB_DIR ${CMAKE_MODULE_PATH})
10818 craig 677
ENDIF (WIN32)
678
FIND_PACKAGE(ZLIB REQUIRED)
679
IF (ZLIB_FOUND)
20014 craig 680
	MESSAGE("ZLIB Library Found OK")
681
	SET(HAVE_LIBZ 1)
10818 craig 682
ENDIF(ZLIB_FOUND)
19112 craig 683
#FIND_PACKAGE(PNG REQUIRED)
684
#IF (PNG_FOUND)
20014 craig 685
#	MESSAGE("PNG Library Found OK")
19112 craig 686
#ENDIF(PNG_FOUND)
10818 craig 687
#>> ZLIB, PNG
688
 
13839 fschmid 689
IF (WANT_NOOSG)
20014 craig 690
	MESSAGE("Building without 3D Extension")
13839 fschmid 691
ELSE (WANT_NOOSG)
20014 craig 692
	FIND_PACKAGE(OSG)
693
	IF(OSG_FOUND)
694
		MESSAGE("OSG found OK")
695
		SET(HAVE_OSG 1)
696
		FIND_PACKAGE(OpenGL)
697
	ELSE(OSG_FOUND)
698
		MESSAGE("No OSG found, building without 3D Extension")
699
	ENDIF(OSG_FOUND)
13839 fschmid 700
ENDIF (WANT_NOOSG)
701
 
17954 jghali 702
#<< JPEG, TIFF
5142 cbradney 703
FIND_PACKAGE(JPEG REQUIRED)
704
IF (JPEG_FOUND)
20014 craig 705
	MESSAGE("JPEG Library Found OK")
5142 cbradney 706
ENDIF(JPEG_FOUND)
707
FIND_PACKAGE(TIFF REQUIRED)
708
IF (TIFF_FOUND)
20014 craig 709
	MESSAGE("TIFF Library Found OK")
710
	SET(HAVE_TIFF 1)
6211 cbradney 711
ELSE(TIFF_FOUND)
20014 craig 712
	MESSAGE(FATAL_ERROR "Could not find the TIFF Library")
5142 cbradney 713
ENDIF(TIFF_FOUND)
17954 jghali 714
#<< JPEG, TIFF
715
 
716
#<< PYTHON
18948 craig 717
#SET(PythonLibs_FIND_VERSION 2)
718
FIND_PACKAGE(PythonLibs 2 REQUIRED)
5142 cbradney 719
IF (PYTHON_LIBRARY)
20014 craig 720
	MESSAGE("Python Library Found OK")
721
	SET(HAVE_PYTHON 1)
722
	SET(COMPILE_PYTHON 1)
5142 cbradney 723
ENDIF(PYTHON_LIBRARY)
17954 jghali 724
#>> PYTHON
5142 cbradney 725
 
9680 cbradney 726
#<< FreeType2
20014 craig 727
FIND_PACKAGE(Freetype REQUIRED)
728
IF (FREETYPE_FOUND)
729
	MESSAGE(STATUS "FreeType2 Library Found OK")
730
	INCLUDE(CheckLibraryExists)
731
	CHECK_LIBRARY_EXISTS(${FREETYPE_LIBRARY} FT_Get_First_Char "" HAVE_FREETYPE_FIRST)
732
	CHECK_LIBRARY_EXISTS(${FREETYPE_LIBRARY} FT_Get_Next_Char "" HAVE_FREETYPE_NEXT)
733
	# here we have an alternative
734
	# a) Setup CFLAGS with the FREETYPE_INCLUDE_DIR_freetype2 provided by cmake
735
	# b) Insert ${FREETYPE_INCLUDE_DIRS} in include sections of CMakeLists that need it
736
	# I prefer (b) and at some point & from my opinion it should  be just needed in scribus/fonts/CmakeLists.txt - pm
737
ELSE (FREETYPE_FOUND)
738
	MESSAGE(FATAL_ERROR "No Freetype Found")
739
ENDIF(FREETYPE_FOUND)
9680 cbradney 740
#>> FreeType2
5142 cbradney 741
 
9680 cbradney 742
#<<Render Library
18496 jghali 743
IF (WANT_PRIVATE_CAIRO)
20014 craig 744
	MESSAGE("We no longer support the private cairo library as the latest public release is more up to date, setting WANT_SYSTEM_CAIRO=1")
17563 craig 745
ENDIF(WANT_PRIVATE_CAIRO)
7013 cbradney 746
 
18496 jghali 747
IF (RENDER_LIB)
20014 craig 748
	IF (RENDER_LIB STREQUAL "QTARTHUR")
749
		MESSAGE("Qt4's Arthur as renderer is not supported anymore, performing renderer detection again")
750
	ENDIF (RENDER_LIB STREQUAL "QTARTHUR")
18496 jghali 751
ENDIF(RENDER_LIB)
5142 cbradney 752
 
18496 jghali 753
SET(CAIRO_DIR ${CMAKE_MODULE_PATH})
754
FIND_PACKAGE(CAIRO REQUIRED)
755
IF(CAIRO_FOUND)
20014 craig 756
	MESSAGE("CAIRO Library Found OK")
757
	SET(RENDER_LIB "CAIRO_SYSTEM" CACHE TYPE STRING)
18496 jghali 758
ELSE(CAIRO_FOUND)
20014 craig 759
	MESSAGE(FATAL_ERROR "No Cairo Found")
18496 jghali 760
ENDIF(CAIRO_FOUND)
9680 cbradney 761
#>>Render Library
762
 
763
#<<CUPS
18186 craig 764
IF(NOT WIN32 AND NOT HAIKU)
20014 craig 765
	FIND_PACKAGE(Cups REQUIRED)
766
	IF(CUPS_FOUND)
767
		SET(HAVE_CUPS 1)
768
		MESSAGE("CUPS Library Found OK")
769
	ENDIF(CUPS_FOUND)
18186 craig 770
ELSE(NOT WIN32 AND NOT HAIKU)
20014 craig 771
	# Windows doesn't use CUPS
772
	SET(CUPS_INCLUDE_DIR)
18186 craig 773
ENDIF(NOT WIN32 AND NOT HAIKU)
9680 cbradney 774
#>>CUPS
5142 cbradney 775
 
9680 cbradney 776
#<<LibXML2
7203 cbradney 777
FIND_PACKAGE(LibXml2 REQUIRED)
5142 cbradney 778
IF(LIBXML2_FOUND)
20014 craig 779
	SET(HAVE_XML 1)
780
	MESSAGE("LIBXML2 Library Found OK")
5142 cbradney 781
ENDIF(LIBXML2_FOUND)
9680 cbradney 782
#>>LibXML2
5142 cbradney 783
 
9680 cbradney 784
#<<LittleCMS
5142 cbradney 785
SET(LCMS_DIR ${CMAKE_MODULE_PATH})
18497 jghali 786
FIND_PACKAGE(LCMS2 REQUIRED)
15143 fschmid 787
IF(LCMS2_FOUND)
20014 craig 788
	SET(HAVE_LCMS2 1)
789
	SET(HAVE_CMS 1)
790
	SET(CMS_INC "\"lcms2.h\"")
791
	MESSAGE("LittleCMS-2 Library Found OK")
15143 fschmid 792
ELSE(LCMS2_FOUND)
20014 craig 793
	MESSAGE(FATAL_ERROR "Could not find the LittleCMS 2 Library")
15143 fschmid 794
ENDIF(LCMS2_FOUND)
9680 cbradney 795
#>>LittleCMS
5142 cbradney 796
 
9680 cbradney 797
#<<FontConfig
10747 craig 798
IF(NOT WIN32)
20014 craig 799
	SET(FONTCONFIG_DIR ${CMAKE_MODULE_PATH})
800
	FIND_PACKAGE(FONTCONFIG)
801
	IF(FONTCONFIG_FOUND)
802
		MESSAGE("FontConfig Found OK")
803
		SET(HAVE_FONTCONFIG 1)
804
	ENDIF(FONTCONFIG_FOUND)
10747 craig 805
ELSE(NOT WIN32)
20014 craig 806
	# Windows builds neither use nor require fontconfig
807
	SET(FONTCONFIG_INCLUDE_DIR)
10747 craig 808
ENDIF(NOT WIN32)
9680 cbradney 809
#>>FontConfig
5142 cbradney 810
 
17501 craig 811
#<<HUNSPELL for Speelling support
18099 craig 812
OPTION(WANT_HUNSPELL "Enable support for spell checking with hunspell" ON)
17501 craig 813
IF (WANT_HUNSPELL)
20014 craig 814
	FIND_PACKAGE(HUNSPELL)
815
	IF (HUNSPELL_FOUND)
816
		MESSAGE("Hunspell Found OK")
817
		SET(HAVE_HUNSPELL 1)
818
	ELSE (HUNSPELL_FOUND)
819
		MESSAGE("Hunspell or its developer libraries NOT found - Disabling support for spell checking")
820
	ENDIF (HUNSPELL_FOUND)
17501 craig 821
ENDIF (WANT_HUNSPELL)
822
#>>HUNSPELL for Speelling support
11106 cbradney 823
 
10238 cbradney 824
#<<PoDoFo for AI PDF import
14968 cbradney 825
OPTION(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
826
IF (WITH_PODOFO)
20014 craig 827
	FIND_PACKAGE(LIBPODOFO)
828
	IF (LIBPODOFO_FOUND)
829
		MESSAGE("PoDoFo found OK")
830
		SET(HAVE_PODOFO 1)
831
	ELSE (LIBPODOFO_FOUND)
832
		MESSAGE("PoDoFo NOT found - Disabling support for PDF embedded in AI")
833
	ENDIF (LIBPODOFO_FOUND)
14968 cbradney 834
ENDIF (WITH_PODOFO)
10238 cbradney 835
#>>PoDoFo for AI PDF import
10234 fschmid 836
 
14937 fschmid 837
#<<Boost for 2Geom Tools
14968 cbradney 838
OPTION(WITH_BOOST "Enable support for Boost based enhancements" ON)
839
IF (WITH_BOOST)
20014 craig 840
	FIND_PACKAGE(Boost)
841
	IF (Boost_FOUND)
842
		MESSAGE("Boost Library Found OK")
843
		SET(HAVE_BOOST 1)
844
	ELSE(Boost_FOUND)
845
		MESSAGE("Boost: NOT FOUND, not building 2geomtools")
846
	ENDIF (Boost_FOUND)
14968 cbradney 847
ENDIF (WITH_BOOST)
14937 fschmid 848
#>>Boost for 2Geom Tools
849
 
15714 christoph 850
#<<GraphicksMagick for image import
14516 cbradney 851
IF (WANT_GRAPHICSMAGICK)
20014 craig 852
	SET(GMAGICK_DIR ${CMAKE_MODULE_PATH})
853
	pkg_check_modules(GMAGICK GraphicsMagick)
854
	# FIND_PACKAGE(GMAGICK)
855
	IF(GMAGICK_FOUND)
856
		MESSAGE("GraphicksMagick Found OK")
857
	ELSE(GMAGICK_FOUND)
858
		MESSAGE("GraphicksMagick NOT found! Building without additional image format support!")
859
	ENDIF(GMAGICK_FOUND)
14516 cbradney 860
ELSE (WANT_GRAPHICSMAGICK)
20014 craig 861
	MESSAGE("Building without GraphicksMagick (use -DWANT_GRAPHICSMAGICK=1 to enable)")
14516 cbradney 862
ENDIF (WANT_GRAPHICSMAGICK)
15714 christoph 863
#>>GraphicksMagick for image import
13957 herm 864
 
16729 fschmid 865
#<<Poppler for PDF import
866
FIND_PACKAGE(POPPLER)
867
IF (POPPLER_FOUND)
868
	IF (FREETYPE_FOUND)
869
		SET( HAVE_POPPLER 1 )
870
		MESSAGE(STATUS "Found poppler")
871
		MESSAGE(STATUS "Found poppler libs: ${POPPLER_LIBRARY}")
872
		MESSAGE(STATUS "Found poppler includes: ${POPPLER_INCLUDE_DIR}")
873
	ELSE (FREETYPE_FOUND)
874
		MESSAGE("Poppler NOT found - Disabling support for native PDF import")
875
	ENDIF (FREETYPE_FOUND)
876
ELSE (POPPLER_FOUND)
877
	MESSAGE("Poppler NOT found - Disabling support for native PDF import")
878
ENDIF (POPPLER_FOUND)
879
#>>Poppler for PDF import
880
 
19222 fschmid 881
# librevenge for MsPub import
882
pkg_check_modules(LIBREVENGE librevenge-0.0)
883
IF (LIBREVENGE_FOUND)
884
	pkg_check_modules(LIBREVENGE_STREAM librevenge-stream-0.0)
885
	IF (LIBREVENGE_STREAM_FOUND)
886
		pkg_check_modules(LIBREVENGE_GENERATORS librevenge-generators-0.0)
887
		IF (LIBREVENGE_GENERATORS_FOUND)
888
			SET(HAVE_REVENGE 1)
889
		ENDIF (LIBREVENGE_GENERATORS_FOUND)
890
	ENDIF (LIBREVENGE_STREAM_FOUND)
891
ENDIF (LIBREVENGE_FOUND)
16729 fschmid 892
 
21452 craig 893
# CTL support
894
#pkg_check_modules(HARFBUZZ REQUIRED harfbuzz>=0.9.42 harfbuzz-icu)
895
#pkg_check_modules(ICU REQUIRED icu-uc)
896
 
10215 cbradney 897
##############################################################################################################
898
########## Include Setup                                                                            ##########
8499 cbradney 899
 
10215 cbradney 900
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
19222 fschmid 901
 
5142 cbradney 902
CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
903
IF(HAVE_DLFCN_H)
20014 craig 904
	ADD_DEFINITIONS(-DHAVE_DLFCN_H)
5142 cbradney 905
ENDIF(HAVE_DLFCN_H)
906
 
907
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
908
IF(HAVE_UNISTD_H)
20014 craig 909
	ADD_DEFINITIONS(-DHAVE_UNISTD_H)
5142 cbradney 910
ENDIF(HAVE_UNISTD_H)
911
 
912
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
913
# IF(HAVE_SYS_TYPES_H)
914
#   ADD_DEFINITIONS(-DHAVE_SYS_TYPES_H)
915
# ENDIF(HAVE_SYS_TYPES_H)
916
 
917
CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
918
# IF(HAVE_SYS_STAT_H)
919
#   ADD_DEFINITIONS(-DHAVE_SYS_STAT_H)
920
# ENDIF(HAVE_SYS_STAT_H)
9680 cbradney 921
#>>Test for existing include files
5142 cbradney 922
 
923
 
5150 cbradney 924
#Create configure files.. config.h and uninstall
925
#config.h
5142 cbradney 926
INCLUDE (ConfigureChecks.cmake)
20014 craig 927
	IF(WIN32)
928
		SET(CONFIG_NAME win-config.h)
929
	ELSE(WIN32)
930
		SET(CONFIG_NAME config.h)
931
	ENDIF(WIN32)
10779 craig 932
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
5142 cbradney 933
ADD_DEFINITIONS("-DHAVE_CONFIG_H")
9680 cbradney 934
 
5142 cbradney 935
 
5150 cbradney 936
 
5157 cbradney 937
#Set up include dirs with all found packages
5142 cbradney 938
INCLUDE_DIRECTORIES(
20014 craig 939
	${CMAKE_BINARY_DIR}
940
	${CMAKE_BINARY_DIR}/scribus
941
	${QT_INCLUDES}
942
	${FREETYPE_INCLUDE_DIR}
943
	${FONTCONFIG_INCLUDE_DIR}
944
	${JPEG_INCLUDE_DIR}
945
	${LCMS2_INCLUDE_DIR}
946
	${LIBXML2_INCLUDE_DIR}
947
	${TIFF_INCLUDE_DIR}
948
	${ZLIB_INCLUDE_DIR}
949
	${OPENGL_INCLUDE_DIR}
950
	${OSG_INCLUDE_DIR}
951
	${GSL_INCLUDE_DIR}
5142 cbradney 952
)
953
 
18186 craig 954
IF (NOT WIN32 AND NOT HAIKU)
955
INCLUDE_DIRECTORIES(
20014 craig 956
	${CUPS_INCLUDE_DIR}
18186 craig 957
)
958
ENDIF (NOT WIN32 AND NOT HAIKU)
959
 
10215 cbradney 960
##############################################################################################################
961
########## Uninstall Setup                                                                          ##########
962
 
963
CONFIGURE_FILE(
20014 craig 964
	"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
965
	"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
966
	IMMEDIATE @ONLY
10215 cbradney 967
)
968
 
969
ADD_CUSTOM_TARGET(uninstall
20014 craig 970
	"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
971
)
19222 fschmid 972
 
973
 
10215 cbradney 974
##############################################################################################################
975
########## Add our subdirs                                                                          ##########
976
 
5157 cbradney 977
#Add our source subdirs
5142 cbradney 978
ADD_SUBDIRECTORY(scribus)
13527 cbradney 979
ADD_SUBDIRECTORY(doc)
14098 cbradney 980
ADD_SUBDIRECTORY(resources/dicts)
14097 cbradney 981
ADD_SUBDIRECTORY(resources/editorconfig)
20160 craig 982
ADD_SUBDIRECTORY(resources/iconsets)
14096 cbradney 983
ADD_SUBDIRECTORY(resources/keysets)
14097 cbradney 984
ADD_SUBDIRECTORY(resources/loremipsum)
14096 cbradney 985
ADD_SUBDIRECTORY(resources/profiles)
14047 cbradney 986
ADD_SUBDIRECTORY(resources/swatches)
14097 cbradney 987
ADD_SUBDIRECTORY(resources/templates)
18404 craig 988
ADD_SUBDIRECTORY(resources/translations)
5142 cbradney 989
 
5157 cbradney 990
#Install our READMEs etc.
5142 cbradney 991
INSTALL(FILES
19171 craig 992
	AUTHORS
993
	BUILDING
994
	ChangeLog
995
	COPYING
996
	LINKS
997
	NEWS
998
	PACKAGING
999
	README
1000
	TODO
1001
	TRANSLATION
1002
	DESTINATION ${DOCDIR}
5142 cbradney 1003
)
9386 cbradney 1004
 
17500 craig 1005
IF (APPLE)
20014 craig 1006
	INSTALL(FILES
1007
		README.MacOSX
1008
		DESTINATION ${DOCDIR}
1009
	)
18763 craig 1010
 
20014 craig 1011
	#	EXECUTE_PROCESS (COMMAND mkdir -p "${CMAKE_INSTALL_PREFIX}/PlugIns/imageformats")
1012
	#	IF (NOT EXISTS "${CMAKE_INSTALL_PREFIX}/PlugIns/imageformats/libqjpeg.dylib")
1013
	#MESSAGE(STATUS ${QT_PREFIX})
1014
	#MESSAGE(STATUS "@QT_PREFIX@/plugins/imageformats/libqjpeg.dylib")
1015
	#MESSAGE(STATUS "${CMAKE_INSTALL_PREFIX}/PlugIns/imageformats/libqjpeg.dylib")
1016
	#		EXECUTE_PROCESS (COMMAND ditto "@QT_PREFIX@/plugins/imageformats/libqjpeg.dylib" "${CMAKE_INSTALL_PREFIX}/PlugIns/imageformats/libqjpeg.dylib")
1017
	#	ENDIF()
18763 craig 1018
 
17500 craig 1019
ENDIF (APPLE)
1020
 
21433 mrdocs 1021
#Install the .desktop file
21481 craig 1022
CONFIGURE_FILE(
1023
	${CMAKE_CURRENT_SOURCE_DIR}/scribus.desktop.in
1024
	${CMAKE_CURRENT_SOURCE_DIR}/scribus.desktop
1025
)
21433 mrdocs 1026
INSTALL(FILES
1027
	scribus.desktop
21481 craig 1028
	RENAME scribus${TAG_VERSION}.desktop
21433 mrdocs 1029
	DESTINATION ${DESKTOPDIR}
1030
)
1031
 
9680 cbradney 1032
#Install our MIME data
6319 mrdocs 1033
INSTALL(FILES
20014 craig 1034
	scribus.xml
21481 craig 1035
	RENAME scribus${TAG_VERSION}.xml
20014 craig 1036
	DESTINATION ${MIMEDIR}
6319 mrdocs 1037
)
5396 cbradney 1038
 
21230 mrdocs 1039
 
1040
#Install the appdata file
21481 craig 1041
CONFIGURE_FILE(
1042
	${CMAKE_CURRENT_SOURCE_DIR}/scribus.appdata.xml.in
1043
	${CMAKE_CURRENT_SOURCE_DIR}/scribus.appdata.xml
1044
)
21230 mrdocs 1045
INSTALL(FILES
21481 craig 1046
	scribus.appdata.xml
1047
	RENAME scribus${TAG_VERSION}.appdata.xml
1048
	DESTINATION ${APPDATADIR}
21230 mrdocs 1049
)
1050
 
1051
 
9680 cbradney 1052
#If building an Apple bundle, install these specific files
1053
IF(APPLEBUNDLE)
20014 craig 1054
	INSTALL(FILES
1055
		Scribus.app/Contents/Info.plist
1056
		DESTINATION ${CMAKE_INSTALL_PREFIX}
1057
	)
1058
	INSTALL(FILES
1059
		Scribus.app/Contents/Resources/Scribus.icns
1060
		Scribus.app/Contents/Resources/Scribus-doc.icns
1061
		DESTINATION ${CMAKE_INSTALL_PREFIX}/Resources
1062
	)
9680 cbradney 1063
ENDIF(APPLEBUNDLE)
9386 cbradney 1064
 
10215 cbradney 1065
##############################################################################################################
1066
########## Install/CPack Setup                                                                      ##########
1067
 
9680 cbradney 1068
# If the cmake version includes cpack, use it for tarball building
5396 cbradney 1069
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
20014 craig 1070
	SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Scribus is an open source publishing application for Linux, Mac OSX and Windows")
1071
	SET(CPACK_PACKAGE_VENDOR "Scribus Team")
1072
	SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
1073
	SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README")
1074
	SET(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
1075
	SET(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
1076
	SET(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
1077
	SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Scribus ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
1078
	SET(CPACK_PACKAGE_EXECUTABLES "scribus${TAG_VERSION}")
1079
	SET(CPACK_SOURCE_PACKAGE_FILE_NAME "scribus-${VERSION}${VERSION_SUFFIX}")
1080
	SET(CPACK_SOURCE_GENERATOR TBZ2)
1081
	SET(CPACK_SYSTEM_NAME "")
1082
	SET(CPACK_TOPLEVEL_TAG "")
1083
	SET(CPACK_SOURCE_IGNORE_FILES
1084
		CMakeCache.txt
21325 craig 1085
		scribus-1.5.2.tar.bz2
1086
		scribus-1.5.2.tar.Z
1087
		scribus-1.5.2.tar.gz
21006 jghali 1088
		scribus-1.5.2.svn.tar.bz2
1089
		scribus-1.5.2.svn.tar.Z
1090
		scribus-1.5.2.svn.tar.gz
20014 craig 1091
		"~$"
1092
		"\\\\.cvsignore$"
1093
		"\\\\.o$"
1094
		"\\\\.svn-base$"
1095
		"\\\\.svn$"
1096
		"^${PROJECT_SOURCE_DIR}.*/CVS/"
1097
		"^${PROJECT_SOURCE_DIR}/debian/"
1098
		"^${PROJECT_SOURCE_DIR}/old/"
1099
		"^${PROJECT_SOURCE_DIR}.*/CVSROOT/"
1100
		"^${PROJECT_SOURCE_DIR}/admin/"
1101
	)
1102
	INCLUDE(CPack)
5463 avox 1103
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
14097 cbradney 1104
 
20014 craig 1105
#include (cmakeconfigreport optional)
21325 craig 1106
 
1107
# Output everything we've found
1108
#feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES)