Subversion Repositories Scribus

Rev

Rev 13957 | Rev 14047 | 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)
13849 cbradney 410
SET (QT_MIN_VERSION "4.5.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 )
13530 pierre 420
SET (QT_USE_QTWEBKIT TRUE )
13839 fschmid 421
SET (QT_USE_QTOPENGL TRUE )
9409 cbradney 422
IF (APPLE)
423
  SET( QT_USE_QTSQL TRUE )
424
ENDIF (APPLE)
425
SET( QT_USE_QTNETWORK TRUE )
8499 cbradney 426
FIND_PACKAGE(Qt4 REQUIRED)
427
INCLUDE( ${QT_USE_FILE} )
5142 cbradney 428
IF (QT_FOUND)
9680 cbradney 429
  MESSAGE("Qt4 Found OK")
13566 pierre 430
  # we wont turn around, lets make it required
431
  IF(QT_QTWEBKIT_FOUND)
432
  MESSAGE(STATUS "QtWebkit Found OK")
433
  ELSE(QT_QTWEBKIT_FOUND)
434
  MESSAGE(FATAL_ERROR "QtWebKit not found")
435
  ENDIF(QT_QTWEBKIT_FOUND)
436
 
12207 cbradney 437
  IF (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR EQUAL 4 AND QT_VERSION_PATCH EQUAL 0)
12436 cbradney 438
  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 439
  ENDIF (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR EQUAL 4 AND QT_VERSION_PATCH EQUAL 0)
12305 cbradney 440
  IF (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR EQUAL 3)
441
    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)")
442
  ENDIF (QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR EQUAL 3)
10719 cbradney 443
  IF (WANT_QT3SUPPORT)
444
    MESSAGE(STATUS "Building with Qt3 Support")
445
  ELSE (WANT_QT3SUPPORT)
446
    MESSAGE(STATUS "Building without Qt3 Support (GOOD)")
447
  ENDIF (WANT_QT3SUPPORT)
9680 cbradney 448
  #Add our Qt definitions
449
  ADD_DEFINITIONS(
450
    ${QT_DEFINITIONS}
451
    -DQT_CORE_LIB
452
    -DQT_GUI_LIB
453
    -DQT_THREAD_LIB
454
    -DQT_XML_LIB
13839 fschmid 455
    -DQT_GL_LIB
9680 cbradney 456
  )
5142 cbradney 457
ELSE(QT_FOUND)
9680 cbradney 458
  MESSAGE(FATAL_ERROR "No Qt4 found")
5142 cbradney 459
ENDIF(QT_FOUND)
9680 cbradney 460
#>> Qt
461
 
10818 craig 462
#<< ZLIB, PNG
463
IF (WIN32)
464
  # On win32 we can use Qt's zlib and libpng, so we use some
465
  # custom cmake includes. This permits us to honour the
466
  # USE_QT_ZLIB_PNGLIB flag if passed.
467
  SET(PNG_DIR ${CMAKE_MODULE_PATH})
468
  SET(ZLIB_DIR ${CMAKE_MODULE_PATH})
469
ENDIF (WIN32)
470
FIND_PACKAGE(ZLIB REQUIRED)
471
IF (ZLIB_FOUND)
472
  MESSAGE("ZLIB Library Found OK")
473
  SET(HAVE_LIBZ 1)
474
ENDIF(ZLIB_FOUND)
5142 cbradney 475
FIND_PACKAGE(PNG REQUIRED)
476
IF (PNG_FOUND)
477
  MESSAGE("PNG Library Found OK")
478
ENDIF(PNG_FOUND)
10818 craig 479
#>> ZLIB, PNG
480
 
13839 fschmid 481
IF (WANT_NOOSG)
482
    MESSAGE("Building without 3D-Extension")
483
ELSE (WANT_NOOSG)
484
  FIND_PACKAGE(OSG)
485
  IF(OSG_FOUND)
486
    MESSAGE("OSG found OK")
487
    SET(HAVE_OSG 1)
13947 cbradney 488
    FIND_PACKAGE(OpenGL)
13839 fschmid 489
  ELSE(OSG_FOUND)
490
    MESSAGE("No OSG found, building without 3D-Extension")
491
  ENDIF(OSG_FOUND)
492
ENDIF (WANT_NOOSG)
493
 
10818 craig 494
#<< JPEG, TIFF, PYTHON
5142 cbradney 495
FIND_PACKAGE(JPEG REQUIRED)
496
IF (JPEG_FOUND)
497
  MESSAGE("JPEG Library Found OK")
498
ENDIF(JPEG_FOUND)
499
FIND_PACKAGE(TIFF REQUIRED)
500
IF (TIFF_FOUND)
501
  MESSAGE("TIFF Library Found OK")
502
  SET(HAVE_TIFF 1)
6211 cbradney 503
ELSE(TIFF_FOUND)
504
  MESSAGE(FATAL_ERROR "Could not find the TIFF Library")
5142 cbradney 505
ENDIF(TIFF_FOUND)
506
FIND_PACKAGE(PythonLibs REQUIRED)
507
IF (PYTHON_LIBRARY)
508
  MESSAGE("Python Library Found OK")
509
  SET(HAVE_PYTHON 1)
510
  SET(COMPILE_PYTHON 1)
511
ENDIF(PYTHON_LIBRARY)
10818 craig 512
#>> JPEG, TIFF, PYTHON
5142 cbradney 513
 
9680 cbradney 514
#<< FreeType2
12233 cbradney 515
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.6)
516
  SET(FREETYPE_DIR ${CMAKE_MODULE_PATH})
517
  FIND_PACKAGE(FREETYPE REQUIRED)
518
  IF (FREETYPE_FOUND)
519
    MESSAGE("FreeType2 Library Found OK")
520
    INCLUDE(CheckLibraryExists)
12675 jghali 521
    CHECK_LIBRARY_EXISTS(${FREETYPE_LIBRARY} FT_Get_First_Char "" HAVE_FREETYPE_FIRST)
522
    CHECK_LIBRARY_EXISTS(${FREETYPE_LIBRARY} FT_Get_Next_Char "" HAVE_FREETYPE_NEXT)
12233 cbradney 523
  ENDIF(FREETYPE_FOUND)
524
  SET(CFLAGS "${CFLAGS}"."${LIBFREETYPE_CFLAGS}")
525
ELSE(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.6)
526
  FIND_PACKAGE(Freetype REQUIRED)
527
  IF (FREETYPE_FOUND)
528
    MESSAGE(STATUS "FreeType2 Library Found OK")
529
    INCLUDE(CheckLibraryExists)
12675 jghali 530
    CHECK_LIBRARY_EXISTS(${FREETYPE_LIBRARY} FT_Get_First_Char "" HAVE_FREETYPE_FIRST)
531
    CHECK_LIBRARY_EXISTS(${FREETYPE_LIBRARY} FT_Get_Next_Char "" HAVE_FREETYPE_NEXT)
12233 cbradney 532
    # here we have an alternative
533
    # a) Setup CFLAGS with the FREETYPE_INCLUDE_DIR_freetype2 provided by cmake
534
    # b) Insert ${FREETYPE_INCLUDE_DIRS} in include sections of CMakeLists that need it
535
    # I prefer (b) and at some point & from my opinion it should  be just needed in scribus/fonts/CmakeLists.txt - pm
536
  ELSE (FREETYPE_FOUND)
537
    MESSAGE(FATAL_ERROR "No Freetype Found")
538
  ENDIF(FREETYPE_FOUND)
539
ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.6)
9680 cbradney 540
#>> FreeType2
5142 cbradney 541
 
9680 cbradney 542
#<<Render Library
543
# Select our rendering library
544
# As of Scribus 1.3.5, we can use cairo or Qt4's Arthur
7013 cbradney 545
# If we have a RENDER_LIB selected from a previous cmake run, then use it
546
# otherwise, we should be defaulting to Libart_LGPL for 1.3.4.x
6686 cbradney 547
IF(RENDER_LIB)
548
  MESSAGE(STATUS "Previously selected rendering system: ${RENDER_LIB}")
7013 cbradney 549
ELSE(RENDER_LIB)
10972 cbradney 550
  IF (NOT WANT_QTARTHUR)
551
    SET(WANT_CAIRO 1)
552
  ENDIF (NOT WANT_QTARTHUR)
6686 cbradney 553
ENDIF(RENDER_LIB)
7013 cbradney 554
 
9680 cbradney 555
IF (WANT_CAIRO OR RENDER_LIB STREQUAL "CAIRO")
556
  SET(CAIRO_DIR ${CMAKE_MODULE_PATH})
557
  FIND_PACKAGE(CAIRO)
558
  IF(CAIRO_FOUND)
5142 cbradney 559
    MESSAGE("CAIRO Library Found OK")
6686 cbradney 560
    SET(RENDER_LIB "CAIRO" CACHE TYPE STRING)
9680 cbradney 561
  ELSE(CAIRO_FOUND)
562
    SET(OLDRENDERLIBLOST TRUE)
563
  ENDIF(CAIRO_FOUND)
564
ENDIF (WANT_CAIRO OR RENDER_LIB STREQUAL "CAIRO")
5142 cbradney 565
 
11945 jghali 566
#Cairo is required on Windows for printing system
567
IF (WIN32)
568
  IF (NOT CAIRO_FOUND)
569
    MESSAGE(FATAL_ERROR "Cairo >= 1.5.16 is required for Windows build")
570
  ENDIF (NOT CAIRO_FOUND)
571
ENDIF (WIN32)
572
 
9680 cbradney 573
IF (OLDRENDERLIBLOST OR WANT_QTARTHUR OR RENDER_LIB STREQUAL "QTARTHUR" OR NOT RENDER_LIB)
574
  SET(RENDER_LIB "QTARTHUR" CACHE TYPE STRING)
575
  MESSAGE("Qt4's Arthur selected for renderer")
576
  IF (OLDRENDERLIBLOST)
577
    MESSAGE("CAIRO could no longer be found, replaced by Qt4's Arthur")
578
  ENDIF (OLDRENDERLIBLOST)
579
ENDIF (OLDRENDERLIBLOST OR WANT_QTARTHUR OR RENDER_LIB STREQUAL "QTARTHUR" OR NOT RENDER_LIB)
580
#>>Render Library
581
 
582
#<<CUPS
10747 craig 583
IF(NOT WIN32)
584
  IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
585
    SET(Cups_DIR ${CMAKE_MODULE_PATH})
586
  ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
587
  FIND_PACKAGE(Cups REQUIRED)
588
  IF(CUPS_FOUND)
589
    SET(HAVE_CUPS 1)
590
    MESSAGE("CUPS Library Found OK")
591
  ENDIF(CUPS_FOUND)
592
ELSE(NOT WIN32)
593
  # Windows doesn't use CUPS
594
  SET(CUPS_INCLUDE_DIR)
595
ENDIF(NOT WIN32)
9680 cbradney 596
#>>CUPS
5142 cbradney 597
 
9680 cbradney 598
#<<LibXML2
7203 cbradney 599
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
600
  SET(LibXml2_DIR ${CMAKE_MODULE_PATH})
601
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
602
FIND_PACKAGE(LibXml2 REQUIRED)
5142 cbradney 603
IF(LIBXML2_FOUND)
604
  SET(HAVE_XML 1)
605
  MESSAGE("LIBXML2 Library Found OK")
606
ENDIF(LIBXML2_FOUND)
9680 cbradney 607
#>>LibXML2
5142 cbradney 608
 
9680 cbradney 609
#<<LittleCMS
5142 cbradney 610
SET(LCMS_DIR ${CMAKE_MODULE_PATH})
611
FIND_PACKAGE(LCMS REQUIRED)
612
IF(LCMS_FOUND)
613
  SET(HAVE_CMS 1)
614
  SET(CMS_INC "lcms.h")
6553 cbradney 615
  MESSAGE("LittleCMS Library Found OK")
616
ELSE(LCMS_FOUND)
617
  MESSAGE(FATAL_ERROR "Could not find the LittleCMS Library")
5142 cbradney 618
ENDIF(LCMS_FOUND)
9680 cbradney 619
#>>LittleCMS
5142 cbradney 620
 
9680 cbradney 621
#<<FontConfig
10747 craig 622
IF(NOT WIN32)
623
  SET(FONTCONFIG_DIR ${CMAKE_MODULE_PATH})
624
  FIND_PACKAGE(FONTCONFIG)
625
  IF(FONTCONFIG_FOUND)
5142 cbradney 626
	MESSAGE("FontConfig Found OK")
627
	SET(HAVE_FONTCONFIG 1)
10747 craig 628
  ENDIF(FONTCONFIG_FOUND)
629
ELSE(NOT WIN32)
630
  # Windows builds neither use nor require fontconfig
631
  SET(FONTCONFIG_INCLUDE_DIR)
632
ENDIF(NOT WIN32)
9680 cbradney 633
#>>FontConfig
5142 cbradney 634
 
11106 cbradney 635
#<<ASPELL for Speelling support
636
FIND_PACKAGE(ASPELL)
637
IF (ASPELL_FOUND)
638
  MESSAGE("ASpell Found OK")
639
  SET(HAVE_ASPELL 1)
640
ELSE(ASPELL_FOUND)
641
  MESSAGE("ASpell or its developer libraries NOT found - Disabling support for spell checking")
642
ENDIF(ASPELL_FOUND)
643
#>>ASPELL for Speelling support
644
 
645
 
10238 cbradney 646
#<<PoDoFo for AI PDF import
10234 fschmid 647
FIND_PACKAGE(LIBPODOFO)
648
IF(LIBPODOFO_FOUND)
10235 cbradney 649
  MESSAGE("PoDoFo found OK")
650
  SET(HAVE_PODOFO 1)
651
ELSE(LIBPODOFO_FOUND)
652
  MESSAGE("PoDoFo NOT found - Disabling support for PDF embedded in AI")
10234 fschmid 653
ENDIF(LIBPODOFO_FOUND)
10238 cbradney 654
#>>PoDoFo for AI PDF import
10234 fschmid 655
 
13962 herm 656
#<<GraphicksMagick++ for image import
13957 herm 657
SET(GMAGICK_DIR ${CMAKE_MODULE_PATH})
658
FIND_PACKAGE(GMAGICK)
659
IF(GMAGICK_FOUND)
13962 herm 660
  MESSAGE("GraphicksMagick++ Found OK")
13957 herm 661
ELSE(GMAGICK_FOUND)
13962 herm 662
  MESSAGE("GraphicksMagick++ NOT found! Building without additional image format support!")
13957 herm 663
ENDIF(GMAGICK_FOUND)
13962 herm 664
#>>GraphicksMagick++ for image import
13957 herm 665
 
10215 cbradney 666
##############################################################################################################
667
########## Include Setup                                                                            ##########
8499 cbradney 668
 
10215 cbradney 669
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
670
 
5142 cbradney 671
CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
672
IF(HAVE_DLFCN_H)
673
  ADD_DEFINITIONS(-DHAVE_DLFCN_H)
674
ENDIF(HAVE_DLFCN_H)
675
 
676
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
677
IF(HAVE_UNISTD_H)
678
  ADD_DEFINITIONS(-DHAVE_UNISTD_H)
679
ENDIF(HAVE_UNISTD_H)
680
 
681
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
682
# IF(HAVE_SYS_TYPES_H)
683
#   ADD_DEFINITIONS(-DHAVE_SYS_TYPES_H)
684
# ENDIF(HAVE_SYS_TYPES_H)
685
 
686
CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
687
# IF(HAVE_SYS_STAT_H)
688
#   ADD_DEFINITIONS(-DHAVE_SYS_STAT_H)
689
# ENDIF(HAVE_SYS_STAT_H)
9680 cbradney 690
#>>Test for existing include files
5142 cbradney 691
 
692
 
5150 cbradney 693
#Create configure files.. config.h and uninstall
694
#config.h
5142 cbradney 695
INCLUDE (ConfigureChecks.cmake)
10779 craig 696
  IF(WIN32)
697
    SET(CONFIG_NAME win-config.h)
698
  ELSE(WIN32)
699
    SET(CONFIG_NAME config.h)
700
  ENDIF(WIN32)
701
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
5142 cbradney 702
ADD_DEFINITIONS("-DHAVE_CONFIG_H")
9680 cbradney 703
 
5142 cbradney 704
 
5150 cbradney 705
 
5157 cbradney 706
#Set up include dirs with all found packages
5142 cbradney 707
INCLUDE_DIRECTORIES(
9680 cbradney 708
  ${CMAKE_BINARY_DIR}
709
  ${CMAKE_BINARY_DIR}/scribus
710
  ${QT_INCLUDES}
711
  ${CUPS_INCLUDE_DIR}
712
  ${FREETYPE_INCLUDE_DIR}
713
  ${FONTCONFIG_INCLUDE_DIR}
9712 avox 714
  ${JPEG_INCLUDE_DIR}
9680 cbradney 715
  ${LCMS_INCLUDE_DIR}
716
  ${LIBXML2_INCLUDE_DIR}
717
  ${PYTHON_INCLUDE_PATH}
718
  ${TIFF_INCLUDE_DIR}
719
  ${ZLIB_INCLUDE_DIR}
13839 fschmid 720
  ${OPENGL_INCLUDE_DIR}
721
  ${OSG_INCLUDE_DIR}
5142 cbradney 722
)
723
 
10215 cbradney 724
##############################################################################################################
725
########## Uninstall Setup                                                                          ##########
726
 
727
CONFIGURE_FILE(
728
  "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
729
  "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
730
  IMMEDIATE @ONLY
731
)
732
 
733
ADD_CUSTOM_TARGET(uninstall
734
  "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
735
 
736
 
737
##############################################################################################################
738
########## Add our subdirs                                                                          ##########
739
 
5157 cbradney 740
#Add our source subdirs
5142 cbradney 741
ADD_SUBDIRECTORY(scribus)
13527 cbradney 742
ADD_SUBDIRECTORY(doc)
743
ADD_SUBDIRECTORY(icons)
13593 cbradney 744
ADD_SUBDIRECTORY(keysets)
13528 cbradney 745
ADD_SUBDIRECTORY(profiles)
12077 malex 746
ADD_SUBDIRECTORY(translations/qm)
5142 cbradney 747
 
5157 cbradney 748
#Install our READMEs etc.
5142 cbradney 749
INSTALL(FILES
9386 cbradney 750
  AUTHORS
751
  BUILDING
752
  ChangeLog
10359 mrdocs 753
  ChangeLogSVN
9386 cbradney 754
  COPYING
12531 cbradney 755
  LINKS
9386 cbradney 756
  NEWS
757
  PACKAGING
758
  README
759
  README.MacOSX
760
  TODO
12531 cbradney 761
  TRANSLATION
5142 cbradney 762
  DESTINATION ${DOCDIR}
763
)
9386 cbradney 764
 
9680 cbradney 765
#Install our MIME data
6319 mrdocs 766
INSTALL(FILES
9386 cbradney 767
  scribus.xml
768
  DESTINATION ${MIMEDIR}
6319 mrdocs 769
)
11715 malex 770
#KDE workaround until it starts supporting freedesktop spec
771
INSTALL(FILES
772
  vnd.scribus.desktop
11717 cbradney 773
  DESTINATION ${MIMELNKDIR}
11715 malex 774
)
5396 cbradney 775
 
11761 mrdocs 776
## PL We may not need this anymore
9680 cbradney 777
#Install the desktop file
11761 mrdocs 778
## INSTALL(FILES
779
 # scribus.desktop
780
 # #DESTINATION ${DESKTOPDIR}
781
#)
9680 cbradney 782
 
783
#If building an Apple bundle, install these specific files
784
IF(APPLEBUNDLE)
9386 cbradney 785
  INSTALL(FILES
9680 cbradney 786
    Scribus.app/Contents/Info.plist
787
    DESTINATION ${CMAKE_INSTALL_PREFIX}
9386 cbradney 788
  )
789
  INSTALL(FILES
9680 cbradney 790
    Scribus.app/Contents/Resources/Scribus.icns
791
    Scribus.app/Contents/Resources/Scribus-doc.icns
792
    DESTINATION ${CMAKE_INSTALL_PREFIX}/Resources
9386 cbradney 793
  )
9680 cbradney 794
ENDIF(APPLEBUNDLE)
9386 cbradney 795
 
10215 cbradney 796
##############################################################################################################
797
########## Install/CPack Setup                                                                      ##########
798
 
9680 cbradney 799
# If the cmake version includes cpack, use it for tarball building
5396 cbradney 800
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
801
  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Scribus is an open source publishing application for Linux, Mac OSX and Windows")
802
  SET(CPACK_PACKAGE_VENDOR "Scribus Team")
803
  SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
804
  SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README")
805
  SET(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
806
  SET(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
807
  SET(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
5407 cbradney 808
  SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Scribus ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
5396 cbradney 809
  SET(CPACK_PACKAGE_EXECUTABLES "scribus${TAG_VERSION}")
11761 mrdocs 810
  SET(CPACK_SOURCE_PACKAGE_FILE_NAME "scribus-${VERSION}${VERSION_SUFFIX}")
5407 cbradney 811
  SET(CPACK_SOURCE_GENERATOR TBZ2)
11761 mrdocs 812
  SET(CPACK_SYSTEM_NAME "")
813
  SET(CPACK_TOPLEVEL_TAG "")
9680 cbradney 814
  SET(CPACK_SOURCE_IGNORE_FILES
815
    CMakeCache.txt
13511 mrdocs 816
    scribus-1.5.0.svn.tar.bz2
817
    scribus-1.5.0.svn.tar.Z
818
    scribus-1.5.0.svn.tar.gz
9680 cbradney 819
    "~$"
820
    "\\\\.cvsignore$"
821
    "\\\\.o$"
11761 mrdocs 822
    "\\\\.svn-base$"
823
    "\\\\.svn$"
9680 cbradney 824
    "^${PROJECT_SOURCE_DIR}.*/CVS/"
825
    "^${PROJECT_SOURCE_DIR}/debian/"
826
    "^${PROJECT_SOURCE_DIR}/old/"
827
    "^${PROJECT_SOURCE_DIR}.*/CVSROOT/"
828
    "^${PROJECT_SOURCE_DIR}/admin/"
829
  )
5396 cbradney 830
  INCLUDE(CPack)
5463 avox 831
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")