View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016064 | Scribus | Build System | public | 2020-02-29 22:27 | 2020-03-01 11:19 |
Reporter | nsufba | Assigned To | jghali | ||
Priority | normal | Severity | block | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Product Version | 1.4.8.svn | ||||
Summary | 0016064: cmake fails | ||||
Description | Error: -------------------------------------------------------------------------------- CMake Error at CMakeLists.txt:737 (find_package): By not providing "FindQt5OpenGL.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5OpenGL", but CMake did not find one. Could not find a package configuration file provided by "Qt5OpenGL" (requested version 5.7.0) with any of the following names: Qt5OpenGLConfig.cmake qt5opengl-config.cmake Add the installation prefix of "Qt5OpenGL" to CMAKE_PREFIX_PATH or set "Qt5OpenGL_DIR" to a directory containing one of the above files. If "Qt5OpenGL" provides a separate development package or SDK, be sure it has been installed. ---------------------------------------------------------------------------------- 'Qt5OpenGLConfig.cmake' located on other disk: /media/user/other_disk/QTAPI/5.10.0/gcc_64/lib/cmake/Qt5OpenGL | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
For building 1.4.x, you need Qt4 not Qt5. |
|
How did you know that version 1.4 can't be compiled with QT5? The distribution's BUILDING file states in the Requirements: Qt >= 4.6.0 (Scribus has specific code requiring Qt 4.6, not Qt 4.5.x or before) Not a word nor a sign about QT5. I only realised that when made a mistake following the BUILDING instructions. However, the 4th version is not suitable for work, it does not import vector graphics. Neither 1.4.6. which is in the repository, nor 1.4.8. which is still missing from the Linux Mint repository. So I tried to build version 1.5.5., but compiler does not see my QT5 on another disk. May be you know how to correct the 'CMakeLists.txt' so that it sights 'Qt5OpenGLConfig.cmake' on particular location? BUILDING (11,548 bytes)
CMake Build ==================== Scribus 1.3.5+ has replaced the traditionally used so called autotools with the CMake build system (cmake.org). Please see install4.html in scribus/doc for details *after* reviewing the build requirements below. Note that while a QMake project file (Scribus.pro) is provided in the Scribus source distribution, it is not possible to build Scribus with this project file. It is only used for generating the translation template files. REQUIREMENTS AND BUILDING - Microsoft Windows ============================================= See the separate file BUILDING_win32.txt REQUIREMENTS AND BUILDING - Geneiric *BSD/Linux/*nix ==================================================== These requirements are generic information for any BSD, UNIX or Linux flavour. More specific information for particular Linux distros, including lists of exact package names for the distro, are provided below. Install the below packages BEFORE running CMake or compiling Scribus: Requirements: Qt >= 4.6.0 (Scribus has specific code requiring Qt 4.6, not Qt 4.5.x or before) Freetype >= 2.1.7 (2.3.x strongly recommended) cairo >= 1.4.x libtiff >= 3.6.0 LittleCMS (liblcms) = 1.12 (1.18+ recommended) or LittleCMS 2 (liblcms2) >= 2.1 libjpeg (depending on how Qt is packaged) libpng CUPS Fontconfig >= 2.0 LibXML2 >= 2.6.0 Recommended: GhostScript >= 8.0 (8.6+ or greater preferred) Python >= 2.3 tkinter for the font sampler script python-imaging or python-pillow for the font sampler preview pkgconfig (to assist finding other libraries) apspell for the spell checker podofo - 0.7.0+ for enhanced Illustrator AI/EPS import boost and boost-devel - needed for some advanced vector format display If any recommended libraries (and their dev/devel packages or headers) are not installed, some features will be disabled by cmake. If you later install any of these dependencies, you will have to re-run cmake and re-compile Scribus before the features are enabled. LIBRARIES IN NON-STANDARD LOCATIONS =================================== You can skip this section unless: (a) You have libraries installed in unusual locations such as your home directory or an add-in package collection (eg fink); or (b) Scribus is not finding libraries that you KNOW you have installed (remember the -dev/-devel package if applicable). If any of your libraries are in non-standard locations you will need to provide some extra arguments to CMake to ensure that CMake and gcc can find all the required files. Where /path/to/libfoo is the path to the the directory the library was installed to, eg /usr/local or /home/fred/libfoo (not the 'lib' subdirectory the actual .so files are in), you can use the following extra arguments to CMake to help it find the library: -DCMAKE_INCLUDE_PATH=/path/to/libfoo/include -DCMAKE_LIBRARY_PATH=/path/to/libfoo/lib If you have multiple custom paths to specify, use a ; path separator, eg: -DCMAKE_INCLUDE_PATH=/path/to/libfoo/include;/path/to/libalice/include In most cases you should not and should not need to modify the CFLAGS, CXXFLAGS, LIBRARY_PATH, LD_LIBRARY_PATH, CPATH, or LDFLAGS environment variables. If you need to alter these to get Scribus to build, please file a bug on http://bugs.scribus.net/ with information about your exact Scribus version (including Subversion revision), full CMake command line, output of the `env' command, and the full compiler error messages including the original compiler command obtained by running `make' with the VERBOSE=1 argument. CMake will try to embed the paths to the required libraries into the executable,so you should generally not need to set the LD_LIBRARY_PATH environment variable or your platform's equivalent. On platforms like win32 where no such rpath support exists, you will need to ensure that the libraries required by Scribus are on the library search path. For Windows, the library search path is the PATH environment variable. REQUIREMENTS - DETAILS ====================== Qt 4.6 is now the *minimum*. Older versions of Qt are *not* supported. If you build Qt from sources, the recommended ./configure/cmake switches are the same as used by KDE. Use of other switches aside from those used by distro packages can make trouble shooting issues very difficult at times. See: http://developer.kde.orgb/uild/compile_kde3_3.html Scribus requires Freetype. If you are compiling from source, you will need to have the freetype headers installed - these can usually be found in a -devel package for your distro. It is strongly recommended that you install the CUPS development packages if you are compiling Scribus. Without CUPS, Scribus will have significantly reduced printing functionality and building without CUPS is poorly tested. Fontconfig, if installed, will let Scribus find fonts using the same method as most other major desktop applications such as all KDE and GNOME applications. If fontconfig support is installed, Scribus will not search your X font path, X server configuration, or X font server configuration for fonts - it will only use fonts found using fontconfig and any custom font locations configured in the preferences. Use of fontconfig is strongly recommended and will soon be required on supporting platforms. Python is used to add scripting support to Scribus. If Python is not found, or there are no header files for Python installed (usually because you haven't installed the development package), the scripting support will not be enabled. See the distro-specific notes below for more information on installing and using Scribus with your distro. TROUBLESHOOTING =============== If Scribus can't find a library, there are several things you should do. First of all, read `DISTRO SPECIFIC BUILD INFORMATION' below and see if there's anything there for your OS / distro. Next, ensure you definitely have the library installed, as well as any additional development packages that may be required to use it. On Linux, make sure to install the "-dev" or "-devel" package for the missing library. After doing this, re-run cmake. If the library is still not found, please read and act on the section above, entitled `LIBRARIES IN NONSTANDARD LOCATIONS'. Check that all those environment variables are set to sensible values. If you are using any other custom CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS, etc, then unset or disable them unless you're really sure you know what you're doing. This is doubly true for "optimisation" flags like -mcpu and -march . If you're still unable to determine what the problem is, please post a message to the Scribus mailing list or report a bug on bugs.scribus.net. In any problem report, MAKE SURE YOU INCLUDE THE FOLLOWING INFORMATION: - Your CMakeCache.txt - The exact CMake command you ran - The output of the `env' command - A full listing of the compile command and compiler error messages, obtained by running `make' with VERBOSE=1 . - Operating system or distro, eg "Mac OS X" or "Debian Linux" - OS or distro version, eg "Panther" or "Fedora Core 10". This is NOT the Linux kernel version, though you can provide that too. - Scribus version you're trying to compile, eg "1.3.8" or "1.5.0.svn". If you're building an SVN version, please make sure you've run "svn revert -R ." (this WILL erase any patches / custom changes you've made), deleted the CMake cache with `rm -f CMakeCache.txt' and re-built before reporting a problem. Include the output of `svn info' in your bug report if you are using a svn version. - What compiler & version you're using. You can get this from `gcc --version'. if you're using gcc. - If you're having problems with a particular library, what version of the library you have installed and where you got it from. eg: "freetype 2.0.1 from sunfreeware," "LittleCMS 1.1.4, compiled myself and installed in /usr/local", "freetype 2.1.3 from backports.org", "fontconfig 2.2.0 (stock Fedora Core 3 devel package)" "I installed the qt-3.0.1.rpm and qt-devel-3.0.1.rpm from the CD." - Check again to make REALLY REALLY SURE you have the devel package installed, and list the names of the relevant installed devel packages in your problem report. - Any environment variables you may have set - Anything else you can think of that might be useful. There's no such thing as too much information, though please put big files elsewhere rather than sending them to the mailing list. It's best if you do a search of the mailing list archives and/or bugs.scribus.net before reporting a problem, too. This is doubly true for development versions of Scribus. DISTRO SPECIFIC BUILD INFORMATION ================================= This section contains information about compiling Scribus that's specific to particular operating systems and Linux distros. More distro-specific information can be found in the README. Debian ====== Recommended packages for compiling from source on Etch (Debian 4.0): libqt4-dev (Required) libcairo2-dev (Required) libcupsys2-dev (Required) libfontconfig1-dev (Required) libfreetype6-dev (Required) liblcms1-dev (Required, use liblcms2-dev if possible) libtiff4-dev (Required) libxml2-dev (Required) libboost-dev libpodofo-dev python2.3-dev or python2.4-dev gs-gpl or gs-afpl (usually gs-gpl is newer now) You are unlikely to be able to compile Scribus 1.3.x on Debian 3.0 (Woody) or Debian 3.1 (Sarge) without significant upgrades; it is not at all recommended. Scribus 1.3.x should be considered not to support Debian Woody, with versions above 1.3.5 unsupported on Sarge as well. More info can be found in the README. Red Hat / Fedora / CentOS ========================= Recommended packages for compiling from source on Fedora/CentOS/RHEL libstdc++-devel (Required) gcc-c++ (Required) qt4-devel (Required) cairo-devel (Required) cups-devel (Required) fontconfig-devel (Required) freetype-devel (Required) lcms-devel (Required, use lcms2-devel if possible) libjpeg-devel (Required) libtiff-devel (Required) libxml2-devel (Required) boost-devel hunspell-devel podofo-devel python-devel You can install these packages with 'yum install packagename' as root. More info can be found in the README. Suse/Opensuse ============= Recommended packages for compiling from source on SuSE 11.x: qt4-devel (required) cairo-devel (required) cups-devel (required) fontconfig-devel (required) freetype2-devel (required) libjpeg-devel (required) liblcms-devel (required) libtiff-devel (required) libxml2-devel (required) openssl-devel (required if CUPS support is needed) boost-devel hunspell-devel libpodofo-devel python-devel python-imaging tk update-desktop-files You can install these packages using YaST. You may find it difficult to compile Scribus 1.3.9+ on anything older than Suse 11.3. Please note we do provide frequently updated packages on the Suse Build Server at http//software.opensuse.org Mac OS X ======== There is a separate document for building on OSX. The Scribus build system can be used to create native dmg installers for OSX. Microsoft Windows ================= No build instructions yet. Please see the README for info on Scribus under Windows. Other distros/OSes ================== Please feel free to submit a list of package names and versions required to compile Scribus on your distro, or build instructions for your OS. CMakeLists.txt (41,103 bytes)
############################################################################################################## ########## CMake Setup ########## #Set our CMake minimum version #Require 2.8.9 for Qt5 and CMAKE_POSITION_INDEPENDENT_CODE property #Require 3.1.0 for Qt 5.7 C++ 11 easy support #Require 3.2.0 for add_custom_target with byproducts cmake_minimum_required(VERSION 3.2.0 FATAL_ERROR) # Configure CCache if available and wanted if (WANT_CCACHE) find_program(CCACHE_FOUND ccache) if(CCACHE_FOUND) message(STATUS "Enabling ccache") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif() endif() #Pretty colors set(CMAKE_COLOR_MAKEFILE ON) #Don't force verbose set(CMAKE_VERBOSE_MAKEFILE OFF) #Include current dir set(CMAKE_INCLUDE_CURRENT_DIR ON) #Don't allow in source builds #set(CMAKE_DISABLE_SOURCE_CHANGES ON) #set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) #RPATH setup - more below too if (WANT_NORPATH OR WANT_DISTROBUILD) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) else() set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) endif() set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_SKIP_RULE_DEPENDENCY TRUE) set(CMAKE_SKIP_BUILD_RPATH TRUE) include(CheckIncludeFile) include(CheckCCompilerFlag) include(CheckCXXCompilerFlag) include(CheckTypeSize) include(TestBigEndian) include(GNUInstallDirs) #include(FeatureSummary) #enable_testing() #Set the custom CMake module directory where our include/lib finders are set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") ############################################################################################################## ########## toplevel compiler flags ########## message(STATUS "Shared Library Flags: ${CMAKE_SHARED_LIBRARY_C_FLAGS}") #Project Setup project(scribus) #Set our version values #Final version is ${VERSION} = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_SUFFIX} #where VERSION_SUFFIX is of the form "", "svn" or "Nsvn" (N being the minor patch level) set (VERSION_MAJOR "1") set (VERSION_MINOR "5") set (VERSION_PATCH "5") set (VERSION_SUFFIX "") set (VERSION ${VERSION_MAJOR}) if (VERSION_MINOR GREATER -1) set (VERSION ${VERSION}.${VERSION_MINOR}) endif() if (VERSION_PATCH GREATER -1) set (VERSION ${VERSION}.${VERSION_PATCH}) endif() if (VERSION_SUFFIX) set (VERSION ${VERSION}.${VERSION_SUFFIX}) endif() message(STATUS "Scribus ${VERSION} will be built and installed into ${CMAKE_INSTALL_PREFIX}") #Set the permissions to be used when installing plugins set(PLUGIN_PERMISSIONS WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE WORLD_READ GROUP_READ OWNER_READ OWNER_WRITE) #Our main directory is scribus 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 ) ## Find out what machine/cpu we are running on message(STATUS "Machine: ${MACHINE}, void pointer size: ${CMAKE_SIZEOF_VOID_P}") string(REGEX MATCH "(i[0-9]86-*)|(athlon-*)|(pentium-*)" _machine_x86 "${MACHINE}") if (_machine_x86) message(STATUS "Found target X86") set(ARCH_X86 ON) endif() 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 ON) endif() string(REGEX MATCH "(sparc64-*)|(SPARC64-*)" _machine_sparc_64 "${MACHINE}") if (_machine_sparc_64) message(STATUS "Found target SPARC 64") set(ARCH_SPARC_64 ON) endif() string(REGEX MATCH "(mips64-*)|(MIPS64-*)" _machine_mips_64 "${MACHINE}") if (_machine_mips_64) message(STATUS "Found target MIPS 64") set(ARCH_MIPS_64 ON) endif() string(REGEX MATCH "(ppc-*)|(powerpc-*)" _machine_ppc "${MACHINE}") if (_machine_ppc) message(STATUS "Found target PPC") set(ARCH_PPC ON) endif() string(REGEX MATCH "(ppc64-*)|(PPC64-*)|(powerpc64-*)" _machine_ppc_64 "${MACHINE}") if (_machine_ppc_64) message(STATUS "Found target PPC64") set(ARCH_PPC_64 ON) endif() string(REGEX MATCH "(sparc-*)" _machine_sparc "${MACHINE}") if (_machine_sparc) message(STATUS "Found target Sparc") set(ARCH_SPARC ON) endif() string(REGEX MATCH "(sparcv9-*)" _machine_sparcv9 "${MACHINE}") if (_machine_sparcv9) message(STATUS "Found target Sparc v9") set(ARCH_SPARCV9 ON) endif() string(REGEX MATCH "(sparc64-*)" _machine_sparc64 "${MACHINE}") if (_machine_sparc64) message(STATUS "Found target Sparc64") set(ARCH_SPARC64 ON) set(ARCH64BIT ON) endif() string(REGEX MATCH "(hppa*)" _machine_hppa "${MACHINE}") if (_machine_hppa) message(STATUS "Found target Hppa") set(ARCH_HPPA ON) endif() # We need to pass -fPIC to lib2geom on amd64, mips, mipsel, and hppa. See: # http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3 and # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559133 set(CMAKE_POSITION_INDEPENDENT_CODE ON) ## Do our Apple OSX version setup if ((APPLE) AND (CMAKE_SIZEOF_VOID_P EQUAL 8) AND (ARCH_X86 OR ARCH_X86_64)) string(REGEX REPLACE ".*-darwin([0-9]+).*" "\\1" _apple_ver "${MACHINE}") if (_apple_ver EQUAL "19") message(STATUS "Found macOS Catalina Target: Apple, 64 bit, X86") set(APPLE_10_15_X ON CACHE BOOL "Found macOS Catalina Target: Apple, 64 bit, X86") endif() if (_apple_ver EQUAL "18") message(STATUS "Found macOS Mojave Target: Apple, 64 bit, X86") set(APPLE_10_14_X ON CACHE BOOL "Found macOS Mojave Target: Apple, 64 bit, X86") endif() if (_apple_ver EQUAL "17") message(STATUS "Found macOS High Sierra Target: Apple, 64 bit, X86") set(APPLE_10_13_X ON CACHE BOOL "Found macOS High Sierra Target: Apple, 64 bit, X86") endif() if (_apple_ver EQUAL "16") message(STATUS "Found macOS Sierra Target: Apple, 64 bit, X86") set(APPLE_10_12_X ON CACHE BOOL "Found macOS Sierra Target: Apple, 64 bit, X86") endif() if (_apple_ver EQUAL "15") message(STATUS "Found OSX El Capitan Target: Apple, 64 bit, X86") set(APPLE_10_11_X ON CACHE BOOL "Found OSX El Capitan Target: Apple, 64 bit, X86") endif() if (_apple_ver EQUAL "14") message(STATUS "Found OSX Yosemite Target: Apple, 64 bit, X86") set(APPLE_10_10_X ON CACHE BOOL "Found OSX Yosemite Target: Apple, 64 bit, X86") endif() if (_apple_ver EQUAL "13") message(STATUS "Found OSX Mavericks Target: Apple, 64 bit, X86") set(APPLE_10_9_X ON CACHE BOOL "Found OSX Mavericks Target: Apple, 64 bit, X86") endif() if (_apple_ver EQUAL "12") message(STATUS "Found OSX Mountain Lion Target: Apple, 64 bit, X86") set(APPLE_10_8_X ON CACHE BOOL "Found OSX Mountain Lion Target: Apple, 64 bit, X86") endif() if (_apple_ver EQUAL "11") message(STATUS "Found OSX Lion Target: Apple, 64 bit, X86") set(APPLE_10_7_X ON CACHE BOOL "Found OSX Lion Target: Apple, 64 bit, X86") endif() if (_apple_ver EQUAL "10") message(STATUS "Found OSX Snow Leopard Target: Apple, 64 bit, X86") set(APPLE_10_6_X ON CACHE BOOL "Found OSX Snow Leopard Target: Apple, 64 bit, X86") endif() if (_apple_ver EQUAL "9") message(STATUS "Found OSX Leopard Target: Apple, 32 bit, X86") set(APPLE_10_5_X ON CACHE BOOL "Found OSX Leopard Target: Apple, 32 bit, X86") endif() unset(ARCH_X86) endif() #convert any 64 bit build into generic 64 tag for below if (ARCH_X86_64 OR ARCH_SPARC_64 OR ARCH_MIPS_64 OR ARCH_PPC_64) set(ARCH64BIT ON) endif() message(STATUS "Building for target ${MACHINE}") ############################################################################################################## ########## Relocatability ########## if (APPLEBUNDLE OR WIN32) if (WANT_RELOCATABLE) message(STATUS "Ignoring relocatable option on Win32 or OSX when building bundle") set(WANT_RELOCATABLE OFF) endif() endif() if (WANT_RELOCATABLE) message(STATUS "Enabling relocatable binaries") set(WANT_RELOCATABLE ON CACHE BOOL "Enable relocatable binaries") add_definitions(-DWANT_RELOCATABLE) endif() ############################################################################################################## ########## Versioning Setup ########## #On Apple, we ignore the versioning tag so all items are "scribus" not "scribus-version" if (NOT BUILD_OSX_BUNDLE) set(BUILD_OSX_BUNDLE ${APPLE} CACHE BOOL "Building MacOS X Bundle") endif() #Simplify future conditionals for Apple if (APPLE AND BUILD_OSX_BUNDLE) set(APPLEBUNDLE ON CACHE BOOL "Building Apple Bundle") endif() #Announce we cached a version request before, overridden below for OSX if(TAG_VERSION) if (NOT APPLEBUNDLE) message(STATUS "Previously selected version tag: ${TAG_VERSION}") endif() set(WANT_VERSIONING ON) set(CACHED_VERSIONING ON) endif() #Remove version tags on OSX so our bundle is Scribus.app if (APPLEBUNDLE OR WIN32) if (WANT_VERSIONING OR CACHED_VERSIONING) message(STATUS "Ignoring version tag on Win32 or OSX when building bundle") set(WANT_VERSIONING OFF) set(CACHED_VERSIONING OFF) endif() endif() #Store our version string if required if (WANT_VERSIONING AND NOT CACHED_VERSIONING) if (NOT CUSTOM_VERSIONTAG) set(TAG_VERSION "-${VERSION}" CACHE STRING "Version string") else() set(TAG_VERSION ${CUSTOM_VERSIONTAG} CACHE STRING "Version string") endif() endif() ############################################################################################################## ########## Install/Directory Setup ########## if (APPLEBUNDLE) set (APPLE_APP_DIR "${CMAKE_INSTALL_PREFIX}") if ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/Contents/?$") # all ok else() if ("${CMAKE_INSTALL_PREFIX}" MATCHES "[.]app/?$") # add "/Contents" subpath set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/Contents") else() # no bundle name spcified, use appname and version set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/Scribus${VERSION}.app/Contents") endif() endif() message(STATUS "APPLEBUNDLE install prefix: ${APPLE_APP_DIR}") endif() #Setup all the directories we will use #cmake_policy(SET CMP0005 OLD) #SHARE if(WANT_VERSIONING) set(SHAREDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}${TAG_VERSION}/") else() set(SHAREDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}/") endif() if(IS_ABSOLUTE ${SHAREDIR} AND WANT_RELOCATABLE) message(FATAL_ERROR "ERROR: SHAREDIR must be relative when using WANT_RELOCATABLE option") elseif(NOT IS_ABSOLUTE ${SHAREDIR} AND NOT WANT_RELOCATABLE) add_definitions(-DSHAREDIR="${CMAKE_INSTALL_PREFIX}/${SHAREDIR}") else() add_definitions(-DSHAREDIR="${SHAREDIR}") endif() #SHARE - use the default on Apple as TAG_VERSION is empty if(WIN32 OR OS2) set(DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/") elseif(TAG_VERSION OR BUILD_OSX_BUNDLE) set(DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${MAIN_DIR_NAME}${TAG_VERSION}/") elseif(NOT WANT_VERSIONING) set(DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${MAIN_DIR_NAME}/") else() set(DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${MAIN_DIR_NAME}-${VERSION}/") endif() if(IS_ABSOLUTE ${DOCDIR} AND WANT_RELOCATABLE) message(FATAL_ERROR "ERROR: DOCDIR must be relative when using WANT_RELOCATABLE option") elseif(NOT IS_ABSOLUTE ${DOCDIR} AND NOT WANT_RELOCATABLE) add_definitions(-DDOCDIR="${CMAKE_INSTALL_PREFIX}/${DOCDIR}") else() add_definitions(-DDOCDIR="${DOCDIR}") endif() #ICONS if(WIN32) set(ICONDIR "${CMAKE_INSTALL_DATAROOTDIR}/icons/") else() set(ICONDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}${TAG_VERSION}/icons/") endif() if(IS_ABSOLUTE ${ICONDIR} AND WANT_RELOCATABLE) message(FATAL_ERROR "ERROR: ICONDIR must be relative when using WANT_RELOCATABLE option") elseif(NOT IS_ABSOLUTE ${ICONDIR} AND NOT WANT_RELOCATABLE) add_definitions(-DICONDIR="${CMAKE_INSTALL_PREFIX}/${ICONDIR}") else() add_definitions(-DICONDIR="${ICONDIR}") endif() #SAMPLES if(WIN32) set(SAMPLESDIR "${CMAKE_INSTALL_DATAROOTDIR}/samples/") else() set(SAMPLESDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}${TAG_VERSION}/samples/") endif() if(IS_ABSOLUTE ${SAMPLESDIR} AND WANT_RELOCATABLE) message(FATAL_ERROR "ERROR: SAMPLESDIR must be relative when using WANT_RELOCATABLE option") elseif(NOT IS_ABSOLUTE ${SAMPLESDIR} AND NOT WANT_RELOCATABLE) add_definitions(-DSAMPLESDIR="${CMAKE_INSTALL_PREFIX}/${SAMPLESDIR}") else() add_definitions(-DSAMPLESDIR="${SAMPLESDIR}") endif() #SCRIPTS if(WIN32) set(SCRIPTSDIR "${CMAKE_INSTALL_DATAROOTDIR}/scripts/") else() set(SCRIPTSDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}${TAG_VERSION}/scripts/") endif() if(IS_ABSOLUTE ${SCRIPTSDIR} AND WANT_RELOCATABLE) message(FATAL_ERROR "ERROR: SCRIPTSDIR must be relative when using WANT_RELOCATABLE option") elseif(NOT IS_ABSOLUTE ${SCRIPTSDIR} AND NOT WANT_RELOCATABLE) add_definitions(-DSCRIPTSDIR="${CMAKE_INSTALL_PREFIX}/${SCRIPTSDIR}") else() add_definitions(-DSCRIPTSDIR="${SCRIPTSDIR}") endif() #TEMPLATES if(WIN32) set(TEMPLATEDIR "${CMAKE_INSTALL_DATAROOTDIR}/templates/") else() set(TEMPLATEDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}${TAG_VERSION}/templates/") endif() if(IS_ABSOLUTE ${TEMPLATEDIR} AND WANT_RELOCATABLE) message(FATAL_ERROR "ERROR: TEMPLATEDIR must be relative when using WANT_RELOCATABLE option") elseif(NOT IS_ABSOLUTE ${TEMPLATEDIR} AND NOT WANT_RELOCATABLE) add_definitions(-DTEMPLATEDIR="${CMAKE_INSTALL_PREFIX}/${TEMPLATEDIR}") else() add_definitions(-DTEMPLATEDIR="${TEMPLATEDIR}") endif() #QML if(WIN32) set(QMLDIR "${CMAKE_INSTALL_DATAROOTDIR}/qml/") else() set(QMLDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}${TAG_VERSION}/qml/") endif() if(IS_ABSOLUTE ${QMLDIR} AND WANT_RELOCATABLE) message(FATAL_ERROR "ERROR: QMLDIR must be relative when using WANT_RELOCATABLE option") elseif(NOT IS_ABSOLUTE ${QMLDIR} AND NOT WANT_RELOCATABLE) add_definitions(-DQMLDIR="${CMAKE_INSTALL_PREFIX}/${QMLDIR}") else() add_definitions(-DQMLDIR="${QMLDIR}") endif() #DESKTOP set(DESKTOPDIR "${CMAKE_INSTALL_DATAROOTDIR}/applications/") if(IS_ABSOLUTE ${DESKTOPDIR} AND WANT_RELOCATABLE) message(FATAL_ERROR "ERROR: DESKTOPDIR must be relative when using WANT_RELOCATABLE option") elseif(NOT IS_ABSOLUTE ${DESKTOPDIR} AND NOT WANT_RELOCATABLE) add_definitions(-DDESKTOPDIR="${CMAKE_INSTALL_PREFIX}/${DESKTOPDIR}") else() add_definitions(-DDESKTOPDIR="${DESKTOPDIR}") endif() #APPDATA set(APPDATADIR "${CMAKE_INSTALL_DATAROOTDIR}/metainfo/") if(IS_ABSOLUTE ${APPDATADIR} AND WANT_RELOCATABLE) message(FATAL_ERROR "ERROR: APPDATADIR must be relative when using WANT_RELOCATABLE option") elseif(NOT IS_ABSOLUTE ${APPDATADIR} AND NOT WANT_RELOCATABLE) add_definitions(-DAPPDATADIR="${CMAKE_INSTALL_PREFIX}/${APPDATADIR}") else() add_definitions(-DAPPDATADIR="${APPDATADIR}") endif() # APPLICATION_DATA_DIR # It allows specify the user configuration directory in the compile time. # Example: I want to use special ~/.scribus135svn config directory for my trunk # cmake -DAPPLICATION_DATA_DIR=.scribus135svn ... if (APPLICATION_DATA_DIR) message(STATUS "Using ApplicationDataDir ${APPLICATION_DATA_DIR} instead of the platform default.") add_definitions(-DAPPLICATION_DATA_DIR="${APPLICATION_DATA_DIR}") else() message(STATUS "Using standard ApplicationDataDir. You can change it with -DAPPLICATION_DATA_DIR") endif() if (APPLICATION_CONFIG_DIR) message(STATUS "Using ApplicationConfigDir ${APPLICATION_CONFIG_DIR} instead of the platform default.") add_definitions(-DAPPLICATION_CONFIG_DIR="${APPLICATION_CONFIG_DIR}") else() message(STATUS "Using standard ApplicationConfigDir. You can change it with -DAPPLICATION_CONFIG_DIR") endif() #LIB LOCATION - lib or lib64 normally #LIB if(WANT_LIB64) if(NOT ARCH_X86_64) message(STATUS "WARNING: BUILDING 64 Bit build on non 64 bit architecture") endif() set(LIB_SUFFIX "64" CACHE STRING "Library directory suffix") endif() set(LIB_DIR_NAME "lib${LIB_SUFFIX}") if (APPLEBUNDLE) set(LIBDIR "lib/") else() set(LIBDIR "${LIB_DIR_NAME}/${MAIN_DIR_NAME}${TAG_VERSION}/") endif() if(IS_ABSOLUTE ${LIBDIR} AND WANT_RELOCATABLE) message(FATAL_ERROR "ERROR: LIBDIR must be relative when using WANT_RELOCATABLE option") elseif(NOT IS_ABSOLUTE ${LIBDIR} AND NOT WANT_RELOCATABLE) add_definitions(-DLIBDIR="${CMAKE_INSTALL_PREFIX}/${LIBDIR}") else() add_definitions(-DLIBDIR="${LIBDIR}") endif() #PLUGINS if(WIN32) set(PLUGINDIR "plugins") elseif (APPLEBUNDLE) set(PLUGINDIR "${LIBDIR}") else() set(PLUGINDIR "${LIB_DIR_NAME}/${MAIN_DIR_NAME}${TAG_VERSION}/plugins/") endif() if(IS_ABSOLUTE ${PLUGINDIR} AND WANT_RELOCATABLE) message(FATAL_ERROR "ERROR: PLUGINDIR must be relative when using WANT_RELOCATABLE option") elseif(NOT IS_ABSOLUTE ${PLUGINDIR} AND NOT WANT_RELOCATABLE) add_definitions(-DPLUGINDIR="${CMAKE_INSTALL_PREFIX}/${PLUGINDIR}") else() add_definitions(-DPLUGINDIR="${PLUGINDIR}") endif() #INCLUDE set(INCLUDEDIR "include/${MAIN_DIR_NAME}${TAG_VERSION}/") #NO ADD DEFINITIONS, WE ONLY INSTALL WITH IT #RPATH if (WANT_NORPATH OR WANT_DISTROBUILD) set(CMAKE_INSTALL_RPATH "") else() set(CMAKE_INSTALL_RPATH ${PLUGINDIR}) endif() # Set the XDG mime stuff set(MIMEDIR "${CMAKE_INSTALL_DATAROOTDIR}/mime/packages/") ############################################################################################################## ########## Build Setup ########## #Convert our simpler command line option to the CMake style #None, Debug, Release, .. or custom ones # set(WANT_DEBUG ON) if(WANT_DEBUG) set(CMAKE_BUILD_TYPE Debug) endif() if (WANT_RELEASEWITHDEBUG) set(CMAKE_BUILD_TYPE RelWithDebInfo) endif() if(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG) set(CMAKE_BUILD_TYPE RELEASE) endif() #Based on our build type, setup our build options if(APPLE) if(APPLE_10_15_X) set(OSXMINVER "10.15" CACHE STRING "OSX 10.15") if (WANT_OSX_SDK) if(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk")) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk") elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk")) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk") endif() endif() endif() if(APPLE_10_14_X) set(OSXMINVER "10.14" CACHE STRING "OSX 10.14") if (WANT_OSX_SDK) if(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk")) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk") elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk")) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk") endif() endif() endif() if(APPLE_10_13_X) set(OSXMINVER "10.13" CACHE STRING "OSX 10.13") if (WANT_OSX_SDK) if(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk")) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk") elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk")) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk") endif() endif() endif() if(APPLE_10_12_X) set(OSXMINVER "10.12" CACHE STRING "OSX 10.12") if (WANT_OSX_SDK) if(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk")) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk") elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk")) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk") endif() endif() endif() if(APPLE_10_11_X) set(OSXMINVER "10.11" CACHE STRING "OSX 10.11") if (WANT_OSX_SDK) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk") endif() endif() if(APPLE_10_10_X) set(OSXMINVER "10.10" CACHE STRING "OSX 10.10") set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10") if (WANT_OSX_SDK) if(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk")) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk") elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk")) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk") endif() endif() endif() if(APPLE_10_9_X) set(OSXMINVER "10.9" CACHE STRING "OSX 10.9") if (WANT_OSX_SDK) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk") endif() endif() if(APPLE_10_8_X) set(OSXMINVER "10.8" CACHE STRING "OSX 10.8") if (WANT_OSX_SDK) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk") endif() endif() if(APPLE_10_7_X) set(OSXMINVER "10.7" CACHE STRING "OSX 10.7") if (WANT_OSX_SDK) set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk") endif() endif() if(APPLE_10_6_X) set(OSXMINVER "10.6" CACHE STRING "OSX 10.6") if (WANT_OSX_SDK) set(CMAKE_OSX_SYSROOT "/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk") endif() endif() if(APPLE_10_5_X) set(OSXMINVER "10.5" CACHE STRING "OSX 10.5") if (WANT_OSX_SDK) set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk") endif() endif() if(APPLE_10_4_X) set(OSXMINVER "10.4" CACHE STRING "OSX 10.4") if (WANT_OSX_SDK) set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk") endif() endif() # gcc/mac if(WANT_UNIVERSAL_BUNDLE) message("Setting Universal (PPC/i386) Architecture for OSX Build/Bundle") set(CMAKE_OSX_ARCHITECTURES "ppc;i386" ) set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "ppc;i386" ) if (WANT_OSX_SDK) set(CMAKE_OSX_DEPLOYMENT_TARGET "10.4") endif() else() if(ARCH_PPC OR ARCH_PPC_64) message("Setting PPC Architecture for OSX Build/Bundle") set(CMAKE_OSX_ARCHITECTURES "ppc" ) set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "ppc" ) else() if (WANT_OSX_SDK) set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSXMINVER}") endif() if(APPLE_10_6_X OR APPLE_10_7_X OR APPLE_10_8_X OR APPLE_10_9_X OR APPLE_10_10_X OR APPLE_10_11_X OR APPLE_10_12_X OR APPLE_10_13_X OR APPLE_10_14_X OR APPLE_10_15_X) message("Setting x86_64 Architecture for OSX Build/Bundle") set(CMAKE_OSX_ARCHITECTURES "x86_64" ) set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "x86_64" ) else() message("Setting i386 Architecture for OSX Build/Bundle") set(CMAKE_OSX_ARCHITECTURES "i386" ) set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "i386" ) endif() endif() endif() message(STATUS "${CMAKE_OSX_ARCHITECTURES} ${CMAKE_OSX_SYSROOT}") set(ENV{MACOSX_DEPLOYMENT_TARGET} ${OSXMINVER} ) set(ENV{LD_PREBIND} 1 ) set(ENV{LD_PREBIND_ALLOW_OVERLAP} 1 ) if (WANT_DEBUG) set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}") set(CMAKE_C_FLAGS_DEBUG "-O0 -g -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}") endif() if (WANT_RELEASEWITHDEBUG) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}") endif() if (NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG) set(CMAKE_CXX_FLAGS_RELEASE "-O2 -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}") set(CMAKE_C_FLAGS_RELEASE "-O2 -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}") endif() else() if(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*") # Windows build with Visual Studio # Surely there's a better way to identify the compiler? set(CMAKE_CXX_FLAGS_DEBUG) set(CMAKE_C_FLAGS_DEBUG) else() # vanilla gcc set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall -fstrict-aliasing") set(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -fstrict-aliasing") if (_machine_x86 OR _machine_x86_64) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fPIC") endif() endif() endif() if(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*") set(CMAKE_CXX_FLAGS_RELEASE) set(CMAKE_C_FLAGS_RELEASE) else() set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall -fPIC") set(CMAKE_C_FLAGS_RELEASE "-O2 -Wall -fPIC") # add_definitions(-DNDEBUG) endif() if(WIN32) add_definitions(-DWIN32_LEAN_AND_MEAN -DAVOID_WIN32_FILEIO -D_CRT_SECURE_NO_DEPRECATE -D_USE_MATH_DEFINES -DCOMPILE_PLUGIN_AS_DLL ) set(BUILD_WINDOWS_VERSION ON) set(DLL_USE_NATIVE_API ON) endif() ############################################################################################################## ########## Find Dependencies ########## #<< Qt set (QT_MIN_VERSION "5.7.0") set(CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake") set(CMAKE_INCLUDE_CURRENT_DIR ON) find_package(Qt5Core ${QT_MIN_VERSION} REQUIRED) if(Qt5Core_FOUND) message(STATUS "----- USE QT 5-----") else() message(FATAL_ERROR "ERROR: No QT 5 found") endif() find_package(Qt5Widgets ${QT_MIN_VERSION} REQUIRED) if(Qt5Widgets_FOUND) message(STATUS "----- USE QT Widgets-----") else() message(FATAL_ERROR "ERROR: No QT Widgets found") endif() find_package(Qt5Gui ${QT_MIN_VERSION} REQUIRED) if(Qt5Gui_FOUND) message(STATUS "----- USE Qt5Gui -----") else() message(FATAL_ERROR "ERROR: Qt5Gui found") endif() find_package(Qt5Xml ${QT_MIN_VERSION} REQUIRED) if(Qt5Xml_FOUND) message(STATUS "----- USE QT 5 XML -----") else() message(FATAL_ERROR "ERROR: No QT 5 XML found") endif() find_package(Qt5Network ${QT_MIN_VERSION} REQUIRED) if(Qt5Network_FOUND) message(STATUS "----- USE Qt5Network -----") else() message(FATAL_ERROR "ERROR: No Qt5Network found") endif() find_package(Qt5OpenGL ${QT_MIN_VERSION} REQUIRED) if(Qt5OpenGL_FOUND) message(STATUS "----- USE Qt5OpenGL -----") else() message(FATAL_ERROR "ERROR: No Qt5OpenGL found") endif() find_package(Qt5LinguistTools ${QT_MIN_VERSION} REQUIRED) if(Qt5LinguistTools_FOUND) message(STATUS "----- USE Qt5LinguistTools -----") else() message(FATAL_ERROR "ERROR: No Qt5LinguistTools found") endif() #find_package(Qt5Quick ${QT_MIN_VERSION} REQUIRED) #if(Qt5Quick_FOUND) # message(STATUS "----- USE Qt5Quick -----") #else() # message(FATAL_ERROR "ERROR: No Qt5Quick found") #endif() find_package(Qt5PrintSupport ${QT_MIN_VERSION} REQUIRED) if(Qt5PrintSupport_FOUND) message(STATUS "----- USE Qt5PrintSupport -----") else() message(FATAL_ERROR "ERROR: No Qt5PrintSupport found") endif() include_directories(${Qt5Core_INCLUDE_DIRS}) add_definitions(${Qt5Core_DEFINITIONS}) include_directories(${Qt5Widgets_INCLUDE_DIRS}) add_definitions(${Qt5Widgets_DEFINITIONS}) include_directories(${Qt5Gui_INCLUDE_DIRS}) add_definitions(${Qt5Gui_DEFINITIONS}) include_directories(${Qt5Xml_INCLUDE_DIRS}) add_definitions(${Qt5Xml_DEFINITIONS}) include_directories(${Qt5Network_INCLUDE_DIRS}) add_definitions(${Qt5Network_DEFINITIONS}) include_directories(${Qt5OpenGL_INCLUDE_DIRS}) add_definitions(${Qt5OpenGL_DEFINITIONS}) #include_directories(${Qt5Quick_INCLUDE_DIRS}) #add_definitions(${Qt5Quick_DEFINITIONS}) include_directories(${Qt5PrintSupport_INCLUDE_DIRS}) add_definitions(${Qt5PrintSupport_DEFINITIONS}) message(STATUS "Qt VERSION: ${Qt5Widgets_VERSION}") #if (NOT WANT_CPP11 AND Qt5Widgets_VERSION_MAJOR EQUAL 5 AND Qt5Widgets_VERSION_MINOR GREATER 6) # message(STATUS "Your Qt version is 5.7.0 or superior, enabling C++11 compiler features") # set(WANT_CPP11 ON) #endif() #>> Qt #C++11 Support #as of 1.5.5.svn, require C++11 #if(WANT_CPP11) message(STATUS "Enabling C++11 compiler features") set(CMAKE_CXX_STANDARD 11) #endif() if (WANT_CPP14) message(STATUS "Enabling C++14 compiler features") set(CMAKE_CXX_STANDARD 14) elseif(WANT_CPP17) message(STATUS "Enabling C++17 compiler features") set(CMAKE_CXX_STANDARD 17) endif() #<< ZLIB, PNG if (WIN32) # On win32 we can use Qt's zlib and libpng, so we use some # custom cmake includes. This permits us to honour the # USE_QT_ZLIB_PNGLIB flag if passed. set(PNG_DIR ${CMAKE_MODULE_PATH}) set(ZLIB_DIR ${CMAKE_MODULE_PATH}) endif() find_package(ZLIB REQUIRED) if (ZLIB_FOUND) message("ZLIB Library Found OK") set(HAVE_LIBZ ON) endif() #find_package(PNG REQUIRED) #if (PNG_FOUND) # message("PNG Library Found OK") #endif() #>> ZLIB, PNG if (WANT_NOOSG) message("Building without 3D Extension") else() find_package(OSG) if(OSG_FOUND) message("OSG found OK") set(HAVE_OSG ON) find_package(OpenGL) include(CheckFunctionExists) CHECK_FUNCTION_EXISTS(memrchr HAVE_MEMRCHR) else() message("No OSG found, building without 3D Extension") endif() endif() #<< JPEG, TIFF find_package(JPEG REQUIRED) if (JPEG_FOUND) message("JPEG Library Found OK") endif() find_package(TIFF REQUIRED) if (TIFF_FOUND) message("TIFF Library Found OK") set(HAVE_TIFF ON) else() message(FATAL_ERROR "Could not find the TIFF Library") endif() #<< JPEG, TIFF #<< PYTHON #set(PythonLibs_FIND_VERSION 2) find_package(PythonInterp 2) find_package(PythonLibs 2 REQUIRED) if (PYTHON_LIBRARY) message("Python Library Found OK") set(HAVE_PYTHON ON) set(COMPILE_PYTHON ON) endif() #>> PYTHON #<< FreeType2 find_package(Freetype REQUIRED) if (FREETYPE_FOUND) message(STATUS "FreeType2 Library Found OK") include(CheckLibraryExists) CHECK_LIBRARY_EXISTS(${FREETYPE_LIBRARY} FT_Get_First_Char "" HAVE_FREETYPE_FIRST) CHECK_LIBRARY_EXISTS(${FREETYPE_LIBRARY} FT_Get_Next_Char "" HAVE_FREETYPE_NEXT) # here we have an alternative # a) Setup CFLAGS with the FREETYPE_INCLUDE_DIR_freetype2 provided by cmake # b) Insert ${FREETYPE_INCLUDE_DIRS} in include sections of CMakeLists that need it # I prefer (b) and at some point & from my opinion it should be just needed in scribus/fonts/CmakeLists.txt - pm else() message(FATAL_ERROR "No Freetype Found") endif() #>> FreeType2 #<<Render Library if (WANT_PRIVATE_CAIRO) message("We no longer support the private cairo library as the latest public release is more up to date, setting WANT_SYSTEM_CAIRO=1") endif() if (RENDER_LIB) if (RENDER_LIB STREQUAL "QTARTHUR") message("Qt4's Arthur as renderer is not supported anymore, performing renderer detection again") endif() endif() set(CAIRO_DIR ${CMAKE_MODULE_PATH}) find_package(CAIRO REQUIRED) if(CAIRO_FOUND) message("CAIRO Library Found OK") set(RENDER_LIB "CAIRO_SYSTEM" CACHE STRING "Set render library to cairo") else() message(FATAL_ERROR "No Cairo Found") endif() #>>Render Library #<<CUPS if(NOT WIN32 AND NOT HAIKU) find_package(Cups REQUIRED) if(CUPS_FOUND) set(HAVE_CUPS ON) message("CUPS Library Found OK") endif() else() # Windows doesn't use CUPS set(CUPS_INCLUDE_DIR) endif() #>>CUPS #<<LibXML2 find_package(LibXml2 REQUIRED) if(LIBXML2_FOUND) set(HAVE_XML ON) message("LIBXML2 Library Found OK") endif() #>>LibXML2 #<<LittleCMS set(LCMS_DIR ${CMAKE_MODULE_PATH}) find_package(LCMS2 REQUIRED) if(LCMS2_FOUND) set(HAVE_LCMS2 ON) set(HAVE_CMS ON) set(CMS_INC "\"lcms2.h\"") message("LittleCMS-2 Library Found OK") else() message(FATAL_ERROR "Could not find the LittleCMS 2 Library") endif() #>>LittleCMS #<<FontConfig if(NOT WIN32) set(FONTCONFIG_DIR ${CMAKE_MODULE_PATH}) find_package(FONTCONFIG) if(FONTCONFIG_FOUND) message("FontConfig Found OK") set(HAVE_FONTCONFIG ON) endif() else() # Windows builds neither use nor require fontconfig set(FONTCONFIG_INCLUDE_DIR) endif() #>>FontConfig #<<HUNSPELL for Speelling support option(WANT_HUNSPELL "Enable support for spell checking with hunspell" ON) if (WANT_HUNSPELL) find_package(HUNSPELL) if (HUNSPELL_FOUND) message("Hunspell Found OK") set(HAVE_HUNSPELL ON) else() message("Hunspell or its developer libraries NOT found - Disabling support for spell checking") endif() endif() #>>HUNSPELL for Speelling support #<<PoDoFo for AI PDF import option(WITH_PODOFO "Enable support for PDF embedded in AI" ON) if (WITH_PODOFO) find_package(LIBPODOFO) if (LIBPODOFO_FOUND) message("PoDoFo found OK") set(HAVE_PODOFO ON) else() message("PoDoFo NOT found - Disabling support for PDF embedded in AI") endif() endif() #>>PoDoFo for AI PDF import #<<Boost for 2Geom Tools option(WITH_BOOST "Enable support for Boost based enhancements" ON) if (WITH_BOOST) find_package(Boost) if (Boost_FOUND) message("Boost Library Found OK") set(HAVE_BOOST ON) else() message("Boost: NOT FOUND, not building 2geomtools") endif() endif() #>>Boost for 2Geom Tools #<< GraphicsMagick for image import if (WANT_GRAPHICSMAGICK) set(GMAGICK_DIR ${CMAKE_MODULE_PATH}) pkg_check_modules(GMAGICK GraphicsMagick) # find_package(GMAGICK) if(GMAGICK_FOUND) message(" GraphicsMagick Found OK") else() message(" GraphicsMagick NOT found! Building without additional image format support!") endif() else() message("Building without GraphicsMagick (use -DWANT_GRAPHICSMAGICK=1 to enable)") endif() #>> GraphicsMagick for image import #<<Poppler for PDF import find_package(POPPLER REQUIRED) if (POPPLER_FOUND) set(HAVE_POPPLER ON) message(STATUS "Found poppler") message(STATUS "Found poppler libs: ${POPPLER_LIBRARY}") message(STATUS "Found poppler includes: ${POPPLER_INCLUDE_DIR}") else() message(FATAL_ERROR "Could not find poppler library") endif() #>>Poppler for PDF import # librevenge for MsPub import pkg_check_modules(LIBREVENGE librevenge-0.0) if (LIBREVENGE_FOUND) pkg_check_modules(LIBREVENGE_STREAM librevenge-stream-0.0) if (LIBREVENGE_STREAM_FOUND) pkg_check_modules(LIBREVENGE_GENERATORS librevenge-generators-0.0) if (LIBREVENGE_GENERATORS_FOUND) set(HAVE_REVENGE ON) endif() endif() endif() # CTL support pkg_check_modules(HARFBUZZ REQUIRED harfbuzz>=0.9.42 harfbuzz-icu) pkg_check_modules(ICU REQUIRED icu-uc) ############################################################################################################## ########## Include Setup ########## TEST_BIG_ENDIAN(WORDS_BIGENDIAN) CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) if(HAVE_DLFCN_H) add_definitions(-DHAVE_DLFCN_H) endif() CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) if(HAVE_UNISTD_H) add_definitions(-DHAVE_UNISTD_H) endif() CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) # if(HAVE_SYS_TYPES_H) # add_definitions(-DHAVE_SYS_TYPES_H) # endif() CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) # if(HAVE_SYS_STAT_H) # add_definitions(-DHAVE_SYS_STAT_H) # endif() #>>Test for existing include files #Create configure files.. config.h and uninstall #config.h include (ConfigureChecks.cmake) if(WIN32) set(CONFIG_NAME win-config.h) else() set(CONFIG_NAME config.h) endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) add_definitions(-DHAVE_CONFIG_H) #Set up include dirs with all found packages include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/scribus ${QT_INCLUDES} ${FREETYPE_INCLUDE_DIR} ${FONTCONFIG_INCLUDE_DIR} ${JPEG_INCLUDE_DIR} ${LCMS2_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR} ${TIFF_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${OSG_INCLUDE_DIR} ${GSL_INCLUDE_DIR} ) if (NOT WIN32 AND NOT HAIKU) include_directories( ${CUPS_INCLUDE_DIR} ) endif() ############################################################################################################## ########## Uninstall Setup ########## 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" ) ############################################################################################################## ########## Add our subdirs ########## #Add our source subdirs add_subdirectory(scribus) add_subdirectory(doc) add_subdirectory(resources/dicts) add_subdirectory(resources/editorconfig) add_subdirectory(resources/iconsets) add_subdirectory(resources/keysets) add_subdirectory(resources/loremipsum) add_subdirectory(resources/manpages) add_subdirectory(resources/profiles) add_subdirectory(resources/swatches) add_subdirectory(resources/templates) add_subdirectory(resources/translations) add_subdirectory(resources/unicodemap) #Install our READMEs etc. install(FILES AUTHORS ChangeLog COPYING LINKS README TRANSLATION DESTINATION ${DOCDIR} ) if (APPLE) install(FILES README.MacOSX DESTINATION ${DOCDIR} ) # execute_process (COMMAND mkdir -p "${CMAKE_INSTALL_PREFIX}/PlugIns/imageformats") # if (NOT EXISTS "${CMAKE_INSTALL_PREFIX}/PlugIns/imageformats/libqjpeg.dylib") #message(STATUS ${QT_PREFIX}) #message(STATUS "@QT_PREFIX@/plugins/imageformats/libqjpeg.dylib") #message(STATUS "${CMAKE_INSTALL_PREFIX}/PlugIns/imageformats/libqjpeg.dylib") # execute_process (COMMAND ditto "@QT_PREFIX@/plugins/imageformats/libqjpeg.dylib" "${CMAKE_INSTALL_PREFIX}/PlugIns/imageformats/libqjpeg.dylib") # endif() endif() #Install the .desktop file configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/scribus.desktop.in ${CMAKE_CURRENT_SOURCE_DIR}/scribus.desktop ) install(FILES scribus.desktop RENAME scribus${TAG_VERSION}.desktop DESTINATION ${DESKTOPDIR} ) #Install our MIME data install(FILES scribus.xml RENAME scribus${TAG_VERSION}.xml DESTINATION ${MIMEDIR} ) #Install the appdata file configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/scribus.appdata.xml.in ${CMAKE_CURRENT_SOURCE_DIR}/scribus.appdata.xml ) install(FILES scribus.appdata.xml RENAME scribus${TAG_VERSION}.appdata.xml DESTINATION ${APPDATADIR} ) #If building an Apple bundle, install these specific files if(APPLEBUNDLE) install(FILES Scribus.app/Contents/Info.plist DESTINATION ${CMAKE_INSTALL_PREFIX} ) install(FILES Scribus.app/Contents/Resources/Scribus.icns Scribus.app/Contents/Resources/Scribus-doc.icns DESTINATION ${CMAKE_INSTALL_PREFIX}/Resources ) endif() ############################################################################################################## ########## Install/CPack Setup ########## # If the cmake version includes cpack, use it for tarball building 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}${VERSION_SUFFIX}") set(CPACK_SOURCE_GENERATOR TBZ2) set(CPACK_SYSTEM_NAME "") set(CPACK_TOPLEVEL_TAG "") set(CPACK_SOURCE_IGNORE_FILES CMakeCache.txt scribus-1.5.5.tar.bz2 scribus-1.5.5.tar.Z scribus-1.5.5.tar.gz scribus-1.5.5.svn.tar.bz2 scribus-1.5.5.svn.tar.Z scribus-1.5.5.svn.tar.gz "~$" "\\\\.cvsignore$" "\\\\.o$" "\\\\.svn-base$" "\\\\.svn$" "^${PROJECT_SOURCE_DIR}.*/CVS/" "^${PROJECT_SOURCE_DIR}/debian/" "^${PROJECT_SOURCE_DIR}/old/" "^${PROJECT_SOURCE_DIR}.*/CVSROOT/" "^${PROJECT_SOURCE_DIR}/admin/" ) include(CPack) endif() #include (cmakeconfigreport optional) # Output everything we've found #feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES) |
|
>> How did you know that version 1.4 can't be compiled with QT5? Major Qt versions are not source compatible between each other. And this is often the same with other libraries. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-02-29 22:27 | nsufba | New Issue | |
2020-03-01 00:07 | jghali | Note Added: 0047424 | |
2020-03-01 05:53 | nsufba | File Added: BUILDING | |
2020-03-01 05:53 | nsufba | File Added: CMakeLists.txt | |
2020-03-01 05:53 | nsufba | Note Added: 0047425 | |
2020-03-01 11:04 | jghali | Note Added: 0047426 | |
2020-03-01 11:07 | jghali | Note Edited: 0047426 | |
2020-03-01 11:19 | jghali | Assigned To | => jghali |
2020-03-01 11:19 | jghali | Status | new => resolved |
2020-03-01 11:19 | jghali | Resolution | open => no change required |
2020-03-01 11:19 | jghali | Status | resolved => closed |