diff options
| author | Tomasz Boczkowski <penginsbacon@gmail.com> | 2015-05-09 11:38:22 +0000 |
|---|---|---|
| committer | Tomasz Boczkowski <penginsbacon@gmail.com> | 2015-05-09 11:38:22 +0000 |
| commit | db85d12f8c106586a0b11f60bf32cdb8ca75d8f2 (patch) | |
| tree | ae5cbc2ad4fdbb93dbc1d7fc8b92ee2e2012e853 /CMakeScripts | |
| parent | renamed SPPattern methods to match coding style (diff) | |
| parent | fix crash introduces by recent rev when clipping (diff) | |
| download | inkscape-db85d12f8c106586a0b11f60bf32cdb8ca75d8f2.tar.gz inkscape-db85d12f8c106586a0b11f60bf32cdb8ca75d8f2.zip | |
merged trunk
(bzr r14059.1.21)
Diffstat (limited to 'CMakeScripts')
| -rw-r--r-- | CMakeScripts/ConfigPaths.cmake | 8 | ||||
| -rw-r--r-- | CMakeScripts/DefineDependsandFlags.cmake | 64 | ||||
| -rw-r--r-- | CMakeScripts/Modules/FindIconv.cmake | 60 | ||||
| -rw-r--r-- | CMakeScripts/Modules/FindIntl.cmake | 127 | ||||
| -rw-r--r-- | CMakeScripts/Modules/FindLibWPG.cmake | 4 |
5 files changed, 236 insertions, 27 deletions
diff --git a/CMakeScripts/ConfigPaths.cmake b/CMakeScripts/ConfigPaths.cmake index af0a7d50c..770e0c6ad 100644 --- a/CMakeScripts/ConfigPaths.cmake +++ b/CMakeScripts/ConfigPaths.cmake @@ -2,9 +2,15 @@ MESSAGE(STATUS "Creating build files in: ${CMAKE_CURRENT_BINARY_DIR}") IF(WIN32) SET(PACKAGE_LOCALE_DIR "locale") -ELSEIF(WIN32) + set(SHARE_INSTALL "share" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.") +ELSE(WIN32) # TODO: check and change this to correct value: SET(PACKAGE_LOCALE_DIR "locale") + + if(NOT SHARE_INSTALL) + set(SHARE_INSTALL "share" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.") + endif(NOT SHARE_INSTALL) + mark_as_advanced(SHARE_INSTALL) ENDIF(WIN32) #SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib) diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index e96609d34..dceed9560 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -19,7 +19,6 @@ list(APPEND INKSCAPE_INCS_SYS ${GSL_INCLUDE_DIRS}) list(APPEND INKSCAPE_LIBS ${GSL_LIBRARIES}) if (WIN32) list(APPEND INKSCAPE_LIBS "-L$ENV{DEVLIBS_PATH}/lib") # FIXME - list(APPEND INKSCAPE_LIBS "-lintl.dll") # FIXME list(APPEND INKSCAPE_LIBS "-lpangocairo-1.0.dll") # FIXME list(APPEND INKSCAPE_LIBS "-lpangoft2-1.0.dll") # FIXME list(APPEND INKSCAPE_LIBS "-lpangowin32-1.0.dll") # FIXME @@ -31,23 +30,13 @@ elseif(APPLE) # Cmake then can rely on the hard-coded paths in its modules. # Only prepend search path if $CMAKE_PREFIX_PATH is defined: list(APPEND INKSCAPE_LIBS "-L$ENV{CMAKE_PREFIX_PATH}/lib") # FIXME - # TODO: verify whether linking the next two libs explicitly is always - # required, or only if MacPorts is installed in custom prefix: - list(APPEND INKSCAPE_LIBS "-liconv") # FIXME - list(APPEND INKSCAPE_LIBS "-lintl") # FIXME endif() list(APPEND INKSCAPE_LIBS "-lpangocairo-1.0") # FIXME list(APPEND INKSCAPE_LIBS "-lpangoft2-1.0") # FIXME list(APPEND INKSCAPE_LIBS "-lfontconfig") # FIXME - # GTK+ backend if(${GTK+_2.0_TARGET} MATCHES "x11") # only link X11 if using X11 backend of GTK2 list(APPEND INKSCAPE_LIBS "-lX11") # FIXME - elseif(${GTK+_2.0_TARGET} MATCHES "quartz") - # TODO: gtk-mac-integration (currently only useful for osxmenu branch) - # 1) add configure option (ON/OFF) for gtk-mac-integration - # 2) add checks (GTK+ backend must be "quartz") - # 3) link relevant lib(s) endif() else() list(APPEND INKSCAPE_LIBS "-ldl") # FIXME @@ -93,6 +82,16 @@ if(ENABLE_LCMS) endif() endif() +find_package(Iconv REQUIRED) +list(APPEND INKSCAPE_INCS_SYS ${ICONV_INCLUDE_DIRS}) +list(APPEND INKSCAPE_LIBS ${ICONV_LIBRARIES}) +add_definitions(${ICONV_DEFINITIONS}) + +find_package(Intl REQUIRED) +list(APPEND INKSCAPE_INCS_SYS ${Intl_INCLUDE_DIRS}) +list(APPEND INKSCAPE_LIBS ${Intl_LIBRARIES}) +add_definitions(${Intl_DEFINITIONS}) + find_package(BoehmGC REQUIRED) list(APPEND INKSCAPE_INCS_SYS ${BOEHMGC_INCLUDE_DIRS}) list(APPEND INKSCAPE_LIBS ${BOEHMGC_LIBRARIES}) @@ -176,8 +175,8 @@ endif() if(WITH_LIBCDR) find_package(LibCDR) if(LIBCDR_FOUND) - set(WITH_LIBCDR00 ${LIBVISIO-0.0_FOUND}) - set(WITH_LIBCDR01 ${LIBVISIO-0.1_FOUND}) + set(WITH_LIBCDR00 ${LIBCDR-0.0_FOUND}) + set(WITH_LIBCDR01 ${LIBCDR-0.1_FOUND}) list(APPEND INKSCAPE_INCS_SYS ${LIBCDR_INCLUDE_DIRS}) list(APPEND INKSCAPE_LIBS ${LIBCDR_LIBRARIES}) add_definitions(${LIBCDR_DEFINITIONS}) @@ -214,6 +213,14 @@ if(WITH_DBUS) endif() endif() +if(WITH_GTEST) + if(EXISTS "${GMOCK_DIR}" AND IS_DIRECTORY "${GMOCK_DIR}") + + else() + set(WITH_GTEST off) + endif() +endif() + # ---------------------------------------------------------------------------- # CMake's builtin # ---------------------------------------------------------------------------- @@ -290,8 +297,9 @@ if(WITH_GTKSPELL) list(APPEND INKSCAPE_INCS_SYS ${GTKSPELL_INCLUDE_DIR}) list(APPEND INKSCAPE_LIBS ${GTKSPELL_LIBRARIES}) add_definitions(${GTKSPELL_DEFINITIONS}) + else() + set(WITH_GTKSPELL OFF) endif() - set(WITH_GTKSPELL ${GTKSPELL_FOUND}) endif() #find_package(OpenSSL) @@ -323,21 +331,29 @@ find_package(ZLIB REQUIRED) list(APPEND INKSCAPE_INCS_SYS ${ZLIB_INCLUDE_DIRS}) list(APPEND INKSCAPE_LIBS ${ZLIB_LIBRARIES}) -find_package(ImageMagick COMPONENTS MagickCore Magick++) -if(ImageMagick_FOUND) - list(APPEND INKSCAPE_INCS_SYS ${ImageMagick_MagickCore_INCLUDE_DIR}) - list(APPEND INKSCAPE_LIBS ${ImageMagick_Magick++_LIBRARY}) - set(WITH_IMAGE_MAGICK ON) # enable 'Extensions > Raster' - # TODO: Cmake's ImageMagick module misses required defines for newer - # versions of ImageMagick. See also: - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776832 - #add_definitions(-DMAGICKCORE_HDRI_ENABLE=0) # FIXME (version check?) - #add_definitions(-DMAGICKCORE_QUANTUM_DEPTH=16) # FIXME (version check?) +if(WITH_IMAGE_MAGICK) + find_package(ImageMagick COMPONENTS MagickCore Magick++) + if(ImageMagick_FOUND) + # the component-specific paths apparently fail to get detected correctly + # on some linux distros (or with older Cmake versions). + # Use variables which list all include dirs and libraries instead: + list(APPEND INKSCAPE_INCS_SYS ${ImageMagick_INCLUDE_DIRS}) + list(APPEND INKSCAPE_LIBS ${ImageMagick_LIBRARIES}) + # TODO: Cmake's ImageMagick module misses required defines for newer + # versions of ImageMagick. See also: + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776832 + #add_definitions(-DMAGICKCORE_HDRI_ENABLE=0) # FIXME (version check?) + #add_definitions(-DMAGICKCORE_QUANTUM_DEPTH=16) # FIXME (version check?) + else() + set(WITH_IMAGE_MAGICK OFF) # enable 'Extensions > Raster' + endif() endif() include(${CMAKE_CURRENT_LIST_DIR}/IncludeJava.cmake) # end Dependencies +list(REMOVE_DUPLICATES INKSCAPE_LIBS) +list(REMOVE_DUPLICATES INKSCAPE_INCS_SYS) # C/C++ Flags include_directories(${INKSCAPE_INCS}) diff --git a/CMakeScripts/Modules/FindIconv.cmake b/CMakeScripts/Modules/FindIconv.cmake new file mode 100644 index 000000000..338d17d05 --- /dev/null +++ b/CMakeScripts/Modules/FindIconv.cmake @@ -0,0 +1,60 @@ +# - Try to find Iconv +# Once done this will define +# +# ICONV_FOUND - system has Iconv +# ICONV_INCLUDE_DIR - the Iconv include directory +# ICONV_LIBRARIES - Link these to use Iconv +# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const +# +include(CheckCXXSourceCompiles) + +IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + # Already in cache, be silent + SET(ICONV_FIND_QUIETLY TRUE) +ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + +FIND_PATH(ICONV_INCLUDE_DIR iconv.h) + +FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c) + +IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + SET(ICONV_FOUND TRUE) +ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + +set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) +set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) +IF(ICONV_FOUND) + check_cxx_source_compiles(" + #include <iconv.h> + int main(){ + iconv_t conv = 0; + const char* in = 0; + size_t ilen = 0; + char* out = 0; + size_t olen = 0; + iconv(conv, &in, &ilen, &out, &olen); + return 0; + } +" ICONV_SECOND_ARGUMENT_IS_CONST ) + IF(ICONV_SECOND_ARGUMENT_IS_CONST) + SET(ICONV_CONST "const") + ENDIF(ICONV_SECOND_ARGUMENT_IS_CONST) +ENDIF(ICONV_FOUND) +set(CMAKE_REQUIRED_INCLUDES) +set(CMAKE_REQUIRED_LIBRARIES) + +IF(ICONV_FOUND) + IF(NOT ICONV_FIND_QUIETLY) + MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}") + ENDIF(NOT ICONV_FIND_QUIETLY) +ELSE(ICONV_FOUND) + IF(Iconv_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Iconv") + ENDIF(Iconv_FIND_REQUIRED) +ENDIF(ICONV_FOUND) + +MARK_AS_ADVANCED( + ICONV_INCLUDE_DIR + ICONV_LIBRARIES + ICONV_SECOND_ARGUMENT_IS_CONST +) diff --git a/CMakeScripts/Modules/FindIntl.cmake b/CMakeScripts/Modules/FindIntl.cmake new file mode 100644 index 000000000..e6c5f6d0c --- /dev/null +++ b/CMakeScripts/Modules/FindIntl.cmake @@ -0,0 +1,127 @@ +#.rst: +# FindIntl +# -------- +# +# Find the Gettext libintl headers and libraries. +# +# This module reports information about the Gettext libintl +# installation in several variables. General variables:: +# +# Intl_FOUND - true if the libintl headers and libraries were found +# Intl_INCLUDE_DIRS - the directory containing the libintl headers +# Intl_LIBRARIES - libintl libraries to be linked +# +# The following cache variables may also be set:: +# +# Intl_INCLUDE_DIR - the directory containing the libintl headers +# Intl_LIBRARY - the libintl library (if any) +# +# .. note:: +# On some platforms, such as Linux with GNU libc, the gettext +# functions are present in the C standard library and libintl +# is not required. ``Intl_LIBRARIES`` will be empty in this +# case. +# +# .. note:: +# If you wish to use the Gettext tools (``msgmerge``, +# ``msgfmt``, etc.), use :module:`FindGettext`. + + +# Written by Roger Leigh <rleigh@codelibre.net> + +#============================================================================= +# Copyright 2014 Roger Leigh <rleigh@codelibre.net> +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. + +# CMake - Cross Platform Makefile Generator +# Copyright 2000-2015 Kitware, Inc. +# Copyright 2000-2011 Insight Software Consortium +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the names of Kitware, Inc., the Insight Software Consortium, +# nor the names of their contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# ------------------------------------------------------------------------------ +# +# The above copyright and license notice applies to distributions of +# CMake in source and binary form. Some source files contain additional +# notices of original copyright by their contributors; see each source +# for details. Third-party software packages supplied with CMake under +# compatible licenses provide their own copyright notices documented in +# corresponding subdirectories. +# +# ------------------------------------------------------------------------------ +# +# CMake was initially developed by Kitware with the following sponsorship: +# +# * National Library of Medicine at the National Institutes of Health +# as part of the Insight Segmentation and Registration Toolkit (ITK). +# +# * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel +# Visualization Initiative. +# +# * National Alliance for Medical Image Computing (NAMIC) is funded by the +# National Institutes of Health through the NIH Roadmap for Medical Research, +# Grant U54 EB005149. +# +# * Kitware, Inc. + +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# Find include directory +find_path(Intl_INCLUDE_DIR + NAMES "libintl.h" + DOC "libintl include directory") +mark_as_advanced(Intl_INCLUDE_DIR) + +# Find all Intl libraries +find_library(Intl_LIBRARY "intl" + DOC "libintl libraries (if not in the C library)") +mark_as_advanced(Intl_LIBRARY) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Intl + FOUND_VAR Intl_FOUND + REQUIRED_VARS Intl_INCLUDE_DIR + FAIL_MESSAGE "Failed to find Gettext libintl") + +if(Intl_FOUND) + set(Intl_INCLUDE_DIRS "${Intl_INCLUDE_DIR}") + if(Intl_LIBRARY) + set(Intl_LIBRARIES "${Intl_LIBRARY}") + else() + unset(Intl_LIBRARIES) + endif() +endif() diff --git a/CMakeScripts/Modules/FindLibWPG.cmake b/CMakeScripts/Modules/FindLibWPG.cmake index 0eaf8f102..ea241a570 100644 --- a/CMakeScripts/Modules/FindLibWPG.cmake +++ b/CMakeScripts/Modules/FindLibWPG.cmake @@ -29,8 +29,8 @@ else (LIBWPG_LIBRARIES AND LIBWPG_INCLUDE_DIRS) if (LIBREVENGE_FOUND) list(APPEND LIBWPG_INCLUDE_DIRS ${LIBWPG-0.3_INCLUDE_DIRS}) list(APPEND LIBWPG_LIBRARIES ${LIBWPG-0.3_LIBRARIES}) - list(APPEND LIBWPG_INCLUDE_DIRS ${LIBREVENGE-0.0_INCLUDE_DIRS}) - list(APPEND LIBWPG_LIBRARIES ${LIBREVENGE-0.0_LIBRARIES}) + list(APPEND LIBWPG_INCLUDE_DIRS ${LIBREVENGE_INCLUDE_DIRS}) + list(APPEND LIBWPG_LIBRARIES ${LIBREVENGE_LIBRARIES}) set(LIBWPG03_FOUND TRUE) endif (LIBREVENGE_FOUND) else() |
