From 35a96bde514a8897f6f0fcc41c5833bf63df2e2a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:29:01 +0200 Subject: Adding upstream version 1.0.2. Signed-off-by: Daniel Baumann --- CMakeScripts/Modules/FindBoehmGC.cmake | 78 +++++++++++++++ CMakeScripts/Modules/FindDoubleConversion.cmake | 27 +++++ CMakeScripts/Modules/FindIconv.cmake | 60 +++++++++++ CMakeScripts/Modules/FindIntl.cmake | 127 ++++++++++++++++++++++++ CMakeScripts/Modules/FindJeMalloc.cmake | 70 +++++++++++++ CMakeScripts/Modules/FindLCMS2.cmake | 38 +++++++ CMakeScripts/Modules/FindLibCDR.cmake | 56 +++++++++++ CMakeScripts/Modules/FindLibRevenge.cmake | 41 ++++++++ CMakeScripts/Modules/FindLibVisio.cmake | 56 +++++++++++ CMakeScripts/Modules/FindLibWPG.cmake | 67 +++++++++++++ CMakeScripts/Modules/FindNSIS.cmake | 55 ++++++++++ CMakeScripts/Modules/FindPopplerCairo.cmake | 47 +++++++++ CMakeScripts/Modules/FindPotrace.cmake | 62 ++++++++++++ 13 files changed, 784 insertions(+) create mode 100644 CMakeScripts/Modules/FindBoehmGC.cmake create mode 100644 CMakeScripts/Modules/FindDoubleConversion.cmake create mode 100644 CMakeScripts/Modules/FindIconv.cmake create mode 100644 CMakeScripts/Modules/FindIntl.cmake create mode 100644 CMakeScripts/Modules/FindJeMalloc.cmake create mode 100644 CMakeScripts/Modules/FindLCMS2.cmake create mode 100644 CMakeScripts/Modules/FindLibCDR.cmake create mode 100644 CMakeScripts/Modules/FindLibRevenge.cmake create mode 100644 CMakeScripts/Modules/FindLibVisio.cmake create mode 100644 CMakeScripts/Modules/FindLibWPG.cmake create mode 100644 CMakeScripts/Modules/FindNSIS.cmake create mode 100644 CMakeScripts/Modules/FindPopplerCairo.cmake create mode 100644 CMakeScripts/Modules/FindPotrace.cmake (limited to 'CMakeScripts/Modules') diff --git a/CMakeScripts/Modules/FindBoehmGC.cmake b/CMakeScripts/Modules/FindBoehmGC.cmake new file mode 100644 index 0000000..e435af5 --- /dev/null +++ b/CMakeScripts/Modules/FindBoehmGC.cmake @@ -0,0 +1,78 @@ +# - Try to find BoehmGC +# Once done this will define +# +# BOEHMGC_FOUND - system has BoehmGC +# BOEHMGC_INCLUDE_DIRS - the BoehmGC include directory +# BOEHMGC_LIBRARIES - Link these to use BoehmGC +# BOEHMGC_DEFINITIONS - Compiler switches required for using BoehmGC +# +# Copyright (c) 2008 Joshua L. Blocher +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +if (BOEHMGC_LIBRARIES AND BOEHMGC_INCLUDE_DIRS) + # in cache already + set(BOEHMGC_FOUND TRUE) +else (BOEHMGC_LIBRARIES AND BOEHMGC_INCLUDE_DIRS) + find_path(BOEHMGC_INCLUDE_DIR + NAMES + gc.h + PATHS + /usr/include + /usr/local/include + /opt/local/include + /sw/include + $ENV{DEVLIBS_PATH}/include + PATH_SUFFIXES + gc + ) + + find_library(GC_LIBRARY + NAMES + gc + PATHS + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + $ENV{DEVLIBS_PATH}/lib + ) + + if (GC_LIBRARY) + set(GC_FOUND TRUE) + endif (GC_LIBRARY) + + set(BOEHMGC_INCLUDE_DIRS + ${BOEHMGC_INCLUDE_DIR} + ) + + if (GC_FOUND) + set(BOEHMGC_LIBRARIES + ${BOEHMGC_LIBRARIES} + ${GC_LIBRARY} + ) + endif (GC_FOUND) + + if (BOEHMGC_INCLUDE_DIRS AND BOEHMGC_LIBRARIES) + set(BOEHMGC_FOUND TRUE) + endif (BOEHMGC_INCLUDE_DIRS AND BOEHMGC_LIBRARIES) + + if (BOEHMGC_FOUND) + if (NOT BoehmGC_FIND_QUIETLY) + message(STATUS "Found BoehmGC: ${BOEHMGC_LIBRARIES}") + endif (NOT BoehmGC_FIND_QUIETLY) + else (BOEHMGC_FOUND) + if (BoehmGC_FIND_REQUIRED) + message(FATAL_ERROR "Could not find BoehmGC") + endif (BoehmGC_FIND_REQUIRED) + endif (BOEHMGC_FOUND) + + # show the BOEHMGC_INCLUDE_DIRS and BOEHMGC_LIBRARIES variables only in the advanced view + mark_as_advanced(BOEHMGC_INCLUDE_DIRS BOEHMGC_LIBRARIES) + +endif (BOEHMGC_LIBRARIES AND BOEHMGC_INCLUDE_DIRS) + diff --git a/CMakeScripts/Modules/FindDoubleConversion.cmake b/CMakeScripts/Modules/FindDoubleConversion.cmake new file mode 100644 index 0000000..bd4c002 --- /dev/null +++ b/CMakeScripts/Modules/FindDoubleConversion.cmake @@ -0,0 +1,27 @@ +# - Try to find double-conversion +# Once done, this will define +# +# DoubleConversion_FOUND - system has double-conversion +# DoubleConversion_INCLUDE_DIRS - the double-conversion include directories +# DoubleConversion_LIBRARIES - link these to use double-conversion + +include(FindPackageHandleStandardArgs) + +find_library(DoubleConversion_LIBRARY double-conversion + PATHS ${DoubleConversion_LIBRARYDIR}) + +find_path(DoubleConversion_INCLUDE_DIR double-conversion/double-conversion.h + PATHS ${DoubleConversion_INCLUDEDIR}) + +find_package_handle_standard_args(DoubleConversion DEFAULT_MSG + DoubleConversion_LIBRARY + DoubleConversion_INCLUDE_DIR) + +mark_as_advanced( + DoubleConversion_LIBRARY + DoubleConversion_INCLUDE_DIR) + +if(DoubleConversion_FOUND) + set(DoubleConversion_LIBRARIES ${DoubleConversion_LIBRARY}) + set(DoubleConversion_INCLUDE_DIRS ${DoubleConversion_INCLUDE_DIR}) +endif() diff --git a/CMakeScripts/Modules/FindIconv.cmake b/CMakeScripts/Modules/FindIconv.cmake new file mode 100644 index 0000000..338d17d --- /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 + 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 0000000..e6c5f6d --- /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 + +#============================================================================= +# Copyright 2014 Roger Leigh +# +# 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/FindJeMalloc.cmake b/CMakeScripts/Modules/FindJeMalloc.cmake new file mode 100644 index 0000000..5c7aa2c --- /dev/null +++ b/CMakeScripts/Modules/FindJeMalloc.cmake @@ -0,0 +1,70 @@ +# - Find JeMalloc library +# Find the native JeMalloc includes and library +# This module defines +# JEMALLOC_INCLUDE_DIRS, where to find jemalloc.h, Set when +# JEMALLOC_INCLUDE_DIR is found. +# JEMALLOC_LIBRARIES, libraries to link against to use JeMalloc. +# JEMALLOC_ROOT_DIR, The base directory to search for JeMalloc. +# This can also be an environment variable. +# JEMALLOC_FOUND, If false, do not try to use JeMalloc. +# +# also defined, but not for general use are +# JEMALLOC_LIBRARY, where to find the JeMalloc library. + +#============================================================================= +# Copyright 2011 Blender Foundation. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# 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. +#============================================================================= + +# If JEMALLOC_ROOT_DIR was defined in the environment, use it. +IF(NOT JEMALLOC_ROOT_DIR AND NOT $ENV{JEMALLOC_ROOT_DIR} STREQUAL "") + SET(JEMALLOC_ROOT_DIR $ENV{JEMALLOC_ROOT_DIR}) +ENDIF() + +SET(_jemalloc_SEARCH_DIRS + ${JEMALLOC_ROOT_DIR} + /usr/local + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave +) + +FIND_PATH(JEMALLOC_INCLUDE_DIR + NAMES + jemalloc.h + HINTS + ${_jemalloc_SEARCH_DIRS} + PATH_SUFFIXES + include/jemalloc +) + +FIND_LIBRARY(JEMALLOC_LIBRARY + NAMES + jemalloc + HINTS + ${_jemalloc_SEARCH_DIRS} + PATH_SUFFIXES + lib64 lib + ) + +# handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(JeMalloc DEFAULT_MSG + JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR) + +IF(JEMALLOC_FOUND) + SET(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY}) + SET(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR}) +ENDIF(JEMALLOC_FOUND) + +MARK_AS_ADVANCED( + JEMALLOC_INCLUDE_DIR + JEMALLOC_LIBRARY +) diff --git a/CMakeScripts/Modules/FindLCMS2.cmake b/CMakeScripts/Modules/FindLCMS2.cmake new file mode 100644 index 0000000..e5f24ce --- /dev/null +++ b/CMakeScripts/Modules/FindLCMS2.cmake @@ -0,0 +1,38 @@ +# This file was taken from the openjpeg library: +# +# http://code.google.com/p/openjpeg/source/browse/trunk/cmake/FindLCMS2.cmake?r=1987 +# +# Thanks! + +# - Find LCMS2 library +# Find the native LCMS2 includes and library +# Once done this will define +# +# LCMS2_INCLUDE_DIR - Where to find lcms2.h, etc. +# LCMS2_LIBRARIES - Libraries to link against to use LCMS2. +# LCMS2_FOUND - If false, do not try to use LCMS2. +# +# also defined, but not for general use are +# LCMS2_LIBRARY - Where to find the LCMS2 library. + +#============================================================================= +#============================================================================= + +find_path(LCMS2_INCLUDE_DIR lcms2.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include) + +set(LCMS2_NAMES ${LCMS2_NAMES} lcms2 liblcms2 liblcms2_static) + +find_library(LCMS2_LIBRARY NAMES ${LCMS2_NAMES} ) + +mark_as_advanced(LCMS2_INCLUDE_DIR LCMS2_LIBRARY) + +# handle the QUIETLY and REQUIRED arguments and set LCMS2_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLUDE_DIR) + +if(LCMS2_FOUND) +set( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR}) +set( LCMS2_LIBRARIES ${LCMS2_LIBRARY} ) +endif() + diff --git a/CMakeScripts/Modules/FindLibCDR.cmake b/CMakeScripts/Modules/FindLibCDR.cmake new file mode 100644 index 0000000..57a0480 --- /dev/null +++ b/CMakeScripts/Modules/FindLibCDR.cmake @@ -0,0 +1,56 @@ +# - Try to find LibCDR +# Once done this will define +# +# LIBCDR_FOUND - system has LibCDR +# LIBCDR_INCLUDE_DIRS - the LibCDR include directory +# LIBCDR_LIBRARIES - Link these to use LibCDR +# LIBCDR_DEFINITIONS - Compiler switches required for using LibCDR +# +# Copyright (c) 2008 Joshua L. Blocher +# Copyright (c) 2015 su_v +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +include(${CMAKE_CURRENT_LIST_DIR}/../HelperMacros.cmake) + +if (LIBCDR_LIBRARIES AND LIBCDR_INCLUDE_DIRS) + # in cache already + set(LIBCDR_FOUND TRUE) +else (LIBCDR_LIBRARIES AND LIBCDR_INCLUDE_DIRS) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + INKSCAPE_PKG_CONFIG_FIND(LIBCDR-0.1 libcdr-0.1 0 libcdr/libcdr.h libcdr-0.1 cdr-0.1) + if (LIBCDR-0.1_FOUND) + find_package(LibRevenge) + if (LIBREVENGE_FOUND) + list(APPEND LIBCDR_INCLUDE_DIRS ${LIBCDR-0.1_INCLUDE_DIRS}) + list(APPEND LIBCDR_LIBRARIES ${LIBCDR-0.1_LIBRARIES}) + list(APPEND LIBCDR_INCLUDE_DIRS ${LIBREVENGE_INCLUDE_DIRS}) + list(APPEND LIBCDR_LIBRARIES ${LIBREVENGE_LIBRARIES}) + set(LIBCDR01_FOUND TRUE) + endif (LIBREVENGE_FOUND) + else() + INKSCAPE_PKG_CONFIG_FIND(LIBCDR-0.0 libcdr-0.0 0 libcdr/libcdr.h libcdr-0.0 cdr-0.0) + INKSCAPE_PKG_CONFIG_FIND(LIBWPD-0.9 libwpd-0.9 0 libwpd/libwpd.h libwpd-0.9 wpd-0.9) + INKSCAPE_PKG_CONFIG_FIND(LIBWPD-STREAM-0.9 libwpd-stream-0.9 0 libwpd/libwpd.h libwpd-0.9 wpd-stream-0.9) + if (LIBCDR-0.0_FOUND AND LIBWPD-STREAM-0.9_FOUND AND LIBWPD-0.9_FOUND) + list(APPEND LIBCDR_INCLUDE_DIRS ${LIBCDR-0.0_INCLUDE_DIRS}) + list(APPEND LIBCDR_LIBRARIES ${LIBCDR-0.0_LIBRARIES}) + list(APPEND LIBCDR_INCLUDE_DIRS ${LIBWPD-0.9_INCLUDE_DIRS}) + list(APPEND LIBCDR_LIBRARIES ${LIBWPD-0.9_LIBRARIES}) + list(APPEND LIBCDR_INCLUDE_DIRS ${LIBWPD-STREAM-0.9_INCLUDE_DIRS}) + list(APPEND LIBCDR_LIBRARIES ${LIBWPD-STREAM-0.9_LIBRARIES}) + set(LIBCDR00_FOUND TRUE) + endif (LIBCDR-0.0_FOUND AND LIBWPD-STREAM-0.9_FOUND AND LIBWPD-0.9_FOUND) + endif (LIBCDR-0.1_FOUND) + if (LIBCDR-0.1_FOUND OR LIBCDR-0.0_FOUND) + set(LIBCDR_FOUND TRUE) + endif (LIBCDR-0.1_FOUND OR LIBCDR-0.0_FOUND) + endif (PKG_CONFIG_FOUND) +endif (LIBCDR_LIBRARIES AND LIBCDR_INCLUDE_DIRS) + diff --git a/CMakeScripts/Modules/FindLibRevenge.cmake b/CMakeScripts/Modules/FindLibRevenge.cmake new file mode 100644 index 0000000..90d1ecf --- /dev/null +++ b/CMakeScripts/Modules/FindLibRevenge.cmake @@ -0,0 +1,41 @@ +# - Try to find LibRevenge +# Once done this will define +# +# LIBREVENGE_FOUND - system has LibRevenge +# LIBREVENGE_INCLUDE_DIRS - the LibRevenge include directory +# LIBREVENGE_LIBRARIES - Link these to use LibRevenge +# LIBREVENGE_DEFINITIONS - Compiler switches required for using LibRevenge +# +# Copyright (c) 2008 Joshua L. Blocher +# Copyright (c) 2015 su_v +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +include(${CMAKE_CURRENT_LIST_DIR}/../HelperMacros.cmake) + +if (LIBREVENGE_LIBRARIES AND LIBREVENGE_INCLUDE_DIRS) + # in cache already + set(LIBREVENGE_FOUND TRUE) +else (LIBREVENGE_LIBRARIES AND LIBREVENGE_INCLUDE_DIRS) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + INKSCAPE_PKG_CONFIG_FIND(LIBREVENGE-0.0 librevenge-0.0 0 librevenge/librevenge.h librevenge-0.0 revenge-0.0) + INKSCAPE_PKG_CONFIG_FIND(LIBREVENGE-STREAM-0.0 librevenge-stream-0.0 0 librevenge-0.0/librevenge-stream/librevenge-stream.h librevenge-stream-0.0 revenge-stream-0.0) + if (LIBREVENGE-0.0_FOUND AND LIBREVENGE-STREAM-0.0_FOUND) + list(APPEND LIBREVENGE_INCLUDE_DIRS ${LIBREVENGE-0.0_INCLUDE_DIRS}) + list(APPEND LIBREVENGE_LIBRARIES ${LIBREVENGE-0.0_LIBRARIES}) + list(APPEND LIBREVENGE_INCLUDE_DIRS ${LIBREVENGE-STREAM-0.0_INCLUDE_DIRS}) + list(APPEND LIBREVENGE_LIBRARIES ${LIBREVENGE-STREAM-0.0_LIBRARIES}) + set(LIBREVENGE00_FOUND TRUE) + endif (LIBREVENGE-0.0_FOUND AND LIBREVENGE-STREAM-0.0_FOUND) + if (LIBREVENGE-0.0_FOUND) + set(LIBREVENGE_FOUND TRUE) + endif (LIBREVENGE-0.0_FOUND) + endif (PKG_CONFIG_FOUND) +endif (LIBREVENGE_LIBRARIES AND LIBREVENGE_INCLUDE_DIRS) + diff --git a/CMakeScripts/Modules/FindLibVisio.cmake b/CMakeScripts/Modules/FindLibVisio.cmake new file mode 100644 index 0000000..a4e88ae --- /dev/null +++ b/CMakeScripts/Modules/FindLibVisio.cmake @@ -0,0 +1,56 @@ +# - Try to find LibVisio +# Once done this will define +# +# LIBVISIO_FOUND - system has LibVisio +# LIBVISIO_INCLUDE_DIRS - the LibVisio include directory +# LIBVISIO_LIBRARIES - Link these to use LibVisio +# LIBVISIO_DEFINITIONS - Compiler switches required for using LibVisio +# +# Copyright (c) 2008 Joshua L. Blocher +# Copyright (c) 2015 su_v +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +include(${CMAKE_CURRENT_LIST_DIR}/../HelperMacros.cmake) + +if (LIBVISIO_LIBRARIES AND LIBVISIO_INCLUDE_DIRS) + # in cache already + set(LIBVISIO_FOUND TRUE) +else (LIBVISIO_LIBRARIES AND LIBVISIO_INCLUDE_DIRS) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + INKSCAPE_PKG_CONFIG_FIND(LIBVISIO-0.1 libvisio-0.1 0 libvisio/libvisio.h libvisio-0.1 visio-0.1) + if (LIBVISIO-0.1_FOUND) + find_package(LibRevenge) + if (LIBREVENGE_FOUND) + list(APPEND LIBVISIO_INCLUDE_DIRS ${LIBVISIO-0.1_INCLUDE_DIRS}) + list(APPEND LIBVISIO_LIBRARIES ${LIBVISIO-0.1_LIBRARIES}) + list(APPEND LIBVISIO_INCLUDE_DIRS ${LIBREVENGE_INCLUDE_DIRS}) + list(APPEND LIBVISIO_LIBRARIES ${LIBREVENGE_LIBRARIES}) + set(LIBVISIO01_FOUND TRUE) + endif (LIBREVENGE_FOUND) + else() + INKSCAPE_PKG_CONFIG_FIND(LIBVISIO-0.0 libvisio-0.0 0 libvisio/libvisio.h libvisio-0.0 visio-0.0) + INKSCAPE_PKG_CONFIG_FIND(LIBWPD-0.9 libwpd-0.9 0 libwpd/libwpd.h libwpd-0.9 wpd-0.9) + INKSCAPE_PKG_CONFIG_FIND(LIBWPD-STREAM-0.9 libwpd-stream-0.9 0 libwpd/libwpd.h libwpd-0.9 wpd-stream-0.9) + if (LIBVISIO-0.0_FOUND AND LIBWPD-STREAM-0.9_FOUND AND LIBWPD-0.9_FOUND) + list(APPEND LIBVISIO_INCLUDE_DIRS ${LIBVISIO-0.0_INCLUDE_DIRS}) + list(APPEND LIBVISIO_LIBRARIES ${LIBVISIO-0.0_LIBRARIES}) + list(APPEND LIBVISIO_INCLUDE_DIRS ${LIBWPD-0.9_INCLUDE_DIRS}) + list(APPEND LIBVISIO_LIBRARIES ${LIBWPD-0.9_LIBRARIES}) + list(APPEND LIBVISIO_INCLUDE_DIRS ${LIBWPD-STREAM-0.9_INCLUDE_DIRS}) + list(APPEND LIBVISIO_LIBRARIES ${LIBWPD-STREAM-0.9_LIBRARIES}) + set(LIBVISIO00_FOUND TRUE) + endif (LIBVISIO-0.0_FOUND AND LIBWPD-STREAM-0.9_FOUND AND LIBWPD-0.9_FOUND) + endif (LIBVISIO-0.1_FOUND) + if (LIBVISIO-0.1_FOUND OR LIBVISIO-0.0_FOUND) + set(LIBVISIO_FOUND TRUE) + endif (LIBVISIO-0.1_FOUND OR LIBVISIO-0.0_FOUND) + endif (PKG_CONFIG_FOUND) +endif (LIBVISIO_LIBRARIES AND LIBVISIO_INCLUDE_DIRS) + diff --git a/CMakeScripts/Modules/FindLibWPG.cmake b/CMakeScripts/Modules/FindLibWPG.cmake new file mode 100644 index 0000000..ea241a5 --- /dev/null +++ b/CMakeScripts/Modules/FindLibWPG.cmake @@ -0,0 +1,67 @@ +# - Try to find LibWPG +# Once done this will define +# +# LIBWPG_FOUND - system has LibWPG +# LIBWPG_INCLUDE_DIRS - the LibWPG include directory +# LIBWPG_LIBRARIES - Link these to use LibWPG +# LIBWPG_DEFINITIONS - Compiler switches required for using LibWPG +# +# Copyright (c) 2008 Joshua L. Blocher +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +include(${CMAKE_CURRENT_LIST_DIR}/../HelperMacros.cmake) + +if (LIBWPG_LIBRARIES AND LIBWPG_INCLUDE_DIRS) + # in cache already + set(LIBWPG_FOUND TRUE) +else (LIBWPG_LIBRARIES AND LIBWPG_INCLUDE_DIRS) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + INKSCAPE_PKG_CONFIG_FIND(LIBWPG-0.3 libwpg-0.3 0 libwpg/libwpg.h libwpg-0.3 wpg-0.3) + if (LIBWPG-0.3_FOUND) + find_package(LibRevenge) + 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_INCLUDE_DIRS}) + list(APPEND LIBWPG_LIBRARIES ${LIBREVENGE_LIBRARIES}) + set(LIBWPG03_FOUND TRUE) + endif (LIBREVENGE_FOUND) + else() + INKSCAPE_PKG_CONFIG_FIND(LIBWPG-0.2 libwpg-0.2 0 libwpg/libwpg.h libwpg-0.2 wpg-0.2) + INKSCAPE_PKG_CONFIG_FIND(LIBWPD-0.9 libwpd-0.9 0 libwpd/libwpd.h libwpd-0.9 wpd-0.9) + INKSCAPE_PKG_CONFIG_FIND(LIBWPD-STREAM-0.9 libwpd-stream-0.9 0 libwpd/libwpd.h libwpd-0.9 wpd-stream-0.9) + if (LIBWPG-0.2_FOUND AND LIBWPD-STREAM-0.9_FOUND AND LIBWPD-0.9_FOUND) + list(APPEND LIBWPG_INCLUDE_DIRS ${LIBWPG-0.2_INCLUDE_DIRS}) + list(APPEND LIBWPG_LIBRARIES ${LIBWPG-0.2_LIBRARIES}) + list(APPEND LIBWPG_INCLUDE_DIRS ${LIBWPD-0.9_INCLUDE_DIRS}) + list(APPEND LIBWPG_LIBRARIES ${LIBWPD-0.9_LIBRARIES}) + list(APPEND LIBWPG_INCLUDE_DIRS ${LIBWPD-STREAM-0.9_INCLUDE_DIRS}) + list(APPEND LIBWPG_LIBRARIES ${LIBWPD-STREAM-0.9_LIBRARIES}) + set(LIBWPG02_FOUND TRUE) + else() + INKSCAPE_PKG_CONFIG_FIND(LIBWPG-0.1 libwpg-0.1 0 libwpg/libwpg.h libwpg-0.1 wpg-0.1) + INKSCAPE_PKG_CONFIG_FIND(LIBWPG-STREAM-0.1 libwpg-stream-0.1 0 libwpg/libwpg.h libwpg-0.1 wpg-stream-0.1) + INKSCAPE_PKG_CONFIG_FIND(LIBWPD-0.8 libwpd-0.8 0 libwpd/libwpd.h libwpd-0.8 wpd-0.8) + if (LIBWPG-0.1_FOUND AND LIBWPG-STREAM-0.1_FOUND AND LIBWPD-0.8_FOUND) + list(APPEND LIBWPG_INCLUDE_DIRS ${LIBWPG-0.1_INCLUDE_DIRS}) + list(APPEND LIBWPG_LIBRARIES ${LIBWPG-0.1_LIBRARIES}) + list(APPEND LIBWPG_INCLUDE_DIRS ${LIBWPG-STREAM-0.1_INCLUDE_DIRS}) + list(APPEND LIBWPG_LIBRARIES ${LIBWPG-STREAM-0.1_LIBRARIES}) + list(APPEND LIBWPG_INCLUDE_DIRS ${LIBWPD-0.8_INCLUDE_DIRS}) + list(APPEND LIBWPG_LIBRARIES ${LIBWPD-0.8_LIBRARIES}) + set(LIBWPG01_FOUND TRUE) + endif (LIBWPG-0.1_FOUND AND LIBWPG-STREAM-0.1_FOUND AND LIBWPD-0.8_FOUND) + endif (LIBWPG-0.2_FOUND AND LIBWPD-STREAM-0.9_FOUND AND LIBWPD-0.9_FOUND) + endif (LIBWPG-0.3_FOUND) + if (LIBWPG-0.1_FOUND OR LIBWPG-0.2_FOUND OR LIBWPG-0.3_FOUND) + set(LIBWPG_FOUND TRUE) + endif (LIBWPG-0.1_FOUND OR LIBWPG-0.2_FOUND OR LIBWPG-0.3_FOUND) + endif (PKG_CONFIG_FOUND) +endif (LIBWPG_LIBRARIES AND LIBWPG_INCLUDE_DIRS) diff --git a/CMakeScripts/Modules/FindNSIS.cmake b/CMakeScripts/Modules/FindNSIS.cmake new file mode 100644 index 0000000..21f80d8 --- /dev/null +++ b/CMakeScripts/Modules/FindNSIS.cmake @@ -0,0 +1,55 @@ +# - Try to find NSIS +# Once done this will define +# +# NSIS_ROOT_PATH - Set this variable to the root installation of NSIS +# +# Read-Only variables: +# +# NSIS_FOUND - system has NSIS +# NSIS_MAKE - NSIS creator executable +# +#============================================================================= +# Copyright (c) 2010-2013 Andreas Schneider +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# 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. +#============================================================================= +# + +if (WIN32) + set(_NSIS_ROOT_HINTS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS;Default]") + + set(_NSIS_ROOT_PATHS + $ENV{PROGRAMFILES}/NSIS) + + find_path(NSIS_ROOT_PATH + NAMES + Include/Library.nsh + HINTS + ${_NSIS_ROOT_HINTS} + PATHS + ${_NSIS_ROOT_PATHS} + ) + mark_as_advanced(NSIS_ROOT_PATH) +endif (WIN32) + +find_program(NSIS_MAKE + NAMES + makensis + PATHS + ${NSIS_ROOT_PATH} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(NSIS DEFAULT_MSG NSIS_MAKE) + +if (NSIS_MAKE) + set(NSIS_FOUND TRUE) +endif (NSIS_MAKE) + +mark_as_advanced(NSIS_MAKE) diff --git a/CMakeScripts/Modules/FindPopplerCairo.cmake b/CMakeScripts/Modules/FindPopplerCairo.cmake new file mode 100644 index 0000000..bde884e --- /dev/null +++ b/CMakeScripts/Modules/FindPopplerCairo.cmake @@ -0,0 +1,47 @@ +# - Try to find PopplerCairo +# Once done this will define +# +# POPPLER_FOUND - system has PopplerCairo +# POPPLER_INCLUDE_DIRS - the PopplerCairo include directory +# POPPLER_LIBRARIES - Link these to use PopplerCairo +# POPPLER_DEFINITIONS - Compiler switches required for using PopplerCairo +# +# Copyright (c) 2008 Joshua L. Blocher +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +include(${CMAKE_CURRENT_LIST_DIR}/../HelperMacros.cmake) + +if (POPPLER_LIBRARIES AND POPPLER_INCLUDE_DIRS) + # in cache already + set(POPPLER_FOUND TRUE) +else (POPPLER_LIBRARIES AND POPPLER_INCLUDE_DIRS) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + INKSCAPE_PKG_CONFIG_FIND(POPPLER poppler >=0.20.0 poppler-config.h poppler poppler) + if (POPPLER_FOUND) + INKSCAPE_PKG_CONFIG_FIND(POPPLER_GLIB poppler-glib >=0.20.0 poppler/glib/poppler.h "" poppler-glib) + if (POPPLER_GLIB_FOUND) + list(APPEND POPPLER_INCLUDE_DIRS ${POPPLER_GLIB_INCLUDE_DIRS}) + list(APPEND POPPLER_LIBRARIES ${POPPLER_GLIB_LIBRARIES}) + INKSCAPE_PKG_CONFIG_FIND(CAIRO_SVG cairo-svg 0 cairo-svg.h cairo cairo) + if (CAIRO_SVG_FOUND) + list(APPEND POPPLER_INCLUDE_DIRS ${CAIRO_SVG_INCLUDE_DIRS}) + list(APPEND POPPLER_LIBRARIES ${CAIRO_SVG_LIBRARIES}) + endif (CAIRO_SVG_FOUND) + endif (POPPLER_GLIB_FOUND) + if (ENABLE_POPPLER_CAIRO) + INKSCAPE_PKG_CONFIG_FIND(POPPLER_CAIRO poppler-cairo >=0.20.0 cairo.h cairo cairo) + if (POPPLER_GLIB_FOUND AND POPPLER_CAIRO_FOUND AND NOT CAIRO_SVG_FOUND) + list(APPEND POPPLER_INCLUDE_DIRS ${POPPLER_CAIRO_INCLUDE_DIRS}) + list(APPEND POPPLER_LIBRARIES ${POPPLER_CAIRO_LIBRARIES}) + endif (POPPLER_GLIB_FOUND AND POPPLER_CAIRO_FOUND AND NOT CAIRO_SVG_FOUND) + endif (ENABLE_POPPLER_CAIRO) + endif (POPPLER_FOUND) + endif (PKG_CONFIG_FOUND) +endif (POPPLER_LIBRARIES AND POPPLER_INCLUDE_DIRS) diff --git a/CMakeScripts/Modules/FindPotrace.cmake b/CMakeScripts/Modules/FindPotrace.cmake new file mode 100644 index 0000000..9ab9952 --- /dev/null +++ b/CMakeScripts/Modules/FindPotrace.cmake @@ -0,0 +1,62 @@ +# POTRACE_FOUND - system has Potrace +# POTRACE_INCLUDE_DIRS - the Potrace include directory +# POTRACE_LIBRARIES - The libraries needed to use Potrace + +IF (POTRACE_LIBRARIES AND POTRACE_INCLUDE_DIRS) + # in cache already + SET(POTRACE_FOUND TRUE) +ELSE (POTRACE_LIBRARIES AND POTRACE_INCLUDE_DIRS) + FIND_PATH (POTRACE_INCLUDE_DIR + NAMES + potracelib.h + PATHS + /usr/include + /usr/local/include + $ENV{DEVLIBS_PATH}/include + PATH_SUFFIXES + potrace + ) + + FIND_LIBRARY (POTRACE_LIBRARY + NAMES + potrace + libpotrace + PATHS + /usr/lib + /usr/local/lib + $ENV{DEVLIBS_PATH}/lib + ) + + if (POTRACE_LIBRARY) + set (POTRACE_FOUND TRUE) + endif (POTRACE_LIBRARY) + + set (POTRACE_INCLUDE_DIRS + ${POTRACE_INCLUDE_DIR} + ) + + if (POTRACE_FOUND) + set(POTRACE_LIBRARIES + ${POTRACE_LIBRARIES} + ${POTRACE_LIBRARY} + ) + endif (POTRACE_FOUND) + + if (POTRACE_INCLUDE_DIRS AND POTRACE_LIBRARIES) + set(POTRACE_FOUND TRUE) + endif (POTRACE_INCLUDE_DIRS AND POTRACE_LIBRARIES) + + if (POTRACE_FOUND) + if (NOT Potrace_FIND_QUIETLY) + message(STATUS "Found Potrace: ${POTRACE_LIBRARIES}") + endif (NOT Potrace_FIND_QUIETLY) + else (POTRACE_FOUND) + if (Potrace_FIND_REQUIRED) + message(FATAL_ERROR "Could not find potrace") + endif (Potrace_FIND_REQUIRED) + endif (POTRACE_FOUND) + + # show the POTRACE_INCLUDE_DIRS and POTRACE_LIBRARIES variables only in the advanced view + MARK_AS_ADVANCED(POTRACE_INCLUDE_DIRS POTRACE_LIBRARIES) + +endif (POTRACE_LIBRARIES AND POTRACE_INCLUDE_DIRS) -- cgit v1.2.3