Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
6961 avox 1
#CMAKE SETUP
2
#Require 2.4.2 for Qt finding
3
#Require 2.4.3 for moc change detection
4
#Require 2.4.3 for rpath updates for custom cairo install
7238 cbradney 5
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.3 FATAL_ERROR)
6961 avox 6
 
7
SET(CMAKE_COLOR_MAKEFILE ON)
11097 cbradney 8
SET(CMAKE_VERBOSE_MAKEFILE OFF)
6961 avox 9
SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)
10
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
11
#SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
12
#SET(CMAKE_SKIP_RPATH:BOOL NO)
13
SET(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
14
 
15
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
16
# SET(CMAKE_SHARED_MODULE_LINK_FLAGS "${CMAKE_SHARED_MODULE_LINK_FLAGS} -export-dynamic")
17
# SET(CMAKE_SHARED_MODULE_LINK_CXX_FLAGS "${CMAKE_SHARED_MODULE_LINK_CXX_FLAGS} -export-dynamic")
18
# SET(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -export-dynamic")
19
# SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -export-dynamic")
20
# MESSAGE(STATUS ${CMAKE_SHARED_MODULE_LINK_FLAGS})
21
# MESSAGE(STATUS ${CMAKE_SHARED_MODULE_LINK_CXX_FLAGS})
22
# MESSAGE(STATUS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
23
# MESSAGE(STATUS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
24
# MESSAGE(STATUS ${CMAKE_CXX_CREATE_SHARED_MODULE})
25
# MESSAGE(STATUS ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
26
 
27
#IMPORT FROM COMMANDLINE
28
# SET with cmake -DWANT_CAIRO=1, etc
29
# MESSAGE(STATUS ${WANT_CAIRO})
30
# MESSAGE(STATUS ${WANT_LIBART})
31
# MESSAGE(STATUS ${WANT_DEBUG})
32
 
33
# SET(WANT_CAIRO 0)
34
# SET(WANT_LIBART 1)
35
 
36
#PROJECT SETUP
37
PROJECT(scribus)
38
SET (VERSION_MAJOR "1")
39
SET (VERSION_MINOR "3")
9332 mrdocs 40
SET (VERSION_PATCH "3.10")
11372 mrdocs 41
SET (VERSION_SUFFIX "")
6961 avox 42
SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX})
43
MESSAGE(STATUS "Scribus ${VERSION} will be built to install into ${CMAKE_INSTALL_PREFIX}")
44
 
45
SET(PLUGIN_PERMISSIONS WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE WORLD_READ GROUP_READ OWNER_READ OWNER_WRITE)
46
 
47
SET(MAIN_DIR_NAME "scribus")
11351 cbradney 48
 
49
##############################################################################################################
50
########## check for the CPU we build for                                                           ##########
51
 
52
EXECUTE_PROCESS(
53
    COMMAND ${CMAKE_C_COMPILER} -dumpmachine
54
    OUTPUT_VARIABLE MACHINE
55
    OUTPUT_STRIP_TRAILING_WHITESPACE
56
)
57
MESSAGE(STATUS "Building for target ${MACHINE}")
58
 
59
STRING(REGEX MATCH "(i?86-*)|(athlon-*)|(pentium-*)" _machine_x86 "${MACHINE}")
60
IF (_machine_x86)
61
    MESSAGE(STATUS "Found target X86")
62
    SET(ARCH_X86 1)
63
ENDIF (_machine_x86)
64
 
65
STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _machine_x86_64 "${MACHINE}")
66
IF (_machine_x86_64)
67
    MESSAGE(STATUS "Found target X86_64")
68
    SET(ARCH_X86_64 1)
69
ENDIF (_machine_x86_64)
70
 
71
STRING(REGEX MATCH "(ppc-*)" _machine_ppc "${MACHINE}")
72
IF (_machine_ppc)
73
    MESSAGE(STATUS "Found target PPC")
74
    SET(ARCH_PPC 1)
75
ENDIF (_machine_ppc)
76
 
77
##############################################################################################################
78
########## Versioning Setup                                                                         ##########
79
 
6964 cbradney 80
IF(TAG_VERSION)
81
  MESSAGE(STATUS "Previously selected version tag: ${TAG_VERSION}")
82
  SET(WANT_VERSIONING 1)
83
  SET(CACHED_VERSIONING 1)
84
ENDIF(TAG_VERSION)
85
IF (WANT_VERSIONING AND NOT CACHED_VERSIONING)
6961 avox 86
  IF (NOT CUSTOM_VERSIONTAG)
6964 cbradney 87
    SET(TAG_VERSION "-${VERSION}" CACHE TYPE STRING)
6961 avox 88
  ELSE (NOT CUSTOM_VERSIONTAG)
6964 cbradney 89
    SET(TAG_VERSION ${CUSTOM_VERSIONTAG} CACHE TYPE STRING)
6961 avox 90
  ENDIF (NOT CUSTOM_VERSIONTAG)
6964 cbradney 91
ENDIF (WANT_VERSIONING AND NOT CACHED_VERSIONING)
6961 avox 92
 
7268 cbradney 93
#MAN
94
SET(MANDIR "share/man/")
6964 cbradney 95
SET(SHAREDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/")
6961 avox 96
ADD_DEFINITIONS("-DSHAREDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SHAREDIR}\\\"")
7268 cbradney 97
#SHARE
98
IF(TAG_VERSION)
99
  SET(DOCDIR "share/doc/${MAIN_DIR_NAME}${TAG_VERSION}/")
100
ELSE(TAG_VERSION)
101
  SET(DOCDIR "share/doc/${MAIN_DIR_NAME}-${VERSION}/")
102
ENDIF (TAG_VERSION)
103
ADD_DEFINITIONS("-DSHAREDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SHAREDIR}\\\"")
6961 avox 104
SET(DOCDIR "share/doc/${MAIN_DIR_NAME}${TAG_VERSION}/")
105
ADD_DEFINITIONS("-DDOCDIR=\\\"${CMAKE_INSTALL_PREFIX}/${DOCDIR}\\\"")
106
SET(ICONDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/icons/")
107
ADD_DEFINITIONS("-DICONDIR=\\\"${CMAKE_INSTALL_PREFIX}/${ICONDIR}\\\"")
108
SET(SAMPLESDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/samples/")
109
ADD_DEFINITIONS("-DSAMPLESDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SAMPLESDIR}\\\"")
110
SET(SCRIPTSDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/scripts/")
111
ADD_DEFINITIONS("-DSCRIPTSDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SCRIPTSDIR}\\\"")
112
SET(TEMPLATEDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/templates/")
113
ADD_DEFINITIONS("-DTEMPLATEDIR=\\\"${CMAKE_INSTALL_PREFIX}/${TEMPLATEDIR}\\\"")
10214 mrdocs 114
 
10909 mrdocs 115
 
116
#DESKTOP backport from 1.3.5
117
SET(DESKTOPDIR "share/applications/")
118
ADD_DEFINITIONS("-DDESKTOPDIR=\\\"${CMAKE_INSTALL_PREFIX}/${DESKTOPDIR}\\\"")
119
 
10214 mrdocs 120
#LIB LOCATION - lib or lib64 normally
121
#LIB
122
IF(WANT_LIB64)
11350 cbradney 123
  IF(NOT ARCH_X86_64)
124
    MESSAGE(STATUS "WARNING: BUILDING 64 Bit build on non 64 bit architecture")
125
  ENDIF(NOT ARCH_X86_64)
126
  SET(LIB_SUFFIX "64" CACHE TYPE STRING)
10214 mrdocs 127
ENDIF(WANT_LIB64)
11351 cbradney 128
SET(LIB_DIR_NAME "lib${LIB_SUFFIX}")
10214 mrdocs 129
SET(LIBDIR "${LIB_DIR_NAME}/${MAIN_DIR_NAME}${TAG_VERSION}/")
6961 avox 130
ADD_DEFINITIONS("-DLIBDIR=\\\"${CMAKE_INSTALL_PREFIX}/${LIBDIR}\\\"")
10214 mrdocs 131
 
132
#PLUGINS
133
SET(PLUGINDIR "${LIB_DIR_NAME}/${MAIN_DIR_NAME}${TAG_VERSION}/plugins/")
6961 avox 134
ADD_DEFINITIONS("-DPLUGINDIR=\\\"${CMAKE_INSTALL_PREFIX}/${PLUGINDIR}\\\"")
135
 
10214 mrdocs 136
# older version
137
#SET(LIBDIR "lib/${MAIN_DIR_NAME}${TAG_VERSION}/")
138
#ADD_DEFINITIONS("-DLIBDIR=\\\"${CMAKE_INSTALL_PREFIX}/${LIBDIR}\\\"")
139
#SET(PLUGINDIR "lib/${MAIN_DIR_NAME}${TAG_VERSION}/plugins/")
140
#ADD_DEFINITIONS("-DPLUGINDIR=\\\"${CMAKE_INSTALL_PREFIX}/${PLUGINDIR}\\\"")
141
#set(CMAKE_INSTALL_RPATH ${PLUGINDIR})
142
 
6961 avox 143
# Set the XDG mime stuff
144
SET(MIMEDIR "share/mime/packages/")
145
 
146
 
147
#BUILD SETUP
148
#None, Debug, Release, .. or custom ones
8342 cbradney 149
#SET(WANT_DEBUG 1)
6961 avox 150
IF(WANT_DEBUG)
151
  SET(CMAKE_BUILD_TYPE Debug)
152
ELSE(WANT_DEBUG)
153
  SET(CMAKE_BUILD_TYPE RELEASE)
154
ENDIF(WANT_DEBUG)
155
 
156
IF(APPLE)
157
  SET( ENV{MACOSX_DEPLOYMENT_TARGET} 10.3 )
158
  SET( ENV{LD_PREBIND} 1 )
159
  SET( ENV{LD_PREBIND_ALLOW_OVERLAP} 1 )
160
  SET(CMAKE_CXX_FLAGS_DEBUG "-O2 -g3 -fno-inline-functions -Wall")
161
  SET(CMAKE_C_FLAGS_DEBUG "-O2 -g3 -fno-inline-functions -Wall")
162
  SET(BUILD_MAC_BUNDLE 1)
163
ELSE(APPLE)
164
  SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -Wall")
165
  SET(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -Wall")
166
ENDIF(APPLE)
167
SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall")
168
SET(CMAKE_C_FLAGS_RELEASE "-O2 -Wall")
169
 
170
 
171
INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
172
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
173
 
174
#FIND DEPENDENCIES
175
# START QT
176
SET (QT_MT_REQUIRED true)
177
SET (QT_MIN_VERSION "3.3.4")
178
FIND_PACKAGE(Qt3 REQUIRED)
179
IF (QT_FOUND)
180
  MESSAGE("Qt3 Found OK (${qt_version_str})")
181
#   MESSAGE("$ENV{QTDIR}")
182
#   MESSAGE("${QT_MOC_EXECUTABLE}")
183
#   MESSAGE("${QT_UIC_EXECUTABLE}")
184
#   MESSAGE("${QT_QT_LIBRARY}")
185
#   MESSAGE("${QT_INCLUDE_DIR}")
186
#   MESSAGE("${qt_version_str}")
187
#   MESSAGE(${qt_version_str_lib})
188
ELSE(QT_FOUND)
189
  MESSAGE(FATAL_ERROR "No Qt3")
190
ENDIF(QT_FOUND)
191
# END QT
192
# START PNG, JPEG, TIFF
193
FIND_PACKAGE(PNG REQUIRED)
194
IF (PNG_FOUND)
195
  MESSAGE("PNG Library Found OK")
196
ENDIF(PNG_FOUND)
197
FIND_PACKAGE(JPEG REQUIRED)
198
IF (JPEG_FOUND)
199
  MESSAGE("JPEG Library Found OK")
200
ENDIF(JPEG_FOUND)
201
FIND_PACKAGE(TIFF REQUIRED)
202
IF (TIFF_FOUND)
203
  MESSAGE("TIFF Library Found OK")
204
  SET(HAVE_TIFF 1)
205
ELSE(TIFF_FOUND)
206
  MESSAGE(FATAL_ERROR "Could not find the TIFF Library")
207
ENDIF(TIFF_FOUND)
208
FIND_PACKAGE(ZLIB REQUIRED)
209
IF (ZLIB_FOUND)
210
  MESSAGE("ZLIB Library Found OK")
211
  SET(HAVE_LIBZ 1)
212
ENDIF(ZLIB_FOUND)
213
FIND_PACKAGE(PythonLibs REQUIRED)
214
IF (PYTHON_LIBRARY)
215
  MESSAGE("Python Library Found OK")
216
  SET(HAVE_PYTHON 1)
217
  SET(COMPILE_PYTHON 1)
218
ENDIF(PYTHON_LIBRARY)
219
 
220
# START FREETYPE
221
SET(FREETYPE_DIR ${CMAKE_MODULE_PATH})
222
FIND_PACKAGE(FREETYPE REQUIRED)
223
IF (FREETYPE_FOUND)
224
  MESSAGE("FreeType2 Library Found OK")
225
  CHECK_LIBRARY_EXISTS(libfreetype.so FT_Get_First_Char "" HAVE_FREETYPE_FIRST)
226
  CHECK_LIBRARY_EXISTS(libfreetype.so FT_Get_Next_Char "" HAVE_FREETYPE_NEXT)
227
ENDIF(FREETYPE_FOUND)
228
#FIXME: if cflags empty add, otherwise replace as now
229
SET(CFLAGS "${LIBFREETYPE_CFLAGS}")
230
# END FREETYPE
231
 
7014 cbradney 232
# If we have a RENDER_LIB selected from a previous cmake run, then use it
233
# otherwise, we should be defaulting to Libart_LGPL for 1.3.3.x
6961 avox 234
IF(RENDER_LIB)
235
  MESSAGE(STATUS "Previously selected rendering system: ${RENDER_LIB}")
7014 cbradney 236
ELSE(RENDER_LIB)
237
  IF (NOT WANT_CAIRO)
238
    SET(WANT_LIBART 1)
239
  ENDIF (NOT WANT_CAIRO)
6961 avox 240
ENDIF(RENDER_LIB)
7014 cbradney 241
 
242
# START LIBART_LGPL
6961 avox 243
IF (WANT_LIBART OR RENDER_LIB STREQUAL "LIBART")
244
  SET(LIBART_LGPL_DIR ${CMAKE_MODULE_PATH})
245
  FIND_PACKAGE(LIBART_LGPL REQUIRED)
246
  IF(LIBART_LGPL_FOUND)
247
    SET(RENDER_LIB "LIBART" CACHE TYPE STRING)
248
    MESSAGE("Libart_LGPL Library Found OK")
249
  ELSE(LIBART_LGPL_FOUND)
250
    SET(OLDRENDERLIBLOST TRUE)
251
  ENDIF(LIBART_LGPL_FOUND)
252
ELSE (WANT_LIBART OR RENDER_LIB STREQUAL "LIBART")
253
  # START CAIRO
254
  SET(CAIRO_DIR ${CMAKE_MODULE_PATH})
255
  FIND_PACKAGE(CAIRO)
256
  IF(CAIRO_FOUND)
257
    MESSAGE("CAIRO Library Found OK")
258
    SET(RENDER_LIB "CAIRO" CACHE TYPE STRING)
259
  ELSE(CAIRO_FOUND)
260
    SET(OLDRENDERLIBLOST TRUE)
261
  ENDIF(CAIRO_FOUND)
262
  # END CAIRO
263
ENDIF (WANT_LIBART OR RENDER_LIB STREQUAL "LIBART")
264
# END LIBART_LGPL
265
 
266
IF(NOT RENDER_LIB OR OLDRENDERLIBLOST)
267
  MESSAGE(FATAL_ERROR "ERROR: Neither LibArt_LGPL nor cairo have been selected or found, please correct and restart cmake")
268
ENDIF(NOT RENDER_LIB OR OLDRENDERLIBLOST)
269
 
270
 
271
# START CUPS
272
SET(CUPS_DIR ${CMAKE_MODULE_PATH})
273
FIND_PACKAGE(CUPS REQUIRED)
274
IF(CUPS_FOUND)
275
  SET(HAVE_CUPS 1)
276
  MESSAGE("CUPS Library Found OK")
277
ENDIF(CUPS_FOUND)
278
# END CUPS
279
 
280
# START LIBXML2
281
SET(LIBXML2_DIR ${CMAKE_MODULE_PATH})
282
FIND_PACKAGE(LIBXML2 REQUIRED)
283
IF(LIBXML2_FOUND)
284
  SET(HAVE_XML 1)
285
  MESSAGE("LIBXML2 Library Found OK")
286
ENDIF(LIBXML2_FOUND)
287
# END LIBXML2
288
 
289
# START LCMS
290
SET(LCMS_DIR ${CMAKE_MODULE_PATH})
291
FIND_PACKAGE(LCMS REQUIRED)
292
IF(LCMS_FOUND)
293
  SET(HAVE_CMS 1)
294
  SET(CMS_INC "lcms.h")
295
  MESSAGE("LittleCMS Library Found OK")
296
ELSE(LCMS_FOUND)
297
  MESSAGE(FATAL_ERROR "Could not find the LittleCMS Library")
298
ENDIF(LCMS_FOUND)
299
# END LCMS
300
 
301
# START FONTCONFIG
302
SET(FONTCONFIG_DIR ${CMAKE_MODULE_PATH})
303
FIND_PACKAGE(FONTCONFIG)
304
IF(FONTCONFIG_FOUND)
305
	MESSAGE("FontConfig Found OK")
306
	SET(HAVE_FONTCONFIG 1)
307
ENDIF(FONTCONFIG_FOUND)
308
# END FONTCONFIG
309
 
310
ADD_DEFINITIONS(${QT_DEFINITIONS})
311
 
312
CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
313
IF(HAVE_DLFCN_H)
314
  ADD_DEFINITIONS(-DHAVE_DLFCN_H)
315
ENDIF(HAVE_DLFCN_H)
316
 
317
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
318
IF(HAVE_UNISTD_H)
319
  ADD_DEFINITIONS(-DHAVE_UNISTD_H)
320
ENDIF(HAVE_UNISTD_H)
321
 
322
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
323
# IF(HAVE_SYS_TYPES_H)
324
#   ADD_DEFINITIONS(-DHAVE_SYS_TYPES_H)
325
# ENDIF(HAVE_SYS_TYPES_H)
326
 
327
CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
328
# IF(HAVE_SYS_STAT_H)
329
#   ADD_DEFINITIONS(-DHAVE_SYS_STAT_H)
330
# ENDIF(HAVE_SYS_STAT_H)
331
 
332
 
333
#Create configure files.. config.h and uninstall
334
#config.h
335
INCLUDE (ConfigureChecks.cmake)
336
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
337
ADD_DEFINITIONS("-DHAVE_CONFIG_H")
338
#uninstall
339
CONFIGURE_FILE(
340
  "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
341
  "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
342
  IMMEDIATE @ONLY)
343
 
344
ADD_CUSTOM_TARGET(uninstall
345
  "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
346
 
347
#Load our SCRIBUSQT package which gives us filename.moc instead of moc_filename.*
348
SET(SCRIBUSQT_DIR ${CMAKE_MODULE_PATH})
349
FIND_PACKAGE(SCRIBUSQT)
350
 
351
#Set up include dirs with all found packages
352
INCLUDE_DIRECTORIES(
353
${CMAKE_BINARY_DIR}
354
${CMAKE_BINARY_DIR}/scribus
355
${QT_INCLUDE_DIR}
356
${QT_INCLUDE_PATH}
357
${CUPS_INCLUDE_DIR}
358
${FREETYPE_INCLUDE_DIR}
359
${FONTCONFIG_INCLUDE_DIR}
360
${LCMS_INCLUDE_DIR}
361
${LIBXML2_INCLUDE_DIR}
362
${PYTHON_INCLUDE_PATH}
8166 avox 363
${JPEG_INCLUDE_DIR}
364
${PNG_INCLUDE_DIR}
6961 avox 365
${TIFF_INCLUDE_DIR}
366
${ZLIB_INCLUDE_DIR}
367
)
368
 
369
#Set up libraries to link with all found packages
370
 
371
#Select Libart_LGPL or Cairo
372
IF(RENDER_LIB STREQUAL "LIBART")
373
  INCLUDE_DIRECTORIES(${LIBART_LGPL_INCLUDE_DIR})
374
  LINK_LIBRARIES(${LIBART_LGPL_LIBRARIES})
375
ENDIF(RENDER_LIB STREQUAL "LIBART")
376
IF(RENDER_LIB STREQUAL "CAIRO")
377
  INCLUDE_DIRECTORIES(${CAIRO_INCLUDE_DIR})
378
  LINK_LIBRARIES(${CAIRO_LIBRARIES})
379
  LINK_DIRECTORIES(${PREFIX_CAIRO_LIB})
380
  SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${PREFIX_CAIRO_LIB}")
381
ENDIF(RENDER_LIB STREQUAL "CAIRO")
382
 
383
MESSAGE("RPATH: ${CMAKE_INSTALL_RPATH}")
384
 
385
LINK_LIBRARIES (
386
${QT_QT_LIBRARY}
387
${CUPS_LIBRARIES}
388
${FREETYPE_LIBRARIES}
389
${FONTCONFIG_LIBRARIES}
390
${LCMS_LIBRARIES}
391
${LIBXML2_LIBRARIES}
392
${PYTHON_LIBRARIES}
393
${TIFF_LIBRARIES}
394
${JPEG_LIBRARIES}
395
${ZLIB_LIBRARIES}
396
)
397
 
398
IF(WIN32)
399
  LINK_LIBRARIES(
400
    ${QT_QTMAIN_LIBRARY}
401
  )
402
ENDIF(WIN32)
403
 
404
IF(WIN32)
405
  ADD_DEFINITIONS(-DQT_DLL)
406
ENDIF(WIN32)
407
 
408
IF(APPLE)
409
  LINK_LIBRARIES( "-undefined dynamic_lookup" )
410
  LINK_LIBRARIES( "-framework CoreFoundation" )
411
ENDIF(APPLE)
412
 
413
#Add our source subdirs
414
ADD_SUBDIRECTORY(scribus)
415
 
416
#Install our READMEs etc.
417
INSTALL(FILES
418
AUTHORS
419
BUILDING
420
ChangeLog
10570 subik 421
ChangeLogSVN
6961 avox 422
COPYING
423
INSTALL
424
NEWS
425
PACKAGING
426
README
427
README.MacOSX
7812 mrdocs 428
README.OS2
6961 avox 429
TODO
430
 
431
  DESTINATION ${DOCDIR}
432
)
433
INSTALL(FILES
434
scribus.xml
435
DESTINATION ${MIMEDIR}
436
)
10909 mrdocs 437
#Install the desktop file
438
INSTALL(FILES
10910 mrdocs 439
scribus.desktop
440
DESTINATION ${DESKTOPDIR}
441
)
6961 avox 442
 
443
# If the cmake version includes cpack, use it
444
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
445
  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Scribus is an open source publishing application for Linux, Mac OSX and Windows")
446
  SET(CPACK_PACKAGE_VENDOR "Scribus Team")
447
  SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
448
  SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README")
449
  SET(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
450
  SET(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
451
  SET(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
452
  SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Scribus ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
453
  SET(CPACK_PACKAGE_EXECUTABLES "scribus${TAG_VERSION}")
7393 mrdocs 454
  SET(CPACK_SOURCE_PACKAGE_FILE_NAME "scribus-${VERSION}")
6961 avox 455
  SET(CPACK_SOURCE_GENERATOR TBZ2)
7393 mrdocs 456
## I'll make this prettier later - ignore any tarballs in the root
9980 mrdocs 457
  SET(CPACK_SOURCE_IGNORE_FILES CMakeCache.txt scribus-1.3.3.10svn.tar.bz2 scribus-1.3.3.10svn.tar.Z scribus-1.3.3.10svn.tar.gz "~$" "\\\\.cvsignore$" "^${PROJECT_SOURCE_DIR}.*/CVS/" "^${PROJECT_SOURCE_DIR}/debian/" "^${PROJECT_SOURCE_DIR}/old/" "^${PROJECT_SOURCE_DIR}.*/CVSROOT/" "^${PROJECT_SOURCE_DIR}.*/autom4te.cache/")
6961 avox 458
  INCLUDE(CPack)
459
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")