#CMAKE SETUP #Require 2.4.2 for Qt finding #Require 2.4.3 for moc change detection #Require 2.4.3 for rpath updates for custom cairo install CMAKE_MINIMUM_REQUIRED(VERSION 2.4.3 FATAL_ERROR) SET(CMAKE_COLOR_MAKEFILE ON) SET(CMAKE_VERBOSE_MAKEFILE OFF) SET(CMAKE_INCLUDE_CURRENT_DIR TRUE) SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) #SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) #SET(CMAKE_SKIP_RPATH:BOOL NO) SET(CMAKE_SKIP_RULE_DEPENDENCY TRUE) SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") # SET(CMAKE_SHARED_MODULE_LINK_FLAGS "${CMAKE_SHARED_MODULE_LINK_FLAGS} -export-dynamic") # SET(CMAKE_SHARED_MODULE_LINK_CXX_FLAGS "${CMAKE_SHARED_MODULE_LINK_CXX_FLAGS} -export-dynamic") # SET(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -export-dynamic") # SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -export-dynamic") # MESSAGE(STATUS ${CMAKE_SHARED_MODULE_LINK_FLAGS}) # MESSAGE(STATUS ${CMAKE_SHARED_MODULE_LINK_CXX_FLAGS}) # MESSAGE(STATUS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) # MESSAGE(STATUS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) # MESSAGE(STATUS ${CMAKE_CXX_CREATE_SHARED_MODULE}) # MESSAGE(STATUS ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) #IMPORT FROM COMMANDLINE # SET with cmake -DWANT_CAIRO=1, etc # MESSAGE(STATUS ${WANT_CAIRO}) # MESSAGE(STATUS ${WANT_LIBART}) # MESSAGE(STATUS ${WANT_DEBUG}) # SET(WANT_CAIRO 0) # SET(WANT_LIBART 1) #PROJECT SETUP PROJECT(scribus) SET (VERSION_MAJOR "1") SET (VERSION_MINOR "3") SET (VERSION_PATCH "3.13svn") SET (VERSION_SUFFIX "") SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}) MESSAGE(STATUS "Scribus ${VERSION} will be built to install into ${CMAKE_INSTALL_PREFIX}") SET(PLUGIN_PERMISSIONS WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE WORLD_READ GROUP_READ OWNER_READ OWNER_WRITE) SET(MAIN_DIR_NAME "scribus") ############################################################################################################## ########## check for the CPU we build for ########## EXECUTE_PROCESS( COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE ) MESSAGE(STATUS "Building for target ${MACHINE}") STRING(REGEX MATCH "(i?86-*)|(athlon-*)|(pentium-*)" _machine_x86 "${MACHINE}") IF (_machine_x86) MESSAGE(STATUS "Found target X86") SET(ARCH_X86 1) ENDIF (_machine_x86) STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _machine_x86_64 "${MACHINE}") IF (_machine_x86_64) MESSAGE(STATUS "Found target X86_64") SET(ARCH_X86_64 1) ENDIF (_machine_x86_64) STRING(REGEX MATCH "(ppc-*)" _machine_ppc "${MACHINE}") IF (_machine_ppc) MESSAGE(STATUS "Found target PPC") SET(ARCH_PPC 1) ENDIF (_machine_ppc) STRING(REGEX MATCH "(sparc-*)" _machine_sparc "${MACHINE}") IF (_machine_sparc) MESSAGE(STATUS "Found target Sparc") SET(ARCH_SPARC 1) ENDIF (_machine_sparc) STRING(REGEX MATCH "(sparcv9-*)" _machine_sparcv9 "${MACHINE}") IF (_machine_sparcv9) MESSAGE(STATUS "Found target Sparc v9") SET(ARCH_SPARCV9 1) ENDIF (_machine_sparcv9) STRING(REGEX MATCH "(sparc64-*)" _machine_sparc64 "${MACHINE}") IF (_machine_sparc64) MESSAGE(STATUS "Found target Sparc64") SET(ARCH_SPARC64 1) SET(ARCH64BIT 1) ENDIF (_machine_sparc64) #convert any 64 bit build into generic 64 tag for below IF (ARCH_X86_64) SET(ARCH64BIT 1) ENDIF (ARCH_X86_64) ############################################################################################################## ########## Versioning Setup ########## IF(TAG_VERSION) MESSAGE(STATUS "Previously selected version tag: ${TAG_VERSION}") SET(WANT_VERSIONING 1) SET(CACHED_VERSIONING 1) ENDIF(TAG_VERSION) IF (WANT_VERSIONING AND NOT CACHED_VERSIONING) IF (NOT CUSTOM_VERSIONTAG) SET(TAG_VERSION "-${VERSION}" CACHE TYPE STRING) ELSE (NOT CUSTOM_VERSIONTAG) SET(TAG_VERSION ${CUSTOM_VERSIONTAG} CACHE TYPE STRING) ENDIF (NOT CUSTOM_VERSIONTAG) ENDIF (WANT_VERSIONING AND NOT CACHED_VERSIONING) #MAN SET(MANDIR "share/man/") SET(SHAREDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/") ADD_DEFINITIONS("-DSHAREDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SHAREDIR}\\\"") #SHARE IF(TAG_VERSION) SET(DOCDIR "share/doc/${MAIN_DIR_NAME}${TAG_VERSION}/") ELSE(TAG_VERSION) SET(DOCDIR "share/doc/${MAIN_DIR_NAME}-${VERSION}/") ENDIF (TAG_VERSION) ADD_DEFINITIONS("-DSHAREDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SHAREDIR}\\\"") SET(DOCDIR "share/doc/${MAIN_DIR_NAME}${TAG_VERSION}/") ADD_DEFINITIONS("-DDOCDIR=\\\"${CMAKE_INSTALL_PREFIX}/${DOCDIR}\\\"") SET(ICONDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/icons/") ADD_DEFINITIONS("-DICONDIR=\\\"${CMAKE_INSTALL_PREFIX}/${ICONDIR}\\\"") SET(SAMPLESDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/samples/") ADD_DEFINITIONS("-DSAMPLESDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SAMPLESDIR}\\\"") SET(SCRIPTSDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/scripts/") ADD_DEFINITIONS("-DSCRIPTSDIR=\\\"${CMAKE_INSTALL_PREFIX}/${SCRIPTSDIR}\\\"") SET(TEMPLATEDIR "share/${MAIN_DIR_NAME}${TAG_VERSION}/templates/") ADD_DEFINITIONS("-DTEMPLATEDIR=\\\"${CMAKE_INSTALL_PREFIX}/${TEMPLATEDIR}\\\"") #DESKTOP backport from 1.3.5 SET(DESKTOPDIR "share/applications/") ADD_DEFINITIONS("-DDESKTOPDIR=\\\"${CMAKE_INSTALL_PREFIX}/${DESKTOPDIR}\\\"") #LIB LOCATION - lib or lib64 normally #LIB IF(WANT_LIB64) IF(NOT ARCH64BIT) MESSAGE(STATUS "WARNING: BUILDING 64 Bit build on non 64 bit architecture") ENDIF(NOT ARCH64BIT) SET(LIB_SUFFIX "64" CACHE TYPE STRING) ENDIF(WANT_LIB64) #OVERRIDE WANT_LIB64 with WANT_LIB32 if both exist IF(WANT_LIB32) IF(ARCH64BIT) MESSAGE(STATUS "WARNING: FORCING 32 Bit build on 64 bit architecture") ENDIF(ARCH64BIT) SET(LIB_SUFFIX "" CACHE TYPE STRING) SET(WANT_LIB64 "") ENDIF(WANT_LIB32) #Auto build 64 bit if user doesnt force 32 bit and we detect 64 bit IF(ARCH64BIT AND NOT LIB_SUFFIX) IF(NOT WANT_LIB32) IF(NOT WANT_LIB64) MESSAGE(STATUS "Autodetected 64 bit architecture, building for 64 Bit") SET(LIB_SUFFIX "64" CACHE TYPE STRING) ENDIF(NOT WANT_LIB64) ENDIF(NOT WANT_LIB32) ENDIF(ARCH64BIT AND NOT LIB_SUFFIX) SET(LIB_DIR_NAME "lib${LIB_SUFFIX}") SET(LIBDIR "${LIB_DIR_NAME}/${MAIN_DIR_NAME}${TAG_VERSION}/") ADD_DEFINITIONS("-DLIBDIR=\\\"${CMAKE_INSTALL_PREFIX}/${LIBDIR}\\\"") #PLUGINS SET(PLUGINDIR "${LIB_DIR_NAME}/${MAIN_DIR_NAME}${TAG_VERSION}/plugins/") ADD_DEFINITIONS("-DPLUGINDIR=\\\"${CMAKE_INSTALL_PREFIX}/${PLUGINDIR}\\\"") # older version #SET(LIBDIR "lib/${MAIN_DIR_NAME}${TAG_VERSION}/") #ADD_DEFINITIONS("-DLIBDIR=\\\"${CMAKE_INSTALL_PREFIX}/${LIBDIR}\\\"") #SET(PLUGINDIR "lib/${MAIN_DIR_NAME}${TAG_VERSION}/plugins/") #ADD_DEFINITIONS("-DPLUGINDIR=\\\"${CMAKE_INSTALL_PREFIX}/${PLUGINDIR}\\\"") #set(CMAKE_INSTALL_RPATH ${PLUGINDIR}) # Set the XDG mime stuff SET(MIMEDIR "share/mime/packages/") SET(MIMELNKDIR "share/mimelnk/application/") #BUILD SETUP #None, Debug, Release, .. or custom ones #SET(WANT_DEBUG 1) IF(WANT_DEBUG) SET(CMAKE_BUILD_TYPE Debug) ELSE(WANT_DEBUG) SET(CMAKE_BUILD_TYPE RELEASE) ENDIF(WANT_DEBUG) IF(APPLE) SET( ENV{MACOSX_DEPLOYMENT_TARGET} 10.3 ) SET( ENV{LD_PREBIND} 1 ) SET( ENV{LD_PREBIND_ALLOW_OVERLAP} 1 ) SET(CMAKE_CXX_FLAGS_DEBUG "-O2 -g3 -fno-inline-functions -Wall") SET(CMAKE_C_FLAGS_DEBUG "-O2 -g3 -fno-inline-functions -Wall") SET(BUILD_MAC_BUNDLE 1) ELSE(APPLE) SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -Wall") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -Wall") ENDIF(APPLE) SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall") SET(CMAKE_C_FLAGS_RELEASE "-O2 -Wall") INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) INCLUDE (CheckIncludeFile) TEST_BIG_ENDIAN(WORDS_BIGENDIAN) #FIND DEPENDENCIES # START QT SET (QT_MT_REQUIRED true) SET (QT_MIN_VERSION "3.3.4") FIND_PACKAGE(Qt3 REQUIRED) IF (QT_FOUND) MESSAGE("Qt3 Found OK (${qt_version_str})") # MESSAGE("$ENV{QTDIR}") # MESSAGE("${QT_MOC_EXECUTABLE}") # MESSAGE("${QT_UIC_EXECUTABLE}") # MESSAGE("${QT_QT_LIBRARY}") # MESSAGE("${QT_INCLUDE_DIR}") # MESSAGE("${qt_version_str}") # MESSAGE(${qt_version_str_lib}) ELSE(QT_FOUND) MESSAGE(FATAL_ERROR "No Qt3") ENDIF(QT_FOUND) # END QT # START PNG, JPEG, TIFF FIND_PACKAGE(PNG REQUIRED) IF (PNG_FOUND) MESSAGE("PNG Library Found OK") ENDIF(PNG_FOUND) FIND_PACKAGE(JPEG REQUIRED) IF (JPEG_FOUND) MESSAGE("JPEG Library Found OK") ENDIF(JPEG_FOUND) FIND_PACKAGE(TIFF REQUIRED) IF (TIFF_FOUND) MESSAGE("TIFF Library Found OK") SET(HAVE_TIFF 1) IF(WANT_TIFF_CMYKA) ADD_DEFINITIONS(-DTIFF_CMYKA_SUPPORT) ENDIF(WANT_TIFF_CMYKA) ELSE(TIFF_FOUND) MESSAGE(FATAL_ERROR "Could not find the TIFF Library") ENDIF(TIFF_FOUND) FIND_PACKAGE(ZLIB REQUIRED) IF (ZLIB_FOUND) MESSAGE("ZLIB Library Found OK") SET(HAVE_LIBZ 1) ENDIF(ZLIB_FOUND) FIND_PACKAGE(PythonLibs REQUIRED) IF (PYTHON_LIBRARY) MESSAGE("Python Library Found OK") SET(HAVE_PYTHON 1) SET(COMPILE_PYTHON 1) ENDIF(PYTHON_LIBRARY) # START FREETYPE IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.6) SET(FREETYPE_DIR ${CMAKE_MODULE_PATH}) FIND_PACKAGE(FREETYPE REQUIRED) IF (FREETYPE_FOUND) MESSAGE("FreeType2 Library Found OK") INCLUDE(CheckLibraryExists) CHECK_LIBRARY_EXISTS(libfreetype.so FT_Get_First_Char "" HAVE_FREETYPE_FIRST) CHECK_LIBRARY_EXISTS(libfreetype.so FT_Get_Next_Char "" HAVE_FREETYPE_NEXT) ENDIF(FREETYPE_FOUND) SET(CFLAGS "${CFLAGS}"."${LIBFREETYPE_CFLAGS}") ELSE(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.6) FIND_PACKAGE(Freetype REQUIRED) IF (FREETYPE_FOUND) MESSAGE(STATUS "FreeType2 Library Found OK") INCLUDE(CheckLibraryExists) CHECK_LIBRARY_EXISTS(libfreetype.so FT_Get_First_Char "" HAVE_FREETYPE_FIRST) CHECK_LIBRARY_EXISTS(libfreetype.so FT_Get_Next_Char "" HAVE_FREETYPE_NEXT) ELSE (FREETYPE_FOUND) MESSAGE(FATAL_ERROR "No Freetype Found") ENDIF(FREETYPE_FOUND) ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.6) # END FREETYPE # If we have a RENDER_LIB selected from a previous cmake run, then use it # otherwise, we should be defaulting to Libart_LGPL for 1.3.3.x IF(RENDER_LIB) MESSAGE(STATUS "Previously selected rendering system: ${RENDER_LIB}") ELSE(RENDER_LIB) IF (NOT WANT_CAIRO) SET(WANT_LIBART 1) ENDIF (NOT WANT_CAIRO) ENDIF(RENDER_LIB) # START LIBART_LGPL IF (WANT_LIBART OR RENDER_LIB STREQUAL "LIBART") SET(LIBART_LGPL_DIR ${CMAKE_MODULE_PATH}) FIND_PACKAGE(LIBART_LGPL REQUIRED) IF(LIBART_LGPL_FOUND) SET(RENDER_LIB "LIBART" CACHE TYPE STRING) MESSAGE("Libart_LGPL Library Found OK") ELSE(LIBART_LGPL_FOUND) SET(OLDRENDERLIBLOST TRUE) ENDIF(LIBART_LGPL_FOUND) ELSE (WANT_LIBART OR RENDER_LIB STREQUAL "LIBART") # START CAIRO SET(CAIRO_DIR ${CMAKE_MODULE_PATH}) FIND_PACKAGE(CAIRO) IF(CAIRO_FOUND) MESSAGE("CAIRO Library Found OK") SET(RENDER_LIB "CAIRO" CACHE TYPE STRING) ELSE(CAIRO_FOUND) SET(OLDRENDERLIBLOST TRUE) ENDIF(CAIRO_FOUND) # END CAIRO ENDIF (WANT_LIBART OR RENDER_LIB STREQUAL "LIBART") # END LIBART_LGPL IF(NOT RENDER_LIB OR OLDRENDERLIBLOST) MESSAGE(FATAL_ERROR "ERROR: Neither LibArt_LGPL nor cairo have been selected or found, please correct and restart cmake") ENDIF(NOT RENDER_LIB OR OLDRENDERLIBLOST) # START CUPS SET(CUPS_DIR ${CMAKE_MODULE_PATH}) FIND_PACKAGE(CUPS REQUIRED) IF(CUPS_FOUND) SET(HAVE_CUPS 1) MESSAGE("CUPS Library Found OK") ENDIF(CUPS_FOUND) # END CUPS # START LIBXML2 SET(LIBXML2_DIR ${CMAKE_MODULE_PATH}) FIND_PACKAGE(LIBXML2 REQUIRED) IF(LIBXML2_FOUND) SET(HAVE_XML 1) MESSAGE("LIBXML2 Library Found OK") ENDIF(LIBXML2_FOUND) # END LIBXML2 # START LCMS SET(LCMS_DIR ${CMAKE_MODULE_PATH}) FIND_PACKAGE(LCMS REQUIRED) IF(LCMS_FOUND) SET(HAVE_CMS 1) SET(CMS_INC "lcms.h") MESSAGE("LittleCMS Library Found OK") ELSE(LCMS_FOUND) MESSAGE(FATAL_ERROR "Could not find the LittleCMS Library") ENDIF(LCMS_FOUND) # END LCMS # START FONTCONFIG SET(FONTCONFIG_DIR ${CMAKE_MODULE_PATH}) FIND_PACKAGE(FONTCONFIG) IF(FONTCONFIG_FOUND) MESSAGE("FontConfig Found OK") SET(HAVE_FONTCONFIG 1) ENDIF(FONTCONFIG_FOUND) # END FONTCONFIG ADD_DEFINITIONS(${QT_DEFINITIONS}) CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) IF(HAVE_DLFCN_H) ADD_DEFINITIONS(-DHAVE_DLFCN_H) ENDIF(HAVE_DLFCN_H) CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) IF(HAVE_UNISTD_H) ADD_DEFINITIONS(-DHAVE_UNISTD_H) ENDIF(HAVE_UNISTD_H) CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) # IF(HAVE_SYS_TYPES_H) # ADD_DEFINITIONS(-DHAVE_SYS_TYPES_H) # ENDIF(HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) # IF(HAVE_SYS_STAT_H) # ADD_DEFINITIONS(-DHAVE_SYS_STAT_H) # ENDIF(HAVE_SYS_STAT_H) #Create configure files.. config.h and uninstall #config.h INCLUDE (ConfigureChecks.cmake) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) ADD_DEFINITIONS("-DHAVE_CONFIG_H") #uninstall CONFIGURE_FILE( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") #Load our SCRIBUSQT package which gives us filename.moc instead of moc_filename.* SET(SCRIBUSQT_DIR ${CMAKE_MODULE_PATH}) FIND_PACKAGE(SCRIBUSQT) #Set up include dirs with all found packages INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/scribus ${QT_INCLUDE_DIR} ${QT_INCLUDE_PATH} ${CUPS_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIR} ${FONTCONFIG_INCLUDE_DIR} ${LCMS_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR} ${PYTHON_INCLUDE_PATH} ${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${TIFF_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS} ) #Set up libraries to link with all found packages #Select Libart_LGPL or Cairo IF(RENDER_LIB STREQUAL "LIBART") INCLUDE_DIRECTORIES(${LIBART_LGPL_INCLUDE_DIR}) LINK_LIBRARIES(${LIBART_LGPL_LIBRARIES}) ENDIF(RENDER_LIB STREQUAL "LIBART") IF(RENDER_LIB STREQUAL "CAIRO") INCLUDE_DIRECTORIES(${CAIRO_INCLUDE_DIR}) LINK_LIBRARIES(${CAIRO_LIBRARIES}) LINK_DIRECTORIES(${PREFIX_CAIRO_LIB}) SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${PREFIX_CAIRO_LIB}") ENDIF(RENDER_LIB STREQUAL "CAIRO") MESSAGE("RPATH: ${CMAKE_INSTALL_RPATH}") LINK_LIBRARIES ( ${QT_QT_LIBRARY} ${CUPS_LIBRARIES} ${FREETYPE_LIBRARIES} ${FONTCONFIG_LIBRARIES} ${LCMS_LIBRARIES} ${LIBXML2_LIBRARIES} ${PYTHON_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} ${ZLIB_LIBRARIES} ) IF(WIN32) LINK_LIBRARIES( ${QT_QTMAIN_LIBRARY} ) ENDIF(WIN32) IF(WIN32) ADD_DEFINITIONS(-DQT_DLL) ENDIF(WIN32) IF(APPLE) LINK_LIBRARIES( "-undefined dynamic_lookup" ) LINK_LIBRARIES( "-framework CoreFoundation" ) ENDIF(APPLE) #Add our source subdirs ADD_SUBDIRECTORY(scribus) #Install our READMEs etc. INSTALL(FILES AUTHORS BUILDING ChangeLog ChangeLogSVN COPYING INSTALL NEWS PACKAGING README README.MacOSX README.OS2 TODO DESTINATION ${DOCDIR} ) INSTALL(FILES scribus.xml DESTINATION ${MIMEDIR} ) #KDE workaround until it starts supporting freedesktop spec INSTALL(FILES vnd.scribus.desktop DESTINATION ${MIMELNKDIR} ) #Install the desktop file #INSTALL(FILES #scribus.desktop #DESTINATION ${DESKTOPDIR} #) # If the cmake version includes cpack, use it IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Scribus is an open source publishing application for Linux, Mac OSX and Windows") SET(CPACK_PACKAGE_VENDOR "Scribus Team") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README") SET(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}") SET(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}") SET(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Scribus ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") SET(CPACK_PACKAGE_EXECUTABLES "scribus${TAG_VERSION}") SET(CPACK_SOURCE_PACKAGE_FILE_NAME "scribus-${VERSION}") SET(CPACK_SOURCE_GENERATOR TBZ2) ## I'll make this prettier later - ignore any tarballs in the root SET(CPACK_SOURCE_IGNORE_FILES CMakeCache.txt scribus-1.3.3.12.tar.bz2 scribus-1.3.3.12.tar.Z scribus-1.3.3.12.tar.gz "~$" "\\\\.cvsignore$" "^${PROJECT_SOURCE_DIR}.*/CVS/" "^${PROJECT_SOURCE_DIR}/debian/" "^${PROJECT_SOURCE_DIR}/old/" "^${PROJECT_SOURCE_DIR}.*/CVSROOT/" "^${PROJECT_SOURCE_DIR}.*/autom4te.cache/") INCLUDE(CPack) ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")