Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
9680 cbradney 1
#Set our CMake minimum version
5758 cbradney 2
#Require 2.4.2 for Qt finding
9680 cbradney 3
#Require 2.4.3 for moc change detection and rpath updates for custom cairo install
8499 cbradney 4
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR)
5758 cbradney 5
 
9680 cbradney 6
#Pretty colors
5142 cbradney 7
SET(CMAKE_COLOR_MAKEFILE ON)
9680 cbradney 8
#Dont force verbose
9715 avox 9
SET(CMAKE_VERBOSE_MAKEFILE OFF)
9680 cbradney 10
#Include current dir
5142 cbradney 11
SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)
9680 cbradney 12
#RPATH setup
5758 cbradney 13
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
9715 avox 14
SET(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
8902 cbradney 15
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
16
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
9680 cbradney 17
#SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
18
#SET(CMAKE_SKIP_RPATH:BOOL NO)
8902 cbradney 19
 
9680 cbradney 20
#Set the custom CMake module directory where our include/lib finders are
5142 cbradney 21
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
9680 cbradney 22
 
5142 cbradney 23
# SET(CMAKE_SHARED_MODULE_LINK_FLAGS "${CMAKE_SHARED_MODULE_LINK_FLAGS} -export-dynamic")
24
# SET(CMAKE_SHARED_MODULE_LINK_CXX_FLAGS "${CMAKE_SHARED_MODULE_LINK_CXX_FLAGS} -export-dynamic")
25
# SET(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -export-dynamic")
26
# SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -export-dynamic")
27
# MESSAGE(STATUS ${CMAKE_SHARED_MODULE_LINK_FLAGS})
28
# MESSAGE(STATUS ${CMAKE_SHARED_MODULE_LINK_CXX_FLAGS})
29
# MESSAGE(STATUS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
30
# MESSAGE(STATUS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
31
# MESSAGE(STATUS ${CMAKE_CXX_CREATE_SHARED_MODULE})
32
# MESSAGE(STATUS ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
33
 
34
#IMPORT FROM COMMANDLINE
35
# SET with cmake -DWANT_CAIRO=1, etc
36
# MESSAGE(STATUS ${WANT_CAIRO})
37
# MESSAGE(STATUS ${WANT_LIBART})
38
# MESSAGE(STATUS ${WANT_DEBUG})
5157 cbradney 39
 
40
# SET(WANT_CAIRO 0)
41
# SET(WANT_LIBART 1)
42
 
9680 cbradney 43
#Project Setup
5142 cbradney 44
PROJECT(scribus)
9680 cbradney 45
#Set our version values
46
#Final version is ${VERSION} = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}
47
#where VERSION_SUFFIX is of the form "", "cvs" or "Ncvs" (N being the minor patch level)
5396 cbradney 48
SET (VERSION_MAJOR "1")
49
SET (VERSION_MINOR "3")
8499 cbradney 50
SET (VERSION_PATCH "5")
9706 cbradney 51
SET (VERSION_SUFFIX "svn")
5407 cbradney 52
SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX})
53
MESSAGE(STATUS "Scribus ${VERSION} will be built to install into ${CMAKE_INSTALL_PREFIX}")
5142 cbradney 54
 
9680 cbradney 55
#Set the permissions to be used when installing plugins
5142 cbradney 56
SET(PLUGIN_PERMISSIONS WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE WORLD_READ GROUP_READ OWNER_READ OWNER_WRITE)
57
 
9680 cbradney 58
#Our main directory is scribus
5379 cbradney 59
SET(MAIN_DIR_NAME "scribus")
9680 cbradney 60
 
9409 cbradney 61
#On Apple, we ignore the versioning tag so all items are "scribus" not "scribus-version"
9508 cbradney 62
IF (NOT BUILD_OSX_BUNDLE)
9680 cbradney 63
  SET(BUILD_OSX_BUNDLE ${APPLE} CACHE TYPE BOOL)
9508 cbradney 64
ENDIF (NOT BUILD_OSX_BUNDLE)
65
 
9680 cbradney 66
#Simplify future conditionals for Apple
67
IF (APPLE AND BUILD_OSX_BUNDLE)
68
  SET(APPLEBUNDLE TRUE CACHE TYPE BOOL)
69
ENDIF (APPLE AND BUILD_OSX_BUNDLE)
70
 
71
#Announce we cached a version request before, overridden below for OSX
9508 cbradney 72
IF(TAG_VERSION)
9680 cbradney 73
  IF (NOT APPLEBUNDLE)
74
    MESSAGE(STATUS "Previously selected version tag: ${TAG_VERSION}")
75
  ENDIF (NOT APPLEBUNDLE)
6891 cbradney 76
  SET(WANT_VERSIONING 1)
77
  SET(CACHED_VERSIONING 1)
9508 cbradney 78
ENDIF(TAG_VERSION)
79
 
9680 cbradney 80
#Remove version tags on OSX so our bundle is Scribus.app
81
IF (APPLEBUNDLE)
82
  IF (WANT_VERSIONING OR CACHED_VERSIONING)
83
    MESSAGE(STATUS "Ignoring version tag on OSX when building bundle")
84
    SET(WANT_VERSIONING 0)
85
    SET(CACHED_VERSIONING 0)
86
  ENDIF (WANT_VERSIONING OR CACHED_VERSIONING)
87
ENDIF (APPLEBUNDLE)
9508 cbradney 88
 
9680 cbradney 89
#Store our version string if require
6891 cbradney 90
IF (WANT_VERSIONING AND NOT CACHED_VERSIONING)
5396 cbradney 91
  IF (NOT CUSTOM_VERSIONTAG)
6891 cbradney 92
    SET(TAG_VERSION "-${VERSION}" CACHE TYPE STRING)
5396 cbradney 93
  ELSE (NOT CUSTOM_VERSIONTAG)
6891 cbradney 94
    SET(TAG_VERSION ${CUSTOM_VERSIONTAG} CACHE TYPE STRING)
5396 cbradney 95
  ENDIF (NOT CUSTOM_VERSIONTAG)
6891 cbradney 96
ENDIF (WANT_VERSIONING AND NOT CACHED_VERSIONING)
5379 cbradney 97
 
9680 cbradney 98
#Setp all the directories we will use
7269 cbradney 99
#MAN
100
SET(MANDIR "share/man/")
6893 cbradney 101
SET(SHAREDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/")
5142 cbradney 102
ADD_DEFINITIONS("-DSHAREDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SHAREDIR}\\\"")
9680 cbradney 103
 
9409 cbradney 104
#SHARE - use the default on Apple as TAG_VERSION is empty
105
IF(TAG_VERSION OR BUILD_OSX_BUNDLE)
7269 cbradney 106
  SET(DOCDIR "share/doc/${MAIN_DIR_NAME}${TAG_VERSION}/")
9409 cbradney 107
ELSE(TAG_VERSION OR BUILD_OSX_BUNDLE)
7269 cbradney 108
  SET(DOCDIR "share/doc/${MAIN_DIR_NAME}-${VERSION}/")
9409 cbradney 109
ENDIF (TAG_VERSION OR BUILD_OSX_BUNDLE)
5142 cbradney 110
ADD_DEFINITIONS("-DDOCDIR=\\\"${CMAKE_INSTALL_PREFIX}/${DOCDIR}\\\"")
9680 cbradney 111
 
7269 cbradney 112
#ICON
5379 cbradney 113
SET(ICONDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/icons/")
5142 cbradney 114
ADD_DEFINITIONS("-DICONDIR=\\\"${CMAKE_INSTALL_PREFIX}/${ICONDIR}\\\"")
9680 cbradney 115
 
7269 cbradney 116
#SAMPLES
5379 cbradney 117
SET(SAMPLESDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/samples/")
5142 cbradney 118
ADD_DEFINITIONS("-DSAMPLESDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SAMPLESDIR}\\\"")
9680 cbradney 119
 
7269 cbradney 120
#SCRIPTS
5379 cbradney 121
SET(SCRIPTSDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/scripts/")
5142 cbradney 122
ADD_DEFINITIONS("-DSCRIPTSDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SCRIPTSDIR}\\\"")
9680 cbradney 123
 
7269 cbradney 124
#TEMPLATES
5379 cbradney 125
SET(TEMPLATEDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/templates/")
5142 cbradney 126
ADD_DEFINITIONS("-DTEMPLATEDIR=\\\"${CMAKE_INSTALL_PREFIX}/${TEMPLATEDIR}\\\"")
9680 cbradney 127
 
9660 cbradney 128
#DESKTOP
9653 mrdocs 129
SET(DESKTOPDIR "share/applications/")
130
ADD_DEFINITIONS("-DDESKTOPDIR=\\\"${CMAKE_INSTALL_PREFIX}/${DESKTOPDIR}\\\"")
9680 cbradney 131
 
7269 cbradney 132
#LIB
5379 cbradney 133
SET(LIBDIR "lib/${MAIN_DIR_NAME}${TAG_VERSION}/")
5142 cbradney 134
ADD_DEFINITIONS("-DLIBDIR=\\\"${CMAKE_INSTALL_PREFIX}/${LIBDIR}\\\"")
9680 cbradney 135
 
7269 cbradney 136
#PLUGINS
5379 cbradney 137
SET(PLUGINDIR "lib/${MAIN_DIR_NAME}${TAG_VERSION}/plugins/")
5142 cbradney 138
ADD_DEFINITIONS("-DPLUGINDIR=\\\"${CMAKE_INSTALL_PREFIX}/${PLUGINDIR}\\\"")
9680 cbradney 139
 
9660 cbradney 140
#INCLUDE
141
SET(INCLUDEDIR "include/${MAIN_DIR_NAME}${TAG_VERSION}/")
142
#NO ADD DEFINITIONS, WE ONLY INSTALL WITH IT
9680 cbradney 143
 
7269 cbradney 144
#RPATH
5142 cbradney 145
set(CMAKE_INSTALL_RPATH ${PLUGINDIR})
146
 
6319 mrdocs 147
# Set the XDG mime stuff
6320 mrdocs 148
SET(MIMEDIR "share/mime/packages/")
6319 mrdocs 149
 
150
 
5142 cbradney 151
#BUILD SETUP
9680 cbradney 152
#Convert our simpler command line option to the CMake style
5142 cbradney 153
#None, Debug, Release, .. or custom ones
7943 cbradney 154
# SET(WANT_DEBUG 1)
5142 cbradney 155
IF(WANT_DEBUG)
156
  SET(CMAKE_BUILD_TYPE Debug)
157
ELSE(WANT_DEBUG)
158
  SET(CMAKE_BUILD_TYPE RELEASE)
159
ENDIF(WANT_DEBUG)
160
 
9680 cbradney 161
#Based on our build type, setup our build options
5468 avox 162
IF(APPLE)
163
  SET( ENV{MACOSX_DEPLOYMENT_TARGET} 10.3 )
164
  SET( ENV{LD_PREBIND} 1 )
165
  SET( ENV{LD_PREBIND_ALLOW_OVERLAP} 1 )
166
  SET(CMAKE_CXX_FLAGS_DEBUG "-O2 -g3 -fno-inline-functions -Wall")
167
  SET(CMAKE_C_FLAGS_DEBUG "-O2 -g3 -fno-inline-functions -Wall")
168
ELSE(APPLE)
8499 cbradney 169
  SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -Wall -fstrict-aliasing")
170
  SET(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -Wall -fstrict-aliasing")
5468 avox 171
ENDIF(APPLE)
9680 cbradney 172
 
5271 mrdocs 173
SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall")
174
SET(CMAKE_C_FLAGS_RELEASE "-O2 -Wall")
5142 cbradney 175
 
9680 cbradney 176
#Test for endianess
5466 cbradney 177
INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
5467 avox 178
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
5466 cbradney 179
 
9680 cbradney 180
 
181
 
5142 cbradney 182
#FIND DEPENDENCIES
9680 cbradney 183
 
184
#<< Qt
5142 cbradney 185
SET (QT_MT_REQUIRED true)
8499 cbradney 186
SET (QT_MIN_VERSION "4.1.0")
8502 cbradney 187
SET( QT_USE_QT3SUPPORT TRUE)
188
SET( QT_USE_QTXML TRUE )
9409 cbradney 189
IF (APPLE)
190
  SET( QT_USE_QTSQL TRUE )
191
ENDIF (APPLE)
192
SET( QT_USE_QTNETWORK TRUE )
8499 cbradney 193
FIND_PACKAGE(Qt4 REQUIRED)
194
INCLUDE( ${QT_USE_FILE} )
5142 cbradney 195
IF (QT_FOUND)
9680 cbradney 196
  MESSAGE("Qt4 Found OK")
197
  #Add our Qt definitions
198
  ADD_DEFINITIONS(
199
    ${QT_DEFINITIONS}
200
    -DQT_CORE_LIB
201
    -DQT_GUI_LIB
202
    -DQT_THREAD_LIB
203
    -DQT_XML_LIB
204
  )
5142 cbradney 205
ELSE(QT_FOUND)
9680 cbradney 206
  MESSAGE(FATAL_ERROR "No Qt4 found")
5142 cbradney 207
ENDIF(QT_FOUND)
9680 cbradney 208
#>> Qt
209
 
210
#<< PNG, JPEG, TIFF
5142 cbradney 211
FIND_PACKAGE(PNG REQUIRED)
212
IF (PNG_FOUND)
213
  MESSAGE("PNG Library Found OK")
214
ENDIF(PNG_FOUND)
215
FIND_PACKAGE(JPEG REQUIRED)
216
IF (JPEG_FOUND)
217
  MESSAGE("JPEG Library Found OK")
218
ENDIF(JPEG_FOUND)
219
FIND_PACKAGE(TIFF REQUIRED)
220
IF (TIFF_FOUND)
221
  MESSAGE("TIFF Library Found OK")
222
  SET(HAVE_TIFF 1)
6211 cbradney 223
ELSE(TIFF_FOUND)
224
  MESSAGE(FATAL_ERROR "Could not find the TIFF Library")
5142 cbradney 225
ENDIF(TIFF_FOUND)
226
FIND_PACKAGE(ZLIB REQUIRED)
227
IF (ZLIB_FOUND)
228
  MESSAGE("ZLIB Library Found OK")
229
  SET(HAVE_LIBZ 1)
230
ENDIF(ZLIB_FOUND)
231
FIND_PACKAGE(PythonLibs REQUIRED)
232
IF (PYTHON_LIBRARY)
233
  MESSAGE("Python Library Found OK")
234
  SET(HAVE_PYTHON 1)
235
  SET(COMPILE_PYTHON 1)
236
ENDIF(PYTHON_LIBRARY)
9680 cbradney 237
#>> PNG, JPEG, TIFF
5142 cbradney 238
 
9680 cbradney 239
#<< FreeType2
5142 cbradney 240
SET(FREETYPE_DIR ${CMAKE_MODULE_PATH})
241
FIND_PACKAGE(FREETYPE REQUIRED)
242
IF (FREETYPE_FOUND)
243
  MESSAGE("FreeType2 Library Found OK")
8499 cbradney 244
  INCLUDE(CheckLibraryExists)
5170 cbradney 245
  CHECK_LIBRARY_EXISTS(libfreetype.so FT_Get_First_Char "" HAVE_FREETYPE_FIRST)
246
  CHECK_LIBRARY_EXISTS(libfreetype.so FT_Get_Next_Char "" HAVE_FREETYPE_NEXT)
5142 cbradney 247
ENDIF(FREETYPE_FOUND)
248
#FIXME: if cflags empty add, otherwise replace as now
249
SET(CFLAGS "${LIBFREETYPE_CFLAGS}")
9680 cbradney 250
#>> FreeType2
5142 cbradney 251
 
9680 cbradney 252
#<<Render Library
253
# Select our rendering library
254
# As of Scribus 1.3.5, we can use cairo or Qt4's Arthur
7013 cbradney 255
# If we have a RENDER_LIB selected from a previous cmake run, then use it
256
# otherwise, we should be defaulting to Libart_LGPL for 1.3.4.x
6686 cbradney 257
IF(RENDER_LIB)
258
  MESSAGE(STATUS "Previously selected rendering system: ${RENDER_LIB}")
7013 cbradney 259
ELSE(RENDER_LIB)
260
  IF (NOT WANT_CAIRO)
9680 cbradney 261
    SET(WANT_QTARTHUR 1)
7013 cbradney 262
  ENDIF (NOT WANT_CAIRO)
6686 cbradney 263
ENDIF(RENDER_LIB)
7013 cbradney 264
 
9680 cbradney 265
IF (WANT_CAIRO OR RENDER_LIB STREQUAL "CAIRO")
266
  SET(CAIRO_DIR ${CMAKE_MODULE_PATH})
267
  FIND_PACKAGE(CAIRO)
268
  IF(CAIRO_FOUND)
5142 cbradney 269
    MESSAGE("CAIRO Library Found OK")
6686 cbradney 270
    SET(RENDER_LIB "CAIRO" CACHE TYPE STRING)
9680 cbradney 271
  ELSE(CAIRO_FOUND)
272
    SET(OLDRENDERLIBLOST TRUE)
273
  ENDIF(CAIRO_FOUND)
274
ENDIF (WANT_CAIRO OR RENDER_LIB STREQUAL "CAIRO")
5142 cbradney 275
 
9680 cbradney 276
IF (OLDRENDERLIBLOST OR WANT_QTARTHUR OR RENDER_LIB STREQUAL "QTARTHUR" OR NOT RENDER_LIB)
277
  SET(RENDER_LIB "QTARTHUR" CACHE TYPE STRING)
278
  MESSAGE("Qt4's Arthur selected for renderer")
279
  IF (OLDRENDERLIBLOST)
280
    MESSAGE("CAIRO could no longer be found, replaced by Qt4's Arthur")
281
  ENDIF (OLDRENDERLIBLOST)
282
ENDIF (OLDRENDERLIBLOST OR WANT_QTARTHUR OR RENDER_LIB STREQUAL "QTARTHUR" OR NOT RENDER_LIB)
283
#>>Render Library
284
 
285
#<<CUPS
7239 cbradney 286
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
7202 cbradney 287
  SET(Cups_DIR ${CMAKE_MODULE_PATH})
7239 cbradney 288
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
7202 cbradney 289
FIND_PACKAGE(Cups REQUIRED)
5142 cbradney 290
IF(CUPS_FOUND)
291
  SET(HAVE_CUPS 1)
292
  MESSAGE("CUPS Library Found OK")
293
ENDIF(CUPS_FOUND)
9680 cbradney 294
#>>CUPS
5142 cbradney 295
 
9680 cbradney 296
#<<LibXML2
7203 cbradney 297
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
298
  SET(LibXml2_DIR ${CMAKE_MODULE_PATH})
299
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.5)
300
FIND_PACKAGE(LibXml2 REQUIRED)
5142 cbradney 301
IF(LIBXML2_FOUND)
302
  SET(HAVE_XML 1)
303
  MESSAGE("LIBXML2 Library Found OK")
304
ENDIF(LIBXML2_FOUND)
9680 cbradney 305
#>>LibXML2
5142 cbradney 306
 
9680 cbradney 307
#<<LittleCMS
5142 cbradney 308
SET(LCMS_DIR ${CMAKE_MODULE_PATH})
309
FIND_PACKAGE(LCMS REQUIRED)
310
IF(LCMS_FOUND)
311
  SET(HAVE_CMS 1)
312
  SET(CMS_INC "lcms.h")
6553 cbradney 313
  MESSAGE("LittleCMS Library Found OK")
314
ELSE(LCMS_FOUND)
315
  MESSAGE(FATAL_ERROR "Could not find the LittleCMS Library")
5142 cbradney 316
ENDIF(LCMS_FOUND)
9680 cbradney 317
#>>LittleCMS
5142 cbradney 318
 
9680 cbradney 319
#<<FontConfig
5142 cbradney 320
SET(FONTCONFIG_DIR ${CMAKE_MODULE_PATH})
321
FIND_PACKAGE(FONTCONFIG)
322
IF(FONTCONFIG_FOUND)
323
	MESSAGE("FontConfig Found OK")
324
	SET(HAVE_FONTCONFIG 1)
325
ENDIF(FONTCONFIG_FOUND)
9680 cbradney 326
#>>FontConfig
5142 cbradney 327
 
9680 cbradney 328
#<<Test for existing include files
8499 cbradney 329
INCLUDE(CheckIncludeFile)
330
 
5142 cbradney 331
CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
332
IF(HAVE_DLFCN_H)
333
  ADD_DEFINITIONS(-DHAVE_DLFCN_H)
334
ENDIF(HAVE_DLFCN_H)
335
 
336
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
337
IF(HAVE_UNISTD_H)
338
  ADD_DEFINITIONS(-DHAVE_UNISTD_H)
339
ENDIF(HAVE_UNISTD_H)
340
 
341
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
342
# IF(HAVE_SYS_TYPES_H)
343
#   ADD_DEFINITIONS(-DHAVE_SYS_TYPES_H)
344
# ENDIF(HAVE_SYS_TYPES_H)
345
 
346
CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
347
# IF(HAVE_SYS_STAT_H)
348
#   ADD_DEFINITIONS(-DHAVE_SYS_STAT_H)
349
# ENDIF(HAVE_SYS_STAT_H)
9680 cbradney 350
#>>Test for existing include files
5142 cbradney 351
 
352
 
5150 cbradney 353
#Create configure files.. config.h and uninstall
354
#config.h
5142 cbradney 355
INCLUDE (ConfigureChecks.cmake)
356
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
357
ADD_DEFINITIONS("-DHAVE_CONFIG_H")
9680 cbradney 358
 
359
#Set up uninstall
5150 cbradney 360
CONFIGURE_FILE(
361
  "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
362
  "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
9680 cbradney 363
  IMMEDIATE @ONLY
364
)
5142 cbradney 365
 
5150 cbradney 366
ADD_CUSTOM_TARGET(uninstall
367
  "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
368
 
5157 cbradney 369
#Set up include dirs with all found packages
5142 cbradney 370
INCLUDE_DIRECTORIES(
9680 cbradney 371
  ${CMAKE_BINARY_DIR}
372
  ${CMAKE_BINARY_DIR}/scribus
373
  ${QT_INCLUDES}
374
  ${CUPS_INCLUDE_DIR}
375
  ${FREETYPE_INCLUDE_DIR}
376
  ${FONTCONFIG_INCLUDE_DIR}
9712 avox 377
  ${JPEG_INCLUDE_DIR}
9680 cbradney 378
  ${LCMS_INCLUDE_DIR}
379
  ${LIBXML2_INCLUDE_DIR}
380
  ${PYTHON_INCLUDE_PATH}
381
  ${TIFF_INCLUDE_DIR}
382
  ${ZLIB_INCLUDE_DIR}
5142 cbradney 383
)
384
 
5157 cbradney 385
#Add our source subdirs
5142 cbradney 386
ADD_SUBDIRECTORY(scribus)
387
 
5157 cbradney 388
#Install our READMEs etc.
5142 cbradney 389
INSTALL(FILES
9386 cbradney 390
  AUTHORS
391
  BUILDING
392
  ChangeLog
393
  ChangeLogCVS
394
  COPYING
395
  INSTALL
396
  NEWS
397
  PACKAGING
398
  README
399
  README.MacOSX
400
  TODO
5142 cbradney 401
  DESTINATION ${DOCDIR}
402
)
9386 cbradney 403
 
9680 cbradney 404
#Install our MIME data
6319 mrdocs 405
INSTALL(FILES
9386 cbradney 406
  scribus.xml
407
  DESTINATION ${MIMEDIR}
6319 mrdocs 408
)
5396 cbradney 409
 
9680 cbradney 410
#Install the desktop file
9653 mrdocs 411
INSTALL(FILES
412
  scribus.desktop
413
  DESTINATION ${DESKTOPDIR}
414
)
9680 cbradney 415
 
416
#If building an Apple bundle, install these specific files
417
IF(APPLEBUNDLE)
9386 cbradney 418
  INSTALL(FILES
9680 cbradney 419
    Scribus.app/Contents/Info.plist
420
    DESTINATION ${CMAKE_INSTALL_PREFIX}
9386 cbradney 421
  )
422
  INSTALL(FILES
9680 cbradney 423
    Scribus.app/Contents/Resources/Scribus.icns
424
    Scribus.app/Contents/Resources/Scribus-doc.icns
425
    DESTINATION ${CMAKE_INSTALL_PREFIX}/Resources
9386 cbradney 426
  )
9680 cbradney 427
ENDIF(APPLEBUNDLE)
9386 cbradney 428
 
9680 cbradney 429
# If the cmake version includes cpack, use it for tarball building
5396 cbradney 430
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
431
  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Scribus is an open source publishing application for Linux, Mac OSX and Windows")
432
  SET(CPACK_PACKAGE_VENDOR "Scribus Team")
433
  SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
434
  SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README")
435
  SET(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
436
  SET(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
437
  SET(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
5407 cbradney 438
  SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Scribus ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
5396 cbradney 439
  SET(CPACK_PACKAGE_EXECUTABLES "scribus${TAG_VERSION}")
7392 mrdocs 440
  SET(CPACK_SOURCE_PACKAGE_FILE_NAME "scribus-${VERSION}")
5407 cbradney 441
  SET(CPACK_SOURCE_GENERATOR TBZ2)
9680 cbradney 442
 
443
  SET(CPACK_SOURCE_IGNORE_FILES
444
    CMakeCache.txt
445
    scribus-1.3.5cvs.tar.bz2
446
    scribus-1.3.5cvs.tar.Z
447
    scribus-1.3.5cvs.tar.gz
448
    "~$"
449
    "\\\\.cvsignore$"
450
    "\\\\.o$"
451
    "^${PROJECT_SOURCE_DIR}.*/CVS/"
452
    "^${PROJECT_SOURCE_DIR}/debian/"
453
    "^${PROJECT_SOURCE_DIR}/old/"
454
    "^${PROJECT_SOURCE_DIR}.*/CVSROOT/"
455
    "^${PROJECT_SOURCE_DIR}/admin/"
456
  )
5396 cbradney 457
  INCLUDE(CPack)
5463 avox 458
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")