diff options
Diffstat (limited to 'CMakeScripts/Modules')
-rw-r--r-- | CMakeScripts/Modules/FindDoubleConversion.cmake | 27 | ||||
-rw-r--r-- | CMakeScripts/Modules/FindJeMalloc.cmake | 70 | ||||
-rw-r--r-- | CMakeScripts/Modules/FindNSIS.cmake | 55 | ||||
-rw-r--r-- | CMakeScripts/Modules/FindPopplerCairo.cmake | 47 | ||||
-rw-r--r-- | CMakeScripts/Modules/FindPotrace.cmake | 62 |
5 files changed, 261 insertions, 0 deletions
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/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/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 <asn@cryptomilk.org> +# +# 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 <verbalshadow@gmail.com> +# +# 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) |