"Fossies" - the Fresh Open Source Software Archive

Member "scribus-1.5.6.1/CMakeLists.txt" (14 Nov 2020, 19568 Bytes) of package /linux/misc/scribus-1.5.6.1.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "CMakeLists.txt": 1.5.6_vs_1.5.6.1.

    1 ##############################################################################################################
    2 ########## CMake Setup                                                                              ##########
    3 
    4 #Set our CMake minimum version
    5 #Require 2.8.9 for Qt5 and CMAKE_POSITION_INDEPENDENT_CODE property
    6 #Require 3.1.0 for Qt 5.7 C++ 11 easy support
    7 #Require 3.2.0 for add_custom_target with byproducts
    8 #Require 3.12 for new Find Python modules
    9 #TODO: as soon as we require 3.14.0, use the Cmake own modules for
   10 # - Fontconfig
   11 
   12 cmake_minimum_required(VERSION 3.12.0 FATAL_ERROR)
   13 
   14 message(STATUS "CMake Version: ${CMAKE_VERSION}")
   15 
   16 # Configure CCache if available and wanted
   17 if (WANT_CCACHE)
   18 	find_program(CCACHE_FOUND ccache)
   19 	if(CCACHE_FOUND)
   20 		message(STATUS "Enabling ccache")
   21 		set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
   22 		set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
   23 	endif()
   24 endif()
   25 
   26 #Pretty colors
   27 set(CMAKE_COLOR_MAKEFILE ON)
   28 #Don't force verbose
   29 set(CMAKE_VERBOSE_MAKEFILE OFF)
   30 #Include current dir
   31 set(CMAKE_INCLUDE_CURRENT_DIR ON)
   32 #Don't allow in source builds
   33 #set(CMAKE_DISABLE_SOURCE_CHANGES ON)
   34 #set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
   35 
   36 
   37 #RPATH setup - more below too
   38 if (WANT_NORPATH OR WANT_DISTROBUILD)
   39 	set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
   40 else()
   41 	set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
   42 endif()
   43 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
   44 set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
   45 set(CMAKE_SKIP_BUILD_RPATH TRUE)
   46 
   47 include(CheckIncludeFile)
   48 include(CheckCCompilerFlag)
   49 include(CheckCXXCompilerFlag)
   50 include(CheckTypeSize)
   51 include(TestBigEndian)
   52 include(GNUInstallDirs)
   53 #include(FeatureSummary)
   54 
   55 #enable_testing()
   56 
   57 #Set the custom CMake module directory where our include/lib finders are
   58 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
   59 
   60 ##############################################################################################################
   61 ########## toplevel compiler flags                                                                  ##########
   62 message(STATUS "Shared Library Flags: ${CMAKE_SHARED_LIBRARY_C_FLAGS}")
   63 
   64 #Project Setup
   65 project(scribus)
   66 #Set our version values
   67 #Final version is ${VERSION} = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_SUFFIX}
   68 #where VERSION_SUFFIX is of the form "", "svn" or "Nsvn" (N being the minor patch level)
   69 set (VERSION_MAJOR "1")
   70 set (VERSION_MINOR "5")
   71 set (VERSION_PATCH "6")
   72 set (VERSION_SUFFIX "1")
   73 set (VERSION ${VERSION_MAJOR})
   74 if (VERSION_MINOR GREATER -1)
   75 	set (VERSION ${VERSION}.${VERSION_MINOR})
   76 endif()
   77 if (VERSION_PATCH GREATER -1)
   78 	set (VERSION ${VERSION}.${VERSION_PATCH})
   79 endif()
   80 if (VERSION_SUFFIX)
   81 	set (VERSION ${VERSION}.${VERSION_SUFFIX})
   82 endif()
   83 message(STATUS "Scribus ${VERSION} will be built and installed into ${CMAKE_INSTALL_PREFIX}")
   84 
   85 #Set the permissions to be used when installing plugins
   86 set(PLUGIN_PERMISSIONS WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE WORLD_READ GROUP_READ OWNER_READ OWNER_WRITE)
   87 
   88 #Our main directory is scribus
   89 set(MAIN_DIR_NAME "scribus")
   90 
   91 ##############################################################################################################
   92 ########## check for the CPU we build for                                                           ##########
   93 
   94 execute_process(
   95 	COMMAND ${CMAKE_C_COMPILER} -dumpmachine
   96 	OUTPUT_VARIABLE MACHINE
   97 	OUTPUT_STRIP_TRAILING_WHITESPACE
   98 )
   99 
  100 ## Find out what machine/cpu we are running on
  101 message(STATUS  "Machine: ${MACHINE}, void pointer size: ${CMAKE_SIZEOF_VOID_P}")
  102 string(REGEX MATCH "(i[0-9]86-*)|(athlon-*)|(pentium-*)" _machine_x86 "${MACHINE}")
  103 if (_machine_x86)
  104 	message(STATUS "Found target X86")
  105 	set(ARCH_X86 ON)
  106 endif()
  107 
  108 string(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _machine_x86_64 "${MACHINE}")
  109 if (_machine_x86_64)
  110 	message(STATUS "Found target X86_64")
  111 	set(ARCH_X86_64 ON)
  112 endif()
  113 
  114 string(REGEX MATCH "(sparc64-*)|(SPARC64-*)" _machine_sparc_64 "${MACHINE}")
  115 if (_machine_sparc_64)
  116 	message(STATUS "Found target SPARC 64")
  117 	set(ARCH_SPARC_64 ON)
  118 endif()
  119 
  120 string(REGEX MATCH "(mips64-*)|(MIPS64-*)" _machine_mips_64 "${MACHINE}")
  121 if (_machine_mips_64)
  122 	message(STATUS "Found target MIPS 64")
  123 	set(ARCH_MIPS_64 ON)
  124 endif()
  125 
  126 string(REGEX MATCH "(ppc-*)|(powerpc-*)" _machine_ppc "${MACHINE}")
  127 if (_machine_ppc)
  128 	message(STATUS "Found target PPC")
  129 	set(ARCH_PPC ON)
  130 endif()
  131 
  132 string(REGEX MATCH "(ppc64-*)|(PPC64-*)|(powerpc64-*)" _machine_ppc_64 "${MACHINE}")
  133 if (_machine_ppc_64)
  134 	message(STATUS "Found target PPC64")
  135 	set(ARCH_PPC_64 ON)
  136 endif()
  137 
  138 string(REGEX MATCH "(sparc-*)" _machine_sparc "${MACHINE}")
  139 if (_machine_sparc)
  140 	message(STATUS "Found target Sparc")
  141 	set(ARCH_SPARC ON)
  142 endif()
  143 
  144 string(REGEX MATCH "(sparcv9-*)" _machine_sparcv9 "${MACHINE}")
  145 if (_machine_sparcv9)
  146 	message(STATUS "Found target Sparc v9")
  147 	set(ARCH_SPARCV9 ON)
  148 endif()
  149 
  150 string(REGEX MATCH "(sparc64-*)" _machine_sparc64 "${MACHINE}")
  151 if (_machine_sparc64)
  152 	message(STATUS "Found target Sparc64")
  153 	set(ARCH_SPARC64 ON)
  154 	set(ARCH64BIT ON)
  155 endif()
  156 
  157 string(REGEX MATCH "(hppa*)" _machine_hppa "${MACHINE}")
  158 if (_machine_hppa)
  159 	message(STATUS "Found target Hppa")
  160 	set(ARCH_HPPA ON)
  161 endif()
  162 
  163 string(REGEX MATCH "(arm*)" _machine_arm "${MACHINE}")
  164 if (_machine_arm)
  165 	message(STATUS "Found target arm")
  166 	set(ARCH_ARM ON)
  167 endif()
  168 
  169 # We need to pass -fPIC to lib2geom on amd64, mips, mipsel, and hppa. See:
  170 # http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3 and
  171 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559133
  172 
  173 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
  174 
  175 ## Do our Apple OSX version setup
  176 if (APPLE)
  177 	if ((CMAKE_SIZEOF_VOID_P EQUAL 8) AND (ARCH_ARM))
  178 		string(REGEX REPLACE ".*-darwin([0-9]+).*" "\\1" _apple_ver "${MACHINE}")
  179 		if (_apple_ver EQUAL "20")
  180 			message(STATUS "Found macOS Big Sur Target: Apple, 64 bit, ARM")
  181 			set(APPLE_11_00_X ON CACHE BOOL "Found macOS Big Sur Target: Apple, 64 bit, ARM")
  182 		endif()
  183 	endif()
  184 	if ((CMAKE_SIZEOF_VOID_P EQUAL 8) AND (ARCH_X86 OR ARCH_X86_64))
  185 		string(REGEX REPLACE ".*-darwin([0-9]+).*" "\\1" _apple_ver "${MACHINE}")
  186 		if (_apple_ver EQUAL "20")
  187 			message(STATUS "Found macOS Big Sur Target: Apple, 64 bit, X86")
  188 			set(APPLE_11_00_X ON CACHE BOOL "Found macOS Big Sur Target: Apple, 64 bit, X86")
  189 		endif()
  190 		if (_apple_ver EQUAL "19")
  191 			message(STATUS "Found macOS Catalina Target: Apple, 64 bit, X86")
  192 			set(APPLE_10_15_X ON CACHE BOOL "Found macOS Catalina Target: Apple, 64 bit, X86")
  193 		endif()
  194 		if (_apple_ver EQUAL "18")
  195 			message(STATUS "Found macOS Mojave Target: Apple, 64 bit, X86")
  196 			set(APPLE_10_14_X ON CACHE BOOL "Found macOS Mojave Target: Apple, 64 bit, X86")
  197 		endif()
  198 		if (_apple_ver EQUAL "17")
  199 			message(STATUS "Found macOS High Sierra Target: Apple, 64 bit, X86")
  200 			set(APPLE_10_13_X ON CACHE BOOL "Found macOS High Sierra Target: Apple, 64 bit, X86")
  201 		endif()
  202 		if (_apple_ver EQUAL "16")
  203 			message(STATUS "Found macOS Sierra Target: Apple, 64 bit, X86")
  204 			set(APPLE_10_12_X ON CACHE BOOL "Found macOS Sierra Target: Apple, 64 bit, X86")
  205 		endif()
  206 		if (_apple_ver EQUAL "15")
  207 			message(STATUS "Found OSX El Capitan Target: Apple, 64 bit, X86")
  208 			set(APPLE_10_11_X ON CACHE BOOL "Found OSX El Capitan Target: Apple, 64 bit, X86")
  209 		endif()
  210 		if (_apple_ver EQUAL "14")
  211 			message(STATUS "Found OSX Yosemite Target: Apple, 64 bit, X86")
  212 			set(APPLE_10_10_X ON CACHE BOOL "Found OSX Yosemite Target: Apple, 64 bit, X86")
  213 		endif()
  214 		if (_apple_ver EQUAL "13")
  215 			message(STATUS "Found OSX Mavericks Target: Apple, 64 bit, X86")
  216 			set(APPLE_10_9_X ON CACHE BOOL "Found OSX Mavericks Target: Apple, 64 bit, X86")
  217 		endif()
  218 		if (_apple_ver EQUAL "12")
  219 			message(STATUS "Found OSX Mountain Lion Target: Apple, 64 bit, X86")
  220 			set(APPLE_10_8_X ON CACHE BOOL "Found OSX Mountain Lion Target: Apple, 64 bit, X86")
  221 		endif()
  222 		if (_apple_ver EQUAL "11")
  223 			message(STATUS "Found OSX Lion Target: Apple, 64 bit, X86")
  224 			set(APPLE_10_7_X ON CACHE BOOL "Found OSX Lion Target: Apple, 64 bit, X86")
  225 		endif()
  226 		if (_apple_ver EQUAL "10")
  227 			message(STATUS "Found OSX Snow Leopard Target: Apple, 64 bit, X86")
  228 			set(APPLE_10_6_X ON CACHE BOOL "Found OSX Snow Leopard Target: Apple, 64 bit, X86")
  229 		endif()
  230 		if (_apple_ver EQUAL "9")
  231 			message(STATUS "Found OSX Leopard Target: Apple, 32 bit, X86")
  232 			set(APPLE_10_5_X ON CACHE BOOL "Found OSX Leopard Target: Apple, 32 bit, X86")
  233 		endif()
  234 		unset(ARCH_X86)
  235 	endif()
  236 endif()
  237 
  238 
  239 #convert any 64 bit build into generic 64 tag for below
  240 if (ARCH_X86_64 OR ARCH_SPARC_64 OR ARCH_MIPS_64 OR ARCH_PPC_64)
  241 	set(ARCH64BIT ON)
  242 endif()
  243 
  244 message(STATUS "Building for target ${MACHINE}")
  245 
  246 ##############################################################################################################
  247 ########## Relocatability                                                                           ##########
  248 
  249 if (APPLEBUNDLE OR WIN32)
  250 	if (WANT_RELOCATABLE)
  251 		message(STATUS "Ignoring relocatable option on Win32 or OSX when building bundle")
  252 		set(WANT_RELOCATABLE OFF)
  253 	endif()
  254 endif()
  255 
  256 if (WANT_RELOCATABLE)
  257 	message(STATUS "Enabling relocatable binaries")
  258 	set(WANT_RELOCATABLE ON CACHE BOOL "Enable relocatable binaries")
  259 	add_definitions(-DWANT_RELOCATABLE)
  260 endif()
  261 
  262 ##############################################################################################################
  263 ########## Versioning Setup                                                                         ##########
  264 
  265 #On Apple, we ignore the versioning tag so all items are "scribus" not "scribus-version"
  266 if (NOT BUILD_OSX_BUNDLE)
  267 	set(BUILD_OSX_BUNDLE ${APPLE} CACHE BOOL "Building MacOS X Bundle")
  268 endif()
  269 
  270 #Simplify future conditionals for Apple
  271 if (APPLE AND BUILD_OSX_BUNDLE)
  272 	set(APPLEBUNDLE ON CACHE BOOL "Building Apple Bundle")
  273 endif()
  274 
  275 #Announce we cached a version request before, overridden below for OSX
  276 if(TAG_VERSION)
  277 	if (NOT APPLEBUNDLE)
  278 		message(STATUS "Previously selected version tag: ${TAG_VERSION}")
  279 	endif()
  280 	set(WANT_VERSIONING ON)
  281 	set(CACHED_VERSIONING ON)
  282 endif()
  283 
  284 #Remove version tags on OSX so our bundle is Scribus.app
  285 if (APPLEBUNDLE OR WIN32)
  286 	if (WANT_VERSIONING OR CACHED_VERSIONING)
  287 		message(STATUS "Ignoring version tag on Win32 or OSX when building bundle")
  288 		set(WANT_VERSIONING OFF)
  289 		set(CACHED_VERSIONING OFF)
  290 	endif()
  291 endif()
  292 
  293 #Store our version string if required
  294 if (WANT_VERSIONING AND NOT CACHED_VERSIONING)
  295 	if (NOT CUSTOM_VERSIONTAG)
  296 		set(TAG_VERSION "-${VERSION}" CACHE STRING "Version string")
  297 	else()
  298 		set(TAG_VERSION ${CUSTOM_VERSIONTAG} CACHE STRING "Version string")
  299 	endif()
  300 endif()
  301 
  302 ##############################################################################################################
  303 ########## Install/Directory Setup                                                                  ##########
  304 include (CMakeLists_Directories.cmake)
  305 
  306 ##############################################################################################################
  307 ########## Build Setup                                                                              ##########
  308 
  309 #Convert our simpler command line option to the CMake style
  310 #None, Debug, Release, .. or custom ones
  311 # set(WANT_DEBUG ON)
  312 if(WANT_DEBUG)
  313 	set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Set Debug Build Type" FORCE)
  314 endif()
  315 if (WANT_RELEASEWITHDEBUG)
  316 	set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Set Release with Debug Info Build Type" FORCE)
  317 endif()
  318 if(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
  319 	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set Release Build Type" FORCE)
  320 endif()
  321 
  322 
  323 
  324 #Based on our build type, setup our build options
  325 if(APPLE)
  326 	### Include our Apple configure commands
  327 	include(CMakeLists_Apple.cmake)
  328 else()
  329 	if(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
  330 		# Windows build with Visual Studio
  331 		# Surely there's a better way to identify the compiler?
  332 		set(CMAKE_CXX_FLAGS_DEBUG)
  333 		set(CMAKE_C_FLAGS_DEBUG)
  334 	else()
  335 		# vanilla gcc
  336 		set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g -Wall -fstrict-aliasing -Wl,-E")
  337 		set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g -Wall -fstrict-aliasing -Wl,-E")
  338 		if (_machine_x86 OR _machine_x86_64)
  339 			set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC")
  340 			set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fPIC")
  341 		endif()
  342 	endif()
  343 	if(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")
  344 		set(CMAKE_CXX_FLAGS_RELEASE)
  345 		set(CMAKE_C_FLAGS_RELEASE)
  346 	else()
  347 		set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -Wall -fPIC -Wl,-E")
  348 		set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -Wall -fPIC -Wl,-E")
  349 	#	add_definitions(-DNDEBUG)
  350 	endif()
  351 endif()
  352 if(WIN32)
  353 	add_definitions(-DWIN32_LEAN_AND_MEAN
  354 					-DAVOID_WIN32_FILEIO
  355 					-D_CRT_SECURE_NO_DEPRECATE
  356 					-D_USE_MATH_DEFINES
  357 					-DCOMPILE_PLUGIN_AS_DLL
  358 					)
  359 	set(BUILD_WINDOWS_VERSION ON)
  360 	set(DLL_USE_NATIVE_API ON)
  361 endif()
  362 
  363 #C++11 Support
  364 #as of 1.5.5.svn, require C++11
  365 if(NOT WANT_CPP14 AND NOT WANT_CPP17)
  366 	message(STATUS "Enabling C++11 compiler features")
  367 	set(CMAKE_CXX_STANDARD 11)
  368 endif()
  369 if (WANT_CPP14)
  370 	message(STATUS "Enabling C++14 compiler features")
  371 	set(CMAKE_CXX_STANDARD 14)
  372 elseif(WANT_CPP17)
  373 		message(STATUS "Enabling C++17 compiler features")
  374 		set(CMAKE_CXX_STANDARD 17)
  375 endif()
  376 
  377 ##############################################################################################################
  378 ########## Find Dependencies                                                                        ##########
  379 ### Include our Dependency finding commands
  380 include(CMakeLists_Dependencies.cmake)
  381 
  382 
  383 ##############################################################################################################
  384 ########## Include Setup                                                                            ##########
  385 
  386 TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
  387 
  388 CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
  389 if(HAVE_DLFCN_H)
  390 	add_definitions(-DHAVE_DLFCN_H)
  391 endif()
  392 
  393 CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
  394 if(HAVE_UNISTD_H)
  395 	add_definitions(-DHAVE_UNISTD_H)
  396 endif()
  397 
  398 CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
  399 # if(HAVE_SYS_TYPES_H)
  400 #   add_definitions(-DHAVE_SYS_TYPES_H)
  401 # endif()
  402 
  403 CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
  404 # if(HAVE_SYS_STAT_H)
  405 #   add_definitions(-DHAVE_SYS_STAT_H)
  406 # endif()
  407 #>>Test for existing include files
  408 
  409 
  410 #Create configure files.. config.h and uninstall
  411 #config.h
  412 include (ConfigureChecks.cmake)
  413 	if(WIN32)
  414 		set(CONFIG_NAME win-config.h)
  415 	else()
  416 		set(CONFIG_NAME config.h)
  417 	endif()
  418 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
  419 add_definitions(-DHAVE_CONFIG_H)
  420 
  421 
  422 
  423 #Set up include dirs with all found packages
  424 include_directories(
  425 	${CMAKE_BINARY_DIR}
  426 	${CMAKE_BINARY_DIR}/scribus
  427 	${QT_INCLUDES}
  428 	${FREETYPE_INCLUDE_DIR}
  429 #	${FONTCONFIG_INCLUDE_DIR}
  430 	${JPEG_INCLUDE_DIR}
  431 	${LCMS2_INCLUDE_DIR}
  432 	${LIBXML2_INCLUDE_DIR}
  433 	${PNG_INCLUDE_DIR}
  434 	${TIFF_INCLUDE_DIR}
  435 	${ZLIB_INCLUDE_DIR}
  436 	${OPENGL_INCLUDE_DIR}
  437 	${OSG_INCLUDE_DIR}
  438 	${GSL_INCLUDE_DIR}
  439 )
  440 
  441 if (NOT WIN32 AND NOT HAIKU)
  442 include_directories(
  443 	${CUPS_INCLUDE_DIR}
  444 )
  445 endif()
  446 
  447 ##############################################################################################################
  448 ########## Uninstall Setup                                                                          ##########
  449 
  450 configure_file(
  451 	"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
  452 	"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
  453 	IMMEDIATE @ONLY
  454 )
  455 
  456 add_custom_target(uninstall
  457 	"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
  458 )
  459 
  460 
  461 ##############################################################################################################
  462 ########## Add our subdirs                                                                          ##########
  463 
  464 #Add our source subdirs
  465 add_subdirectory(scribus)
  466 add_subdirectory(doc)
  467 add_subdirectory(resources/dicts)
  468 add_subdirectory(resources/editorconfig)
  469 add_subdirectory(resources/iconsets)
  470 add_subdirectory(resources/keysets)
  471 add_subdirectory(resources/loremipsum)
  472 add_subdirectory(resources/manpages)
  473 add_subdirectory(resources/profiles)
  474 add_subdirectory(resources/swatches)
  475 add_subdirectory(resources/templates)
  476 add_subdirectory(resources/translations)
  477 add_subdirectory(resources/unicodemap)
  478 
  479 #Install our READMEs etc.
  480 install(FILES
  481 	AUTHORS
  482 	ChangeLog
  483 	COPYING
  484 	LINKS
  485 	README
  486 	TRANSLATION
  487 	DESTINATION ${DOCDIR}
  488 )
  489 
  490 if (APPLE)
  491 	install(FILES
  492 		README.MacOSX
  493 		DESTINATION ${DOCDIR}
  494 	)
  495 
  496 	#	execute_process (COMMAND mkdir -p "${CMAKE_INSTALL_PREFIX}/PlugIns/imageformats")
  497 	#	if (NOT EXISTS "${CMAKE_INSTALL_PREFIX}/PlugIns/imageformats/libqjpeg.dylib")
  498 	#message(STATUS ${QT_PREFIX})
  499 	#message(STATUS "@QT_PREFIX@/plugins/imageformats/libqjpeg.dylib")
  500 	#message(STATUS "${CMAKE_INSTALL_PREFIX}/PlugIns/imageformats/libqjpeg.dylib")
  501 	#		execute_process (COMMAND ditto "@QT_PREFIX@/plugins/imageformats/libqjpeg.dylib" "${CMAKE_INSTALL_PREFIX}/PlugIns/imageformats/libqjpeg.dylib")
  502 	#	endif()
  503 
  504 endif()
  505 
  506 #Install the .desktop file
  507 configure_file(
  508 	${CMAKE_CURRENT_SOURCE_DIR}/scribus.desktop.in
  509 	${CMAKE_CURRENT_SOURCE_DIR}/scribus.desktop
  510 )
  511 install(FILES
  512 	scribus.desktop
  513 	RENAME scribus${TAG_VERSION}.desktop
  514 	DESTINATION ${DESKTOPDIR}
  515 )
  516 
  517 #Install our MIME data
  518 install(FILES
  519 	scribus.xml
  520 	RENAME scribus${TAG_VERSION}.xml
  521 	DESTINATION ${MIMEDIR}
  522 )
  523 
  524 
  525 #Install the appdata file
  526 configure_file(
  527 	${CMAKE_CURRENT_SOURCE_DIR}/scribus.appdata.xml.in
  528 	${CMAKE_CURRENT_SOURCE_DIR}/scribus.appdata.xml
  529 )
  530 install(FILES
  531 	scribus.appdata.xml
  532 	RENAME scribus${TAG_VERSION}.appdata.xml
  533 	DESTINATION ${APPDATADIR}
  534 )
  535 
  536 
  537 #If building an Apple bundle, install these specific files
  538 if(APPLEBUNDLE)
  539 	install(FILES
  540 		Scribus.app/Contents/Info.plist
  541 		DESTINATION ${CMAKE_INSTALL_PREFIX}
  542 	)
  543 	install(FILES
  544 		Scribus.app/Contents/Resources/Scribus.icns
  545 		Scribus.app/Contents/Resources/Scribus-doc.icns
  546 		DESTINATION ${CMAKE_INSTALL_PREFIX}/Resources
  547 	)
  548 endif()
  549 
  550 ##############################################################################################################
  551 ########## Install/CPack Setup                                                                      ##########
  552 
  553 # If the cmake version includes cpack, use it for tarball building
  554 if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
  555 	set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Scribus is an open source publishing application for Linux, Mac OSX and Windows")
  556 	set(CPACK_PACKAGE_VENDOR "Scribus Team")
  557 	set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
  558 	set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README")
  559 	set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
  560 	set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
  561 	set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
  562 	set(CPACK_PACKAGE_INSTALL_DIRECTORY "Scribus ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
  563 	set(CPACK_PACKAGE_EXECUTABLES "scribus${TAG_VERSION}")
  564 	set(CPACK_SOURCE_PACKAGE_FILE_NAME "scribus-${VERSION}${VERSION_SUFFIX}")
  565 	set(CPACK_SOURCE_GENERATOR TBZ2)
  566 	set(CPACK_SYSTEM_NAME "")
  567 	set(CPACK_TOPLEVEL_TAG "")
  568 	set(CPACK_SOURCE_IGNORE_FILES
  569 		CMakeCache.txt
  570 		scribus-1.5.6.tar.bz2
  571 		scribus-1.5.6.tar.7z
  572 		scribus-1.5.6.tar.gz
  573 		scribus-1.5.6.svn.tar.bz2
  574 		scribus-1.5.6.svn.tar.7z
  575 		scribus-1.5.6.svn.tar.gz
  576 		"~$"
  577 		"\\\\.cvsignore$"
  578 		"\\\\.o$"
  579 		"\\\\.svn-base$"
  580 		"\\\\.svn$"
  581 		"^${PROJECT_SOURCE_DIR}.*/CVS/"
  582 		"^${PROJECT_SOURCE_DIR}/debian/"
  583 		"^${PROJECT_SOURCE_DIR}/old/"
  584 		"^${PROJECT_SOURCE_DIR}.*/CVSROOT/"
  585 		"^${PROJECT_SOURCE_DIR}/admin/"
  586 	)
  587 	include(CPack)
  588 endif()
  589 
  590 #include (cmakeconfigreport optional)
  591 
  592 # Output everything we've found
  593 #feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES)