Subversion Repositories Scribus

Rev

Rev 13476 | Rev 13527 | 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
5758 cbradney 5
#Require 2.4.2 for Qt finding
9680 cbradney 6
#Require 2.4.3 for moc change detection and rpath updates for custom cairo install
8499 cbradney 7
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR)
5758 cbradney 8
 
10818 craig 9
IF(WIN32)
12131 cbradney 10
  IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.6)
11
    MESSAGE(FATAL_ERROR "Windows builds require CMake 2.6")
12
  ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.6)
10818 craig 13
ENDIF(WIN32)
14
 
9680 cbradney 15
#Pretty colors
5142 cbradney 16
SET(CMAKE_COLOR_MAKEFILE ON)
9680 cbradney 17
#Dont force verbose
9715 avox 18
SET(CMAKE_VERBOSE_MAKEFILE OFF)
9680 cbradney 19
#Include current dir
5142 cbradney 20
SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)
10459 cbradney 21
#RPATH setup - more below too
10327 cbradney 22
IF (WANT_NORPATH OR WANT_DISTROBUILD)
23
  SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
24
ELSE (WANT_NORPATH OR WANT_DISTROBUILD)
25
  SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
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)
36
 
9680 cbradney 37
#Set the custom CMake module directory where our include/lib finders are
5142 cbradney 38
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
9680 cbradney 39
 
10215 cbradney 40
##############################################################################################################
41
########## toplevel compiler flags                                                                  ##########
42
 
43
# CHECK_C_COMPILER_FLAG(" ${CMAKE_SHARED_LIBRARY_C_FLAGS}" C_HAVE_PIC)
44
# CHECK_CXX_COMPILER_FLAG(" ${CMAKE_SHARED_LIBRARY_C_FLAGS}" CXX_HAVE_PIC)
45
# IF (CXX_HAVE_PIC AND C_HAVE_PIC)
46
#     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_SHARED_LIBRARY_C_FLAGS}")
47
#     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_SHARED_LIBRARY_C_FLAGS}")
48
# ELSE (CXX_HAVE_PIC AND C_HAVE_PIC)
49
#     MESSAGE(FATAL_ERROR "Shared library support is missing")
50
# ENDIF (CXX_HAVE_PIC AND C_HAVE_PIC)
51
 
5142 cbradney 52
# SET(CMAKE_SHARED_MODULE_LINK_FLAGS "${CMAKE_SHARED_MODULE_LINK_FLAGS} -export-dynamic")
53
# SET(CMAKE_SHARED_MODULE_LINK_CXX_FLAGS "${CMAKE_SHARED_MODULE_LINK_CXX_FLAGS} -export-dynamic")
54
# SET(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -export-dynamic")
55
# SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -export-dynamic")
56
# MESSAGE(STATUS ${CMAKE_SHARED_MODULE_LINK_FLAGS})
57
# MESSAGE(STATUS ${CMAKE_SHARED_MODULE_LINK_CXX_FLAGS})
58
# MESSAGE(STATUS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
59
# MESSAGE(STATUS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
60
# MESSAGE(STATUS ${CMAKE_CXX_CREATE_SHARED_MODULE})
61
# MESSAGE(STATUS ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
62
 
63
#IMPORT FROM COMMANDLINE
64
# SET with cmake -DWANT_CAIRO=1, etc
65
# MESSAGE(STATUS ${WANT_CAIRO})
66
# MESSAGE(STATUS ${WANT_LIBART})
67
# MESSAGE(STATUS ${WANT_DEBUG})
5157 cbradney 68
 
69
# SET(WANT_CAIRO 0)
70
# SET(WANT_LIBART 1)
71
 
9680 cbradney 72
#Project Setup
5142 cbradney 73
PROJECT(scribus)
9680 cbradney 74
#Set our version values
75
#Final version is ${VERSION} = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}
76
#where VERSION_SUFFIX is of the form "", "cvs" or "Ncvs" (N being the minor patch level)
5396 cbradney 77
SET (VERSION_MAJOR "1")
13511 mrdocs 78
SET (VERSION_MINOR "5")
79
SET (VERSION_PATCH "0")
80
SET (VERSION_SUFFIX "svn")
13397 mrdocs 81
SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_SUFFIX})
5407 cbradney 82
MESSAGE(STATUS "Scribus ${VERSION} will be built to install into ${CMAKE_INSTALL_PREFIX}")
5142 cbradney 83
 
9680 cbradney 84
#Set the permissions to be used when installing plugins
5142 cbradney 85
SET(PLUGIN_PERMISSIONS WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE WORLD_READ GROUP_READ OWNER_READ OWNER_WRITE)
86
 
9680 cbradney 87
#Our main directory is scribus
5379 cbradney 88
SET(MAIN_DIR_NAME "scribus")
9680 cbradney 89
 
10215 cbradney 90
##############################################################################################################
10238 cbradney 91
########## check for the CPU we build for                                                           ##########
92
 
93
EXECUTE_PROCESS(
94
    COMMAND ${CMAKE_C_COMPILER} -dumpmachine
95
    OUTPUT_VARIABLE MACHINE
96
    OUTPUT_STRIP_TRAILING_WHITESPACE
97
)
98
 
99
STRING(REGEX MATCH "(i?86-*)|(athlon-*)|(pentium-*)" _machine_x86 "${MACHINE}")
100
IF (_machine_x86)
101
    MESSAGE(STATUS "Found target X86")
102
    SET(ARCH_X86 1)
103
ENDIF (_machine_x86)
104
 
105
STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _machine_x86_64 "${MACHINE}")
106
IF (_machine_x86_64)
107
    MESSAGE(STATUS "Found target X86_64")
108
    SET(ARCH_X86_64 1)
109
ENDIF (_machine_x86_64)
110
 
11407 cbradney 111
STRING(REGEX MATCH "(sparc64-*)|(SPARC64-*)" _machine_sparc_64 "${MACHINE}")
112
IF (_machine_sparc_64)
113
    MESSAGE(STATUS "Found target SPARC 64")
114
    SET(ARCH_SPARC_64 1)
115
ENDIF (_machine_sparc_64)
116
 
117
STRING(REGEX MATCH "(mips64-*)|(MIPS64-*)" _machine_mips_64 "${MACHINE}")
118
IF (_machine_mips_64)
119
    MESSAGE(STATUS "Found target MIPS 64")
120
    SET(ARCH_MIPS_64 1)
121
ENDIF (_machine_mips_64)
122
 
12570 cbradney 123
STRING(REGEX MATCH "(ppc-*)|(powerpc-*)" _machine_ppc "${MACHINE}")
10238 cbradney 124
IF (_machine_ppc)
125
    MESSAGE(STATUS "Found target PPC")
126
    SET(ARCH_PPC 1)
127
ENDIF (_machine_ppc)
128
 
12570 cbradney 129
STRING(REGEX MATCH "(ppc64-*)|(PPC64-*)|(powerpc64-*)" _machine_ppc_64 "${MACHINE}")
11407 cbradney 130
IF (_machine_ppc_64)
131
    MESSAGE(STATUS "Found target PPC64")
132
    SET(ARCH_PPC_64 1)
133
ENDIF (_machine_ppc_64)
134
 
12074 mrdocs 135
STRING(REGEX MATCH "(sparc-*)" _machine_sparc "${MACHINE}")
136
IF (_machine_sparc)
137
    MESSAGE(STATUS "Found target Sparc")
138
    SET(ARCH_SPARC 1)
139
ENDIF (_machine_sparc)
140
 
141
STRING(REGEX MATCH "(sparcv9-*)" _machine_sparcv9 "${MACHINE}")
142
IF (_machine_sparcv9)
143
    MESSAGE(STATUS "Found target Sparc v9")
144
    SET(ARCH_SPARCV9 1)
145
ENDIF (_machine_sparcv9)
146
 
147
STRING(REGEX MATCH "(sparc64-*)" _machine_sparc64 "${MACHINE}")
148
IF (_machine_sparc64)
149
    MESSAGE(STATUS "Found target Sparc64")
150
    SET(ARCH_SPARC64 1)
151
    SET(ARCH64BIT 1)
152
ENDIF (_machine_sparc64)
153
 
11407 cbradney 154
#convert any 64 bit build into generic 64 tag for below
155
IF (ARCH_X86_64 OR ARCH_SPARC_64 OR ARCH_MIPS_64 OR ARCH_PPC_64)
156
  SET(ARCH64BIT 1)
157
ENDIF (ARCH_X86_64 OR ARCH_SPARC_64 OR ARCH_MIPS_64 OR ARCH_PPC_64)
158
 
159
MESSAGE(STATUS "Building for target ${MACHINE}")
160
 
10238 cbradney 161
##############################################################################################################
10215 cbradney 162
########## Versioning Setup                                                                         ##########
163
 
9409 cbradney 164
#On Apple, we ignore the versioning tag so all items are "scribus" not "scribus-version"
9508 cbradney 165
IF (NOT BUILD_OSX_BUNDLE)
9680 cbradney 166
  SET(BUILD_OSX_BUNDLE ${APPLE} CACHE TYPE BOOL)
9508 cbradney 167
ENDIF (NOT BUILD_OSX_BUNDLE)
168
 
9680 cbradney 169
#Simplify future conditionals for Apple
170
IF (APPLE AND BUILD_OSX_BUNDLE)
171
  SET(APPLEBUNDLE TRUE CACHE TYPE BOOL)
172
ENDIF (APPLE AND BUILD_OSX_BUNDLE)
173
 
174
#Announce we cached a version request before, overridden below for OSX
9508 cbradney 175
IF(TAG_VERSION)
9680 cbradney 176
  IF (NOT APPLEBUNDLE)
177
    MESSAGE(STATUS "Previously selected version tag: ${TAG_VERSION}")
178
  ENDIF (NOT APPLEBUNDLE)
6891 cbradney 179
  SET(WANT_VERSIONING 1)
180
  SET(CACHED_VERSIONING 1)
9508 cbradney 181
ENDIF(TAG_VERSION)
182
 
9680 cbradney 183
#Remove version tags on OSX so our bundle is Scribus.app
184
IF (APPLEBUNDLE)
185
  IF (WANT_VERSIONING OR CACHED_VERSIONING)
186
    MESSAGE(STATUS "Ignoring version tag on OSX when building bundle")
187
    SET(WANT_VERSIONING 0)
188
    SET(CACHED_VERSIONING 0)
189
  ENDIF (WANT_VERSIONING OR CACHED_VERSIONING)
190
ENDIF (APPLEBUNDLE)
9508 cbradney 191
 
9680 cbradney 192
#Store our version string if require
6891 cbradney 193
IF (WANT_VERSIONING AND NOT CACHED_VERSIONING)
5396 cbradney 194
  IF (NOT CUSTOM_VERSIONTAG)
6891 cbradney 195
    SET(TAG_VERSION "-${VERSION}" CACHE TYPE STRING)
5396 cbradney 196
  ELSE (NOT CUSTOM_VERSIONTAG)
6891 cbradney 197
    SET(TAG_VERSION ${CUSTOM_VERSIONTAG} CACHE TYPE STRING)
5396 cbradney 198
  ENDIF (NOT CUSTOM_VERSIONTAG)
6891 cbradney 199
ENDIF (WANT_VERSIONING AND NOT CACHED_VERSIONING)
5379 cbradney 200
 
10215 cbradney 201
##############################################################################################################
202
########## Install/Directory Setup                                                                  ##########
203
 
12457 avox 204
IF (APPLEBUNDLE)
205
  IF ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/Contents/?$")
206
    # all ok
207
  ELSE ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/Contents/?$")
208
    IF ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/?$")
209
      # add "/Contents" subpath
210
      SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/Contents")
211
    ELSE ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/?$")
212
      # no bundle name spcified, use appname and version
213
      SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/Scribus${VERSION}.app/Contents")
214
    ENDIF ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/?$")
215
  ENDIF ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/Contents/?$")
216
 
217
  MESSAGE(STATUS "APPLEBUNDLE install prefix: ${CMAKE_INSTALL_PREFIX}")
218
ENDIF (APPLEBUNDLE)
219
 
220
 
9680 cbradney 221
#Setp all the directories we will use
7269 cbradney 222
#MAN
13271 fschmid 223
CMAKE_POLICY(SET CMP0005 OLD)
7269 cbradney 224
SET(MANDIR "share/man/")
6893 cbradney 225
SET(SHAREDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/")
5142 cbradney 226
ADD_DEFINITIONS("-DSHAREDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SHAREDIR}\\\"")
9680 cbradney 227
 
9409 cbradney 228
#SHARE - use the default on Apple as TAG_VERSION is empty
229
IF(TAG_VERSION OR BUILD_OSX_BUNDLE)
7269 cbradney 230
  SET(DOCDIR "share/doc/${MAIN_DIR_NAME}${TAG_VERSION}/")
9409 cbradney 231
ELSE(TAG_VERSION OR BUILD_OSX_BUNDLE)
7269 cbradney 232
  SET(DOCDIR "share/doc/${MAIN_DIR_NAME}-${VERSION}/")
9409 cbradney 233
ENDIF (TAG_VERSION OR BUILD_OSX_BUNDLE)
5142 cbradney 234
ADD_DEFINITIONS("-DDOCDIR=\\\"${CMAKE_INSTALL_PREFIX}/${DOCDIR}\\\"")
9680 cbradney 235
 
7269 cbradney 236
#ICON
10779 craig 237
IF(WIN32)
238
  SET(ICONDIR "share/icons/")
239
ELSE(WIN32)
240
  SET(ICONDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/icons/")
241
ENDIF(WIN32)
5142 cbradney 242
ADD_DEFINITIONS("-DICONDIR=\\\"${CMAKE_INSTALL_PREFIX}/${ICONDIR}\\\"")
9680 cbradney 243
 
7269 cbradney 244
#SAMPLES
5379 cbradney 245
SET(SAMPLESDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/samples/")
5142 cbradney 246
ADD_DEFINITIONS("-DSAMPLESDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SAMPLESDIR}\\\"")
9680 cbradney 247
 
7269 cbradney 248
#SCRIPTS
5379 cbradney 249
SET(SCRIPTSDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/scripts/")
5142 cbradney 250
ADD_DEFINITIONS("-DSCRIPTSDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SCRIPTSDIR}\\\"")
9680 cbradney 251
 
7269 cbradney 252
#TEMPLATES
10779 craig 253
IF(WIN32)
254
  SET(TEMPLATEDIR "share/templates/")
255
ELSE(WIN32)
256
  SET(TEMPLATEDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/templates/")
257
ENDIF(WIN32)
5142 cbradney 258
ADD_DEFINITIONS("-DTEMPLATEDIR=\\\"${CMAKE_INSTALL_PREFIX}/${TEMPLATEDIR}\\\"")
9680 cbradney 259
 
9660 cbradney 260
#DESKTOP
9653 mrdocs 261
SET(DESKTOPDIR "share/applications/")
262
ADD_DEFINITIONS("-DDESKTOPDIR=\\\"${CMAKE_INSTALL_PREFIX}/${DESKTOPDIR}\\\"")
9680 cbradney 263
 
13066 subik 264
# APPLICATION_DATA_DIR
265
# It allows specify the user configuration directory in the compile time.
266
# Example: I want to use special ~/.scribus135svn config directory for my trunk
267
#          cmake -DAPPLICATION_DATA_DIR=.scribus135svn ...
268
IF (APPLICATION_DATA_DIR)
13171 cbradney 269
	MESSAGE(STATUS "Using ApplicationDataDir ${APPLICATION_DATA_DIR} instead of the platform default.")
13066 subik 270
    ADD_DEFINITIONS("-DAPPLICATION_DATA_DIR=\\\"${APPLICATION_DATA_DIR}\\\"")
271
ELSE (APPLICATION_DATA_DIR)
272
    MESSAGE(STATUS "Using standard ApplicationDataDir. You can change it with -DAPPLICATION_DATA_DIR")
273
ENDIF (APPLICATION_DATA_DIR)
274
 
10161 cbradney 275
#LIB LOCATION - lib or lib64 normally
7269 cbradney 276
#LIB
10161 cbradney 277
IF(WANT_LIB64)
10239 cbradney 278
  IF(NOT ARCH_X86_64)
279
    MESSAGE(STATUS "WARNING: BUILDING 64 Bit build on non 64 bit architecture")
280
  ENDIF(NOT ARCH_X86_64)
281
  SET(LIB_SUFFIX "64" CACHE TYPE STRING)
10161 cbradney 282
ENDIF(WANT_LIB64)
10239 cbradney 283
SET(LIB_DIR_NAME "lib${LIB_SUFFIX}")
10161 cbradney 284
SET(LIBDIR "${LIB_DIR_NAME}/${MAIN_DIR_NAME}${TAG_VERSION}/")
5142 cbradney 285
ADD_DEFINITIONS("-DLIBDIR=\\\"${CMAKE_INSTALL_PREFIX}/${LIBDIR}\\\"")
9680 cbradney 286
 
7269 cbradney 287
#PLUGINS
10779 craig 288
IF(WIN32)
10781 craig 289
  SET(PLUGINDIR "plugins")
290
ELSE(WIN32)
10779 craig 291
  SET(PLUGINDIR "${LIB_DIR_NAME}/${MAIN_DIR_NAME}${TAG_VERSION}/plugins/")
292
ENDIF(WIN32)
5142 cbradney 293
ADD_DEFINITIONS("-DPLUGINDIR=\\\"${CMAKE_INSTALL_PREFIX}/${PLUGINDIR}\\\"")
9680 cbradney 294
 
9660 cbradney 295
#INCLUDE
296
SET(INCLUDEDIR "include/${MAIN_DIR_NAME}${TAG_VERSION}/")
297
#NO ADD DEFINITIONS, WE ONLY INSTALL WITH IT
9680 cbradney 298
 
7269 cbradney 299
#RPATH
10459 cbradney 300
IF (WANT_NORPATH OR WANT_DISTROBUILD)
301
  set(CMAKE_INSTALL_RPATH "")
302
ELSE (WANT_NORPATH OR WANT_DISTROBUILD)
303
  set(CMAKE_INSTALL_RPATH ${PLUGINDIR})
304
ENDIF (WANT_NORPATH OR WANT_DISTROBUILD)
5142 cbradney 305
 
6319 mrdocs 306
# Set the XDG mime stuff
6320 mrdocs 307
SET(MIMEDIR "share/mime/packages/")
11715 malex 308
SET(MIMELNKDIR "share/mimelnk/application/")
6319 mrdocs 309
 
10215 cbradney 310
##############################################################################################################
311
########## Build Setup                                                                              ##########
6319 mrdocs 312
 
9680 cbradney 313
#Convert our simpler command line option to the CMake style
5142 cbradney 314
#None, Debug, Release, .. or custom ones
7943 cbradney 315
# SET(WANT_DEBUG 1)
5142 cbradney 316
IF(WANT_DEBUG)
317
  SET(CMAKE_BUILD_TYPE Debug)
13238 cbradney 318
ENDIF(WANT_DEBUG)
319
IF (WANT_RELEASEWITHDEBUG)
320
  SET(CMAKE_BUILD_TYPE RelWithDebInfo)
321
ENDIF (WANT_RELEASEWITHDEBUG)
322
IF(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
5142 cbradney 323
  SET(CMAKE_BUILD_TYPE RELEASE)
13238 cbradney 324
ENDIF(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
5142 cbradney 325
 
13238 cbradney 326
 
327
 
9680 cbradney 328
#Based on our build type, setup our build options
5468 avox 329
IF(APPLE)
10750 craig 330
  # gcc/mac
12556 cbradney 331
  IF(WANT_UNIVERSAL_BUNDLE)
332
    MESSAGE("Setting Universal (PPC/i386) Architecture for OSX Build/Bundle")
333
    SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" )
334
    SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "ppc;i386" )
12559 cbradney 335
    SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk")
12556 cbradney 336
  ELSE(WANT_UNIVERSAL_BUNDLE)
337
    IF(ARCH_PPC OR ARCH_PPC_64)
338
      MESSAGE("Setting PPC Architecture for OSX Build/Bundle")
339
      SET(CMAKE_OSX_ARCHITECTURES "ppc" )
340
      SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "ppc" )
341
    ELSE(ARCH_PPC OR ARCH_PPC_64)
342
      MESSAGE("Setting i386 Architecture for OSX Build/Bundle")
343
      SET(CMAKE_OSX_ARCHITECTURES "i386" )
344
      SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "i386" )
345
    ENDIF(ARCH_PPC OR ARCH_PPC_64)
346
  ENDIF(WANT_UNIVERSAL_BUNDLE)
12528 cbradney 347
  MESSAGE(STATUS "${CMAKE_OSX_ARCHITECTURES} ${CMAKE_OSX_SYSROOT}")
348
  SET( ENV{MACOSX_DEPLOYMENT_TARGET} 10.4 )
5468 avox 349
  SET( ENV{LD_PREBIND} 1 )
350
  SET( ENV{LD_PREBIND_ALLOW_OVERLAP} 1 )
13238 cbradney 351
  IF (WANT_DEBUG)
352
	SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -fno-inline-functions -Wall -mmacosx-version-min=10.4")
353
	SET(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -fno-inline-functions -Wall -mmacosx-version-min=10.4")
354
  ENDIF (WANT_DEBUG)
355
  IF (WANT_RELEASEWITHDEBUG)
13239 cbradney 356
	SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g3 -fno-inline-functions -Wall -mmacosx-version-min=10.4")
13238 cbradney 357
	SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g3 -fno-inline-functions -Wall -mmacosx-version-min=10.4")
358
  ENDIF (WANT_RELEASEWITHDEBUG)
359
  IF (NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
13239 cbradney 360
	SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -fno-inline-functions -Wall -mmacosx-version-min=10.4")
13238 cbradney 361
	SET(CMAKE_C_FLAGS_RELEASE "-O2 -fno-inline-functions -Wall -mmacosx-version-min=10.4")
362
  ENDIF (NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
5468 avox 363
ELSE(APPLE)
10750 craig 364
  IF(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
365
    # Windows build with Visual Studio
366
    # Surely there's a better way to identify the compiler?
367
    SET(CMAKE_CXX_FLAGS_DEBUG)
368
    SET(CMAKE_C_FLAGS_DEBUG)
369
  ELSE(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
370
    # vanilla gcc
371
    SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -Wall -fstrict-aliasing")
372
    SET(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -Wall -fstrict-aliasing")
12195 cbradney 373
 
374
    IF (_machine_x86 OR _machine_x86_64)
375
      SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC")
376
      SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fPIC")
377
    ENDIF (_machine_x86 OR _machine_x86_64)
378
 
10750 craig 379
  ENDIF(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
5468 avox 380
ENDIF(APPLE)
9680 cbradney 381
 
10750 craig 382
IF(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
383
  SET(CMAKE_CXX_FLAGS_RELEASE)
384
  SET(CMAKE_C_FLAGS_RELEASE)
385
ELSE(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
12233 cbradney 386
  SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall -fPIC")
387
  SET(CMAKE_C_FLAGS_RELEASE "-O2 -Wall -fPIC")
13271 fschmid 388
  ADD_DEFINITIONS(-DNDEBUG)
10750 craig 389
ENDIF(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
5142 cbradney 390
 
10750 craig 391
IF(WIN32)
392
  ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN
12167 cbradney 393
                  -DAVOID_WIN32_FILEIO
10750 craig 394
                  -D_CRT_SECURE_NO_DEPRECATE
12167 cbradney 395
                  -DCOMPILE_PLUGIN_AS_DLL
396
  )
10750 craig 397
  SET(BUILD_WINDOWS_VERSION 1)
398
  SET(SC_USE_GDI 1)
399
  IF(NOT SC_SHOULD_NOT_USE_GDIPLUS)
400
    SET(SC_USE_GDIPLUS 1)
401
  ENDIF(NOT SC_SHOULD_NOT_USE_GDIPLUS)
402
  SET(DLL_USE_NATIVE_API 1)
403
ENDIF(WIN32)
404
 
10215 cbradney 405
##############################################################################################################
406
########## Find Dependencies                                                                        ##########
5466 cbradney 407
 
9680 cbradney 408
#<< Qt
10719 cbradney 409
SET (QT_MT_REQUIRED TRUE)
12509 cbradney 410
SET (QT_MIN_VERSION "4.4.0")
13266 cbradney 411
IF (WANT_QT4MAC_COCOA)
412
  SET (QT_MAC_USE_COCOA TRUE)
413
ENDIF (WANT_QT4MAC_COCOA)
10719 cbradney 414
IF (WANT_QT3SUPPORT)
10392 cbradney 415
  SET (QT_USE_QT3SUPPORT TRUE)
10719 cbradney 416
ELSE (WANT_QT3SUPPORT)
417
  SET (QT_USE_QT3SUPPORT FALSE)
418
ENDIF (WANT_QT3SUPPORT)
10392 cbradney 419
SET (QT_USE_QTXML TRUE )
9409 cbradney 420
IF (APPLE)
421
  SET( QT_USE_QTSQL TRUE )
422
ENDIF (APPLE)
423
SET( QT_USE_QTNETWORK TRUE )
8499 cbradney 424
FIND_PACKAGE(Qt4 REQUIRED)
425
INCLUDE( ${QT_USE_FILE} )
5142 cbradney 426
IF (QT_FOUND)
9680 cbradney 427
  MESSAGE("Qt4 Found OK")
12207 cbradney 428
  IF (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR EQUAL 4 AND QT_VERSION_PATCH EQUAL 0)
12436 cbradney 429
  MESSAGE(STATUS "Warning: Qt 4.4.0 has some bugs relating to decimal notation and line drawing. Please refer to Scribus bug 6999 and 7187 for information and to check if this may affect your use. Please use 4.4.1+ on release for your platform/distribution.")
12207 cbradney 430
  ENDIF (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR EQUAL 4 AND QT_VERSION_PATCH EQUAL 0)
12305 cbradney 431
  IF (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR EQUAL 3)
432
    MESSAGE(STATUS "Warning: Some versions of Qt 4.3.x have a bug influencing layout in the Scribus Properties Palette (refer to Scribus bug 7107). Please upgrade to Qt 4.4.1+ on release (4.4.0 has a decimal notation bug)")
433
  ENDIF (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR EQUAL 3)
10719 cbradney 434
  IF (WANT_QT3SUPPORT)
435
    MESSAGE(STATUS "Building with Qt3 Support")
436
  ELSE (WANT_QT3SUPPORT)
437
    MESSAGE(STATUS "Building without Qt3 Support (GOOD)")
438
  ENDIF (WANT_QT3SUPPORT)
9680 cbradney 439
  #Add our Qt definitions
440
  ADD_DEFINITIONS(
441
    ${QT_DEFINITIONS}
442
    -DQT_CORE_LIB
443
    -DQT_GUI_LIB
444
    -DQT_THREAD_LIB
445
    -DQT_XML_LIB
446
  )
5142 cbradney 447
ELSE(QT_FOUND)
9680 cbradney 448
  MESSAGE(FATAL_ERROR "No Qt4 found")
5142 cbradney 449
ENDIF(QT_FOUND)
9680 cbradney 450
#>> Qt
451
 
10818 craig 452
#<< ZLIB, PNG
453
IF (WIN32)
454
  # On win32 we can use Qt's zlib and libpng, so we use some
455
  # custom cmake includes. This permits us to honour the
456
  # USE_QT_ZLIB_PNGLIB flag if passed.
457
  SET(PNG_DIR ${CMAKE_MODULE_PATH})
458
  SET(ZLIB_DIR ${CMAKE_MODULE_PATH})
459
ENDIF (WIN32)
460
FIND_PACKAGE(ZLIB REQUIRED)
461
IF (ZLIB_FOUND)
462
  MESSAGE("ZLIB Library Found OK")
463
  SET(HAVE_LIBZ 1)
464
ENDIF(ZLIB_FOUND)
5142 cbradney 465
FIND_PACKAGE(PNG REQUIRED)
466
IF (PNG_FOUND)
467
  MESSAGE("PNG Library Found OK")
468
ENDIF(PNG_FOUND)
10818 craig 469
#>> ZLIB, PNG
470
 
471
#<< JPEG, TIFF, PYTHON
5142 cbradney 472
FIND_PACKAGE(JPEG REQUIRED)
473
IF (JPEG_FOUND)
474
  MESSAGE("JPEG Library Found OK")
475
ENDIF(JPEG_FOUND)
476
FIND_PACKAGE(TIFF REQUIRED)
477
IF (TIFF_FOUND)
478
  MESSAGE("TIFF Library Found OK")
479
  SET(HAVE_TIFF 1)
6211 cbradney 480
ELSE(TIFF_FOUND)
481
  MESSAGE(FATAL_ERROR "Could not find the TIFF Library")
5142 cbradney 482
ENDIF(TIFF_FOUND)
483
FIND_PACKAGE(PythonLibs REQUIRED)
484
IF (PYTHON_LIBRARY)
485
  MESSAGE("Python Library Found OK")
486
  SET(HAVE_PYTHON 1)
487
  SET(COMPILE_PYTHON 1)
488
ENDIF(PYTHON_LIBRARY)
10818 craig 489
#>> JPEG, TIFF, PYTHON
5142 cbradney 490
 
9680 cbradney 491
#<< FreeType2
12233 cbradney 492
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.6)
493
  SET(FREETYPE_DIR ${CMAKE_MODULE_PATH})
494
  FIND_PACKAGE(FREETYPE REQUIRED)
495
  IF (FREETYPE_FOUND)
496
    MESSAGE("FreeType2 Library Found OK")
497
    INCLUDE(CheckLibraryExists)
12675 jghali 498
    CHECK_LIBRARY_EXISTS(${FREETYPE_LIBRARY} FT_Get_First_Char "" HAVE_FREETYPE_FIRST)
499
    CHECK_LIBRARY_EXISTS(${FREETYPE_LIBRARY} FT_Get_Next_Char "" HAVE_FREETYPE_NEXT)
12233 cbradney 500
  ENDIF(FREETYPE_FOUND)
501
  SET(CFLAGS "${CFLAGS}"."${LIBFREETYPE_CFLAGS}")
502
ELSE(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.6)
503
  FIND_PACKAGE(Freetype REQUIRED)
504
  IF (FREETYPE_FOUND)
505
    MESSAGE(STATUS "FreeType2 Library Found OK")
506
    INCLUDE(CheckLibraryExists)
12675 jghali 507
    CHECK_LIBRARY_EXISTS(${FREETYPE_LIBRARY} FT_Get_First_Char "" HAVE_FREETYPE_FIRST)
508
    CHECK_LIBRARY_EXISTS(${FREETYPE_LIBRARY} FT_Get_Next_Char "" HAVE_FREETYPE_NEXT)
12233 cbradney 509
    # here we have an alternative
510
    # a) Setup CFLAGS with the FREETYPE_INCLUDE_DIR_freetype2 provided by cmake
511
    # b) Insert ${FREETYPE_INCLUDE_DIRS} in include sections of CMakeLists that need it
512
    # I prefer (b) and at some point & from my opinion it should  be just needed in scribus/fonts/CmakeLists.txt - pm
513
  ELSE (FREETYPE_FOUND)
514
    MESSAGE(FATAL_ERROR "No Freetype Found")
515
  ENDIF(FREETYPE_FOUND)
516
ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.6)
9680 cbradney 517
#>> FreeType2
5142 cbradney 518
 
9680 cbradney 519
#<<Render Library
520
# Select our rendering library
521
# As of Scribus 1.3.5, we can use cairo or Qt4's Arthur
7013 cbradney 522
# If we have a RENDER_LIB selected from a previous cmake run, then use it
523
# otherwise, we should be defaulting to Libart_LGPL for 1.3.4.x
6686 cbradney 524
IF(RENDER_LIB)
525
  MESSAGE(STATUS "Previously selected rendering system: ${RENDER_LIB}")
7013 cbradney 526
ELSE(RENDER_LIB)
10972 cbradney 527
  IF (NOT WANT_QTARTHUR)
528
    SET(WANT_CAIRO 1)
529
  ENDIF (NOT WANT_QTARTHUR)
6686 cbradney 530
ENDIF(RENDER_LIB)
7013 cbradney 531
 
9680 cbradney 532
IF (WANT_CAIRO OR RENDER_LIB STREQUAL "CAIRO")
533
  SET(CAIRO_DIR ${CMAKE_MODULE_PATH})
534
  FIND_PACKAGE(CAIRO)
535
  IF(CAIRO_FOUND)
5142 cbradney 536
    MESSAGE("CAIRO Library Found OK")
6686 cbradney 537
    SET(RENDER_LIB "CAIRO" CACHE TYPE STRING)
9680 cbradney 538
  ELSE(CAIRO_FOUND)
539
    SET(OLDRENDERLIBLOST TRUE)
540
  ENDIF(CAIRO_FOUND)
541
ENDIF (WANT_CAIRO OR RENDER_LIB STREQUAL "CAIRO")
5142 cbradney 542
 
11945 jghali 543
#Cairo is required on Windows for printing system
544
IF (WIN32)
545
  IF (NOT CAIRO_FOUND)
546
    MESSAGE(FATAL_ERROR "Cairo >= 1.5.16 is required for Windows build")
547
  ENDIF (NOT CAIRO_FOUND)
548
ENDIF (WIN32)
549
 
9680 cbradney 550
IF (OLDRENDERLIBLOST OR WANT_QTARTHUR OR RENDER_LIB STREQUAL "QTARTHUR" OR NOT RENDER_LIB)
551
  SET(RENDER_LIB "QTARTHUR" CACHE TYPE STRING)
552
  MESSAGE("Qt4's Arthur selected for renderer")
553
  IF (OLDRENDERLIBLOST)
554
    MESSAGE("CAIRO could no longer be found, replaced by Qt4's Arthur")
555
  ENDIF (OLDRENDERLIBLOST)
556
ENDIF (OLDRENDERLIBLOST OR WANT_QTARTHUR OR RENDER_LIB STREQUAL "QTARTHUR" OR NOT RENDER_LIB)
557
#>>Render Library
558
 
559
#<<CUPS
10747 craig 560
IF(NOT WIN32)
561
  IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
562
    SET(Cups_DIR ${CMAKE_MODULE_PATH})
563
  ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
564
  FIND_PACKAGE(Cups REQUIRED)
565
  IF(CUPS_FOUND)
566
    SET(HAVE_CUPS 1)
567
    MESSAGE("CUPS Library Found OK")
568
  ENDIF(CUPS_FOUND)
569
ELSE(NOT WIN32)
570
  # Windows doesn't use CUPS
571
  SET(CUPS_INCLUDE_DIR)
572
ENDIF(NOT WIN32)
9680 cbradney 573
#>>CUPS
5142 cbradney 574
 
9680 cbradney 575
#<<LibXML2
7203 cbradney 576
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
577
  SET(LibXml2_DIR ${CMAKE_MODULE_PATH})
578
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
579
FIND_PACKAGE(LibXml2 REQUIRED)
5142 cbradney 580
IF(LIBXML2_FOUND)
581
  SET(HAVE_XML 1)
582
  MESSAGE("LIBXML2 Library Found OK")
583
ENDIF(LIBXML2_FOUND)
9680 cbradney 584
#>>LibXML2
5142 cbradney 585
 
9680 cbradney 586
#<<LittleCMS
5142 cbradney 587
SET(LCMS_DIR ${CMAKE_MODULE_PATH})
588
FIND_PACKAGE(LCMS REQUIRED)
589
IF(LCMS_FOUND)
590
  SET(HAVE_CMS 1)
591
  SET(CMS_INC "lcms.h")
6553 cbradney 592
  MESSAGE("LittleCMS Library Found OK")
593
ELSE(LCMS_FOUND)
594
  MESSAGE(FATAL_ERROR "Could not find the LittleCMS Library")
5142 cbradney 595
ENDIF(LCMS_FOUND)
9680 cbradney 596
#>>LittleCMS
5142 cbradney 597
 
9680 cbradney 598
#<<FontConfig
10747 craig 599
IF(NOT WIN32)
600
  SET(FONTCONFIG_DIR ${CMAKE_MODULE_PATH})
601
  FIND_PACKAGE(FONTCONFIG)
602
  IF(FONTCONFIG_FOUND)
5142 cbradney 603
	MESSAGE("FontConfig Found OK")
604
	SET(HAVE_FONTCONFIG 1)
10747 craig 605
  ENDIF(FONTCONFIG_FOUND)
606
ELSE(NOT WIN32)
607
  # Windows builds neither use nor require fontconfig
608
  SET(FONTCONFIG_INCLUDE_DIR)
609
ENDIF(NOT WIN32)
9680 cbradney 610
#>>FontConfig
5142 cbradney 611
 
11106 cbradney 612
#<<ASPELL for Speelling support
613
FIND_PACKAGE(ASPELL)
614
IF (ASPELL_FOUND)
615
  MESSAGE("ASpell Found OK")
616
  SET(HAVE_ASPELL 1)
617
ELSE(ASPELL_FOUND)
618
  MESSAGE("ASpell or its developer libraries NOT found - Disabling support for spell checking")
619
ENDIF(ASPELL_FOUND)
620
#>>ASPELL for Speelling support
621
 
622
 
10238 cbradney 623
#<<PoDoFo for AI PDF import
10234 fschmid 624
FIND_PACKAGE(LIBPODOFO)
625
IF(LIBPODOFO_FOUND)
10235 cbradney 626
  MESSAGE("PoDoFo found OK")
627
  SET(HAVE_PODOFO 1)
628
ELSE(LIBPODOFO_FOUND)
629
  MESSAGE("PoDoFo NOT found - Disabling support for PDF embedded in AI")
10234 fschmid 630
ENDIF(LIBPODOFO_FOUND)
10238 cbradney 631
#>>PoDoFo for AI PDF import
10234 fschmid 632
 
10215 cbradney 633
##############################################################################################################
634
########## Include Setup                                                                            ##########
8499 cbradney 635
 
10215 cbradney 636
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
637
 
5142 cbradney 638
CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
639
IF(HAVE_DLFCN_H)
640
  ADD_DEFINITIONS(-DHAVE_DLFCN_H)
641
ENDIF(HAVE_DLFCN_H)
642
 
643
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
644
IF(HAVE_UNISTD_H)
645
  ADD_DEFINITIONS(-DHAVE_UNISTD_H)
646
ENDIF(HAVE_UNISTD_H)
647
 
648
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
649
# IF(HAVE_SYS_TYPES_H)
650
#   ADD_DEFINITIONS(-DHAVE_SYS_TYPES_H)
651
# ENDIF(HAVE_SYS_TYPES_H)
652
 
653
CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
654
# IF(HAVE_SYS_STAT_H)
655
#   ADD_DEFINITIONS(-DHAVE_SYS_STAT_H)
656
# ENDIF(HAVE_SYS_STAT_H)
9680 cbradney 657
#>>Test for existing include files
5142 cbradney 658
 
659
 
5150 cbradney 660
#Create configure files.. config.h and uninstall
661
#config.h
5142 cbradney 662
INCLUDE (ConfigureChecks.cmake)
10779 craig 663
  IF(WIN32)
664
    SET(CONFIG_NAME win-config.h)
665
  ELSE(WIN32)
666
    SET(CONFIG_NAME config.h)
667
  ENDIF(WIN32)
668
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
5142 cbradney 669
ADD_DEFINITIONS("-DHAVE_CONFIG_H")
9680 cbradney 670
 
5142 cbradney 671
 
5150 cbradney 672
 
5157 cbradney 673
#Set up include dirs with all found packages
5142 cbradney 674
INCLUDE_DIRECTORIES(
9680 cbradney 675
  ${CMAKE_BINARY_DIR}
676
  ${CMAKE_BINARY_DIR}/scribus
677
  ${QT_INCLUDES}
678
  ${CUPS_INCLUDE_DIR}
679
  ${FREETYPE_INCLUDE_DIR}
680
  ${FONTCONFIG_INCLUDE_DIR}
9712 avox 681
  ${JPEG_INCLUDE_DIR}
9680 cbradney 682
  ${LCMS_INCLUDE_DIR}
683
  ${LIBXML2_INCLUDE_DIR}
684
  ${PYTHON_INCLUDE_PATH}
685
  ${TIFF_INCLUDE_DIR}
686
  ${ZLIB_INCLUDE_DIR}
5142 cbradney 687
)
688
 
10215 cbradney 689
##############################################################################################################
690
########## Uninstall Setup                                                                          ##########
691
 
692
CONFIGURE_FILE(
693
  "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
694
  "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
695
  IMMEDIATE @ONLY
696
)
697
 
698
ADD_CUSTOM_TARGET(uninstall
699
  "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
700
 
701
 
702
##############################################################################################################
703
########## Add our subdirs                                                                          ##########
704
 
5157 cbradney 705
#Add our source subdirs
5142 cbradney 706
ADD_SUBDIRECTORY(scribus)
12077 malex 707
ADD_SUBDIRECTORY(translations/qm)
5142 cbradney 708
 
5157 cbradney 709
#Install our READMEs etc.
5142 cbradney 710
INSTALL(FILES
9386 cbradney 711
  AUTHORS
712
  BUILDING
713
  ChangeLog
10359 mrdocs 714
  ChangeLogSVN
9386 cbradney 715
  COPYING
12531 cbradney 716
  LINKS
9386 cbradney 717
  NEWS
718
  PACKAGING
719
  README
720
  README.MacOSX
721
  TODO
12531 cbradney 722
  TRANSLATION
5142 cbradney 723
  DESTINATION ${DOCDIR}
724
)
9386 cbradney 725
 
9680 cbradney 726
#Install our MIME data
6319 mrdocs 727
INSTALL(FILES
9386 cbradney 728
  scribus.xml
729
  DESTINATION ${MIMEDIR}
6319 mrdocs 730
)
11715 malex 731
#KDE workaround until it starts supporting freedesktop spec
732
INSTALL(FILES
733
  vnd.scribus.desktop
11717 cbradney 734
  DESTINATION ${MIMELNKDIR}
11715 malex 735
)
5396 cbradney 736
 
11761 mrdocs 737
## PL We may not need this anymore
9680 cbradney 738
#Install the desktop file
11761 mrdocs 739
## INSTALL(FILES
740
 # scribus.desktop
741
 # #DESTINATION ${DESKTOPDIR}
742
#)
9680 cbradney 743
 
744
#If building an Apple bundle, install these specific files
745
IF(APPLEBUNDLE)
9386 cbradney 746
  INSTALL(FILES
9680 cbradney 747
    Scribus.app/Contents/Info.plist
748
    DESTINATION ${CMAKE_INSTALL_PREFIX}
9386 cbradney 749
  )
750
  INSTALL(FILES
9680 cbradney 751
    Scribus.app/Contents/Resources/Scribus.icns
752
    Scribus.app/Contents/Resources/Scribus-doc.icns
753
    DESTINATION ${CMAKE_INSTALL_PREFIX}/Resources
9386 cbradney 754
  )
9680 cbradney 755
ENDIF(APPLEBUNDLE)
9386 cbradney 756
 
10215 cbradney 757
##############################################################################################################
758
########## Install/CPack Setup                                                                      ##########
759
 
9680 cbradney 760
# If the cmake version includes cpack, use it for tarball building
5396 cbradney 761
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
762
  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Scribus is an open source publishing application for Linux, Mac OSX and Windows")
763
  SET(CPACK_PACKAGE_VENDOR "Scribus Team")
764
  SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
765
  SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README")
766
  SET(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
767
  SET(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
768
  SET(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
5407 cbradney 769
  SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Scribus ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
5396 cbradney 770
  SET(CPACK_PACKAGE_EXECUTABLES "scribus${TAG_VERSION}")
11761 mrdocs 771
  SET(CPACK_SOURCE_PACKAGE_FILE_NAME "scribus-${VERSION}${VERSION_SUFFIX}")
5407 cbradney 772
  SET(CPACK_SOURCE_GENERATOR TBZ2)
11761 mrdocs 773
  SET(CPACK_SYSTEM_NAME "")
774
  SET(CPACK_TOPLEVEL_TAG "")
9680 cbradney 775
  SET(CPACK_SOURCE_IGNORE_FILES
776
    CMakeCache.txt
13511 mrdocs 777
    scribus-1.5.0.svn.tar.bz2
778
    scribus-1.5.0.svn.tar.Z
779
    scribus-1.5.0.svn.tar.gz
9680 cbradney 780
    "~$"
781
    "\\\\.cvsignore$"
782
    "\\\\.o$"
11761 mrdocs 783
    "\\\\.svn-base$"
784
    "\\\\.svn$"
9680 cbradney 785
    "^${PROJECT_SOURCE_DIR}.*/CVS/"
786
    "^${PROJECT_SOURCE_DIR}/debian/"
787
    "^${PROJECT_SOURCE_DIR}/old/"
788
    "^${PROJECT_SOURCE_DIR}.*/CVSROOT/"
789
    "^${PROJECT_SOURCE_DIR}/admin/"
790
  )
5396 cbradney 791
  INCLUDE(CPack)
5463 avox 792
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")