summaryrefslogtreecommitdiffstats
path: root/CMakeScripts/Modules
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-06-25 14:48:35 +0000
committerCampbell Barton <ideasman42@gmail.com>2011-06-25 14:48:35 +0000
commit71f63ec3d5ccb82e8617da524d741221e35847ca (patch)
tree43c5b21688f5ae44fabf611f5a7051993450d6c3 /CMakeScripts/Modules
parentcmake: added a patched FindGTK2 to include cairommconfig.h (diff)
downloadinkscape-71f63ec3d5ccb82e8617da524d741221e35847ca.tar.gz
inkscape-71f63ec3d5ccb82e8617da524d741221e35847ca.zip
added a Modules cmake dir, only use for find_package, reference cmake include paths explicitly.
(bzr r10358)
Diffstat (limited to 'CMakeScripts/Modules')
-rw-r--r--CMakeScripts/Modules/FindBoehmGC.cmake77
-rw-r--r--CMakeScripts/Modules/FindGSL.cmake89
-rw-r--r--CMakeScripts/Modules/FindGTK2_patched.cmake596
-rw-r--r--CMakeScripts/Modules/FindGnomeVFS2.cmake90
-rw-r--r--CMakeScripts/Modules/FindLCMS.cmake90
-rw-r--r--CMakeScripts/Modules/FindLibWPG.cmake90
-rw-r--r--CMakeScripts/Modules/FindPANGOMM.cmake89
-rw-r--r--CMakeScripts/Modules/FindPopt.cmake90
-rw-r--r--CMakeScripts/Modules/FindPython.cmake13
-rw-r--r--CMakeScripts/Modules/FindSigC++.cmake106
10 files changed, 1330 insertions, 0 deletions
diff --git a/CMakeScripts/Modules/FindBoehmGC.cmake b/CMakeScripts/Modules/FindBoehmGC.cmake
new file mode 100644
index 000000000..7a5081c22
--- /dev/null
+++ b/CMakeScripts/Modules/FindBoehmGC.cmake
@@ -0,0 +1,77 @@
+# - 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 <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.
+#
+
+
+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
+ )
+
+ 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/FindGSL.cmake b/CMakeScripts/Modules/FindGSL.cmake
new file mode 100644
index 000000000..1ef4643ad
--- /dev/null
+++ b/CMakeScripts/Modules/FindGSL.cmake
@@ -0,0 +1,89 @@
+# - Try to find GSL
+# Once done this will define
+#
+# GSL_FOUND - system has GSL
+# GSL_INCLUDE_DIRS - the GSL include directory
+# GSL_LIBRARIES - Link these to use GSL
+# GSL_DEFINITIONS - Compiler switches required for using GSL
+#
+# 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.
+#
+
+
+if (GSL_LIBRARIES AND GSL_INCLUDE_DIRS)
+ # in cache already
+ set(GSL_FOUND TRUE)
+else (GSL_LIBRARIES AND GSL_INCLUDE_DIRS)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ include(UsePkgConfig)
+ pkgconfig(gsl _GSL_INCLUDEDIR _GSL_LIBDIR _GSL_LDFLAGS _GSL_CFLAGS)
+ else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_GSL gsl)
+ endif (PKG_CONFIG_FOUND)
+ endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_path(GSL_INCLUDE_DIR
+ NAMES
+ gsl_blas.h
+ PATHS
+ ${_GSL_INCLUDEDIR}
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ PATH_SUFFIXES
+ gsl
+ )
+
+ find_library(GSL_LIBRARY
+ NAMES
+ gsl
+ PATHS
+ ${_GSL_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ if (GSL_LIBRARY)
+ set(GSL_FOUND TRUE)
+ endif (GSL_LIBRARY)
+
+ set(GSL_INCLUDE_DIRS
+ ${GSL_INCLUDE_DIR}
+ )
+
+ if (GSL_FOUND)
+ set(GSL_LIBRARIES
+ ${GSL_LIBRARIES}
+ ${GSL_LIBRARY}
+ )
+ endif (GSL_FOUND)
+
+ if (GSL_INCLUDE_DIRS AND GSL_LIBRARIES)
+ set(GSL_FOUND TRUE)
+ endif (GSL_INCLUDE_DIRS AND GSL_LIBRARIES)
+
+ if (GSL_FOUND)
+ if (NOT GSL_FIND_QUIETLY)
+ message(STATUS "Found GSL: ${GSL_LIBRARIES}")
+ endif (NOT GSL_FIND_QUIETLY)
+ else (GSL_FOUND)
+ if (GSL_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find GSL")
+ endif (GSL_FIND_REQUIRED)
+ endif (GSL_FOUND)
+
+ # show the GSL_INCLUDE_DIRS and GSL_LIBRARIES variables only in the advanced view
+ mark_as_advanced(GSL_INCLUDE_DIRS GSL_LIBRARIES)
+
+endif (GSL_LIBRARIES AND GSL_INCLUDE_DIRS)
+
diff --git a/CMakeScripts/Modules/FindGTK2_patched.cmake b/CMakeScripts/Modules/FindGTK2_patched.cmake
new file mode 100644
index 000000000..91249b787
--- /dev/null
+++ b/CMakeScripts/Modules/FindGTK2_patched.cmake
@@ -0,0 +1,596 @@
+# *NOTE*, this file include 1 line modification from 2.8.5's module
+# this adds GTK2_CAIROMM_INCLUDE_DIR which we need!
+# - ideasman42
+# ------------
+
+# - FindGTK2.cmake
+# This module can find the GTK2 widget libraries and several of its other
+# optional components like gtkmm, glade, and glademm.
+#
+# NOTE: If you intend to use version checking, CMake 2.6.2 or later is
+# required.
+#
+# Specify one or more of the following components
+# as you call this find module. See example below.
+#
+# gtk
+# gtkmm
+# glade
+# glademm
+#
+# The following variables will be defined for your use
+#
+# GTK2_FOUND - Were all of your specified components found?
+# GTK2_INCLUDE_DIRS - All include directories
+# GTK2_LIBRARIES - All libraries
+#
+# GTK2_VERSION - The version of GTK2 found (x.y.z)
+# GTK2_MAJOR_VERSION - The major version of GTK2
+# GTK2_MINOR_VERSION - The minor version of GTK2
+# GTK2_PATCH_VERSION - The patch version of GTK2
+#
+# Optional variables you can define prior to calling this module:
+#
+# GTK2_DEBUG - Enables verbose debugging of the module
+# GTK2_SKIP_MARK_AS_ADVANCED - Disable marking cache variables as advanced
+# GTK2_ADDITIONAL_SUFFIXES - Allows defining additional directories to
+# search for include files
+#
+#=================
+# Example Usage:
+#
+# Call find_package() once, here are some examples to pick from:
+#
+# Require GTK 2.6 or later
+# find_package(GTK2 2.6 REQUIRED gtk)
+#
+# Require GTK 2.10 or later and Glade
+# find_package(GTK2 2.10 REQUIRED gtk glade)
+#
+# Search for GTK/GTKMM 2.8 or later
+# find_package(GTK2 2.8 COMPONENTS gtk gtkmm)
+#
+# if(GTK2_FOUND)
+# include_directories(${GTK2_INCLUDE_DIRS})
+# add_executable(mygui mygui.cc)
+# target_link_libraries(mygui ${GTK2_LIBRARIES})
+# endif()
+#
+
+#=============================================================================
+# Copyright 2009 Kitware, Inc.
+# Copyright 2008-2009 Philip Lowman <philip@yhbt.com>
+#
+# 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.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# Version 1.3 (11/9/2010) (CMake 2.8.4)
+# * 11429: Add support for detecting GTK2 built with Visual Studio 10.
+# Thanks to Vincent Levesque for the patch.
+
+# Version 1.2 (8/30/2010) (CMake 2.8.3)
+# * Merge patch for detecting gdk-pixbuf library (split off
+# from core GTK in 2.21). Thanks to Vincent Untz for the patch
+# and Ricardo Cruz for the heads up.
+# Version 1.1 (8/19/2010) (CMake 2.8.3)
+# * Add support for detecting GTK2 under macports (thanks to Gary Kramlich)
+# Version 1.0 (8/12/2010) (CMake 2.8.3)
+# * Add support for detecting new pangommconfig.h header file
+# (Thanks to Sune Vuorela & the Debian Project for the patch)
+# * Add support for detecting fontconfig.h header
+# * Call find_package(Freetype) since it's required
+# * Add support for allowing users to add additional library directories
+# via the GTK2_ADDITIONAL_SUFFIXES variable (kind of a future-kludge in
+# case the GTK developers change versions on any of the directories in the
+# future).
+# Version 0.8 (1/4/2010)
+# * Get module working under MacOSX fink by adding /sw/include, /sw/lib
+# to PATHS and the gobject library
+# Version 0.7 (3/22/09)
+# * Checked into CMake CVS
+# * Added versioning support
+# * Module now defaults to searching for GTK if COMPONENTS not specified.
+# * Added HKCU prior to HKLM registry key and GTKMM specific environment
+# variable as per mailing list discussion.
+# * Added lib64 to include search path and a few other search paths where GTK
+# may be installed on Unix systems.
+# * Switched to lowercase CMake commands
+# * Prefaced internal variables with _GTK2 to prevent collision
+# * Changed internal macros to functions
+# * Enhanced documentation
+# Version 0.6 (1/8/08)
+# Added GTK2_SKIP_MARK_AS_ADVANCED option
+# Version 0.5 (12/19/08)
+# Second release to cmake mailing list
+
+#=============================================================
+# _GTK2_GET_VERSION
+# Internal function to parse the version number in gtkversion.h
+# _OUT_major = Major version number
+# _OUT_minor = Minor version number
+# _OUT_micro = Micro version number
+# _gtkversion_hdr = Header file to parse
+#=============================================================
+function(_GTK2_GET_VERSION _OUT_major _OUT_minor _OUT_micro _gtkversion_hdr)
+ file(READ ${_gtkversion_hdr} _contents)
+ if(_contents)
+ string(REGEX REPLACE ".*#define GTK_MAJOR_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_major} "${_contents}")
+ string(REGEX REPLACE ".*#define GTK_MINOR_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_minor} "${_contents}")
+ string(REGEX REPLACE ".*#define GTK_MICRO_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_micro} "${_contents}")
+
+ if(NOT ${_OUT_major} MATCHES "[0-9]+")
+ message(FATAL_ERROR "Version parsing failed for GTK2_MAJOR_VERSION!")
+ endif()
+ if(NOT ${_OUT_minor} MATCHES "[0-9]+")
+ message(FATAL_ERROR "Version parsing failed for GTK2_MINOR_VERSION!")
+ endif()
+ if(NOT ${_OUT_micro} MATCHES "[0-9]+")
+ message(FATAL_ERROR "Version parsing failed for GTK2_MICRO_VERSION!")
+ endif()
+
+ set(${_OUT_major} ${${_OUT_major}} PARENT_SCOPE)
+ set(${_OUT_minor} ${${_OUT_minor}} PARENT_SCOPE)
+ set(${_OUT_micro} ${${_OUT_micro}} PARENT_SCOPE)
+ else()
+ message(FATAL_ERROR "Include file ${_gtkversion_hdr} does not exist")
+ endif()
+endfunction()
+
+#=============================================================
+# _GTK2_FIND_INCLUDE_DIR
+# Internal function to find the GTK include directories
+# _var = variable to set
+# _hdr = header file to look for
+#=============================================================
+function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
+
+ if(GTK2_DEBUG)
+ message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
+ "_GTK2_FIND_INCLUDE_DIR( ${_var} ${_hdr} )")
+ endif()
+
+ set(_relatives
+ # If these ever change, things will break.
+ ${GTK2_ADDITIONAL_SUFFIXES}
+ glibmm-2.4
+ glib-2.0
+ atk-1.0
+ atkmm-1.6
+ cairo
+ cairomm-1.0
+ gdk-pixbuf-2.0
+ gdkmm-2.4
+ giomm-2.4
+ gtk-2.0
+ gtkmm-2.4
+ libglade-2.0
+ libglademm-2.4
+ pango-1.0
+ pangomm-1.4
+ sigc++-2.0
+ )
+
+ set(_suffixes)
+ foreach(_d ${_relatives})
+ list(APPEND _suffixes ${_d})
+ list(APPEND _suffixes ${_d}/include) # for /usr/lib/gtk-2.0/include
+ endforeach()
+
+ if(GTK2_DEBUG)
+ message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
+ "include suffixes = ${_suffixes}")
+ endif()
+
+ find_path(${_var} ${_hdr}
+ PATHS
+ /usr/local/lib64
+ /usr/local/lib
+ /usr/lib64
+ /usr/lib
+ /opt/gnome/include
+ /opt/gnome/lib
+ /opt/openwin/include
+ /usr/openwin/lib
+ /sw/include
+ /sw/lib
+ /opt/local/include
+ /opt/local/lib
+ $ENV{GTKMM_BASEPATH}/include
+ $ENV{GTKMM_BASEPATH}/lib
+ [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/include
+ [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/lib
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/include
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/lib
+ PATH_SUFFIXES
+ ${_suffixes}
+ )
+
+ if(${_var})
+ set(GTK2_INCLUDE_DIRS ${GTK2_INCLUDE_DIRS} ${${_var}} PARENT_SCOPE)
+ if(NOT GTK2_SKIP_MARK_AS_ADVANCED)
+ mark_as_advanced(${_var})
+ endif()
+ endif()
+
+endfunction(_GTK2_FIND_INCLUDE_DIR)
+
+#=============================================================
+# _GTK2_FIND_LIBRARY
+# Internal function to find libraries packaged with GTK2
+# _var = library variable to create
+#=============================================================
+function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
+
+ if(GTK2_DEBUG)
+ message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
+ "_GTK2_FIND_LIBRARY( ${_var} ${_lib} ${_expand_vc} ${_append_version} )")
+ endif()
+
+ # Not GTK versions per se but the versions encoded into Windows
+ # import libraries (GtkMM 2.14.1 has a gtkmm-vc80-2_4.lib for example)
+ # Also the MSVC libraries use _ for . (this is handled below)
+ set(_versions 2.20 2.18 2.16 2.14 2.12
+ 2.10 2.8 2.6 2.4 2.2 2.0
+ 1.20 1.18 1.16 1.14 1.12
+ 1.10 1.8 1.6 1.4 1.2 1.0)
+
+ set(_library)
+ set(_library_d)
+
+ set(_library ${_lib})
+
+ if(_expand_vc AND MSVC)
+ # Add vc80/vc90/vc100 midfixes
+ if(MSVC80)
+ set(_library ${_library}-vc80)
+ elseif(MSVC90)
+ set(_library ${_library}-vc90)
+ elseif(MSVC10)
+ set(_library ${_library}-vc100)
+ endif()
+ set(_library_d ${_library}-d)
+ endif()
+
+ if(GTK2_DEBUG)
+ message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
+ "After midfix addition = ${_library} and ${_library_d}")
+ endif()
+
+ set(_lib_list)
+ set(_libd_list)
+ if(_append_version)
+ foreach(_ver ${_versions})
+ list(APPEND _lib_list "${_library}-${_ver}")
+ list(APPEND _libd_list "${_library_d}-${_ver}")
+ endforeach()
+ else()
+ set(_lib_list ${_library})
+ set(_libd_list ${_library_d})
+ endif()
+
+ if(GTK2_DEBUG)
+ message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
+ "library list = ${_lib_list} and library debug list = ${_libd_list}")
+ endif()
+
+ # For some silly reason the MSVC libraries use _ instead of .
+ # in the version fields
+ if(_expand_vc AND MSVC)
+ set(_no_dots_lib_list)
+ set(_no_dots_libd_list)
+ foreach(_l ${_lib_list})
+ string(REPLACE "." "_" _no_dots_library ${_l})
+ list(APPEND _no_dots_lib_list ${_no_dots_library})
+ endforeach()
+ # And for debug
+ set(_no_dots_libsd_list)
+ foreach(_l ${_libd_list})
+ string(REPLACE "." "_" _no_dots_libraryd ${_l})
+ list(APPEND _no_dots_libd_list ${_no_dots_libraryd})
+ endforeach()
+
+ # Copy list back to original names
+ set(_lib_list ${_no_dots_lib_list})
+ set(_libd_list ${_no_dots_libd_list})
+ endif()
+
+ if(GTK2_DEBUG)
+ message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
+ "While searching for ${_var}, our proposed library list is ${_lib_list}")
+ endif()
+
+ find_library(${_var}
+ NAMES ${_lib_list}
+ PATHS
+ /opt/gnome/lib
+ /opt/gnome/lib64
+ /usr/openwin/lib
+ /usr/openwin/lib64
+ /sw/lib
+ $ENV{GTKMM_BASEPATH}/lib
+ [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/lib
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/lib
+ )
+
+ if(_expand_vc AND MSVC)
+ if(GTK2_DEBUG)
+ message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
+ "While searching for ${_var}_DEBUG our proposed library list is ${_libd_list}")
+ endif()
+
+ find_library(${_var}_DEBUG
+ NAMES ${_libd_list}
+ PATHS
+ $ENV{GTKMM_BASEPATH}/lib
+ [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/lib
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/lib
+ )
+
+ if(${_var} AND ${_var}_DEBUG)
+ if(NOT GTK2_SKIP_MARK_AS_ADVANCED)
+ mark_as_advanced(${_var}_DEBUG)
+ endif()
+ set(GTK2_LIBRARIES ${GTK2_LIBRARIES} optimized ${${_var}} debug ${${_var}_DEBUG})
+ set(GTK2_LIBRARIES ${GTK2_LIBRARIES} PARENT_SCOPE)
+ endif()
+ else()
+ if(NOT GTK2_SKIP_MARK_AS_ADVANCED)
+ mark_as_advanced(${_var})
+ endif()
+ set(GTK2_LIBRARIES ${GTK2_LIBRARIES} ${${_var}})
+ set(GTK2_LIBRARIES ${GTK2_LIBRARIES} PARENT_SCOPE)
+ # Set debug to release
+ set(${_var}_DEBUG ${${_var}})
+ set(${_var}_DEBUG ${${_var}} PARENT_SCOPE)
+ endif()
+endfunction(_GTK2_FIND_LIBRARY)
+
+#=============================================================
+
+#
+# main()
+#
+
+set(GTK2_FOUND)
+set(GTK2_INCLUDE_DIRS)
+set(GTK2_LIBRARIES)
+
+if(NOT GTK2_FIND_COMPONENTS)
+ # Assume they only want GTK
+ set(GTK2_FIND_COMPONENTS gtk)
+endif()
+
+#
+# If specified, enforce version number
+#
+if(GTK2_FIND_VERSION)
+ cmake_minimum_required(VERSION 2.6.2)
+ set(GTK2_FAILED_VERSION_CHECK true)
+ if(GTK2_DEBUG)
+ message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
+ "Searching for version ${GTK2_FIND_VERSION}")
+ endif()
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GTK_INCLUDE_DIR gtk/gtk.h)
+ if(GTK2_GTK_INCLUDE_DIR)
+ _GTK2_GET_VERSION(GTK2_MAJOR_VERSION
+ GTK2_MINOR_VERSION
+ GTK2_PATCH_VERSION
+ ${GTK2_GTK_INCLUDE_DIR}/gtk/gtkversion.h)
+ set(GTK2_VERSION
+ ${GTK2_MAJOR_VERSION}.${GTK2_MINOR_VERSION}.${GTK2_PATCH_VERSION})
+ if(GTK2_FIND_VERSION_EXACT)
+ if(GTK2_VERSION VERSION_EQUAL GTK2_FIND_VERSION)
+ set(GTK2_FAILED_VERSION_CHECK false)
+ endif()
+ else()
+ if(GTK2_VERSION VERSION_EQUAL GTK2_FIND_VERSION OR
+ GTK2_VERSION VERSION_GREATER GTK2_FIND_VERSION)
+ set(GTK2_FAILED_VERSION_CHECK false)
+ endif()
+ endif()
+ else()
+ # If we can't find the GTK include dir, we can't do version checking
+ if(GTK2_FIND_REQUIRED AND NOT GTK2_FIND_QUIETLY)
+ message(FATAL_ERROR "Could not find GTK2 include directory")
+ endif()
+ return()
+ endif()
+
+ if(GTK2_FAILED_VERSION_CHECK)
+ if(GTK2_FIND_REQUIRED AND NOT GTK2_FIND_QUIETLY)
+ if(GTK2_FIND_VERSION_EXACT)
+ message(FATAL_ERROR "GTK2 version check failed. Version ${GTK2_VERSION} was found, version ${GTK2_FIND_VERSION} is needed exactly.")
+ else()
+ message(FATAL_ERROR "GTK2 version check failed. Version ${GTK2_VERSION} was found, at least version ${GTK2_FIND_VERSION} is required")
+ endif()
+ endif()
+
+ # If the version check fails, exit out of the module here
+ return()
+ endif()
+endif()
+
+#
+# Find all components
+#
+
+find_package(Freetype)
+list(APPEND GTK2_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS})
+list(APPEND GTK2_LIBRARIES ${FREETYPE_LIBRARIES})
+
+foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
+ if(_GTK2_component STREQUAL "gtk")
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GLIB_INCLUDE_DIR glib.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GLIBCONFIG_INCLUDE_DIR glibconfig.h)
+ _GTK2_FIND_LIBRARY (GTK2_GLIB_LIBRARY glib false true)
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GOBJECT_INCLUDE_DIR gobject/gobject.h)
+ _GTK2_FIND_LIBRARY (GTK2_GOBJECT_LIBRARY gobject false true)
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GDK_PIXBUF_INCLUDE_DIR gdk-pixbuf/gdk-pixbuf.h)
+ _GTK2_FIND_LIBRARY (GTK2_GDK_PIXBUF_LIBRARY gdk_pixbuf false true)
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GDK_INCLUDE_DIR gdk/gdk.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GDKCONFIG_INCLUDE_DIR gdkconfig.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GTK_INCLUDE_DIR gtk/gtk.h)
+
+ if(UNIX)
+ _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-x11 false true)
+ _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-x11 false true)
+ else()
+ _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-win32 false true)
+ _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-win32 false true)
+ endif()
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_CAIRO_INCLUDE_DIR cairo.h)
+ _GTK2_FIND_LIBRARY (GTK2_CAIRO_LIBRARY cairo false false)
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h)
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_PANGO_INCLUDE_DIR pango/pango.h)
+ _GTK2_FIND_LIBRARY (GTK2_PANGO_LIBRARY pango false true)
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_ATK_INCLUDE_DIR atk/atk.h)
+ _GTK2_FIND_LIBRARY (GTK2_ATK_LIBRARY atk false true)
+
+
+ elseif(_GTK2_component STREQUAL "gtkmm")
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GLIBMM_INCLUDE_DIR glibmm.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GLIBMMCONFIG_INCLUDE_DIR glibmmconfig.h)
+ _GTK2_FIND_LIBRARY (GTK2_GLIBMM_LIBRARY glibmm true true)
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GDKMM_INCLUDE_DIR gdkmm.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GDKMMCONFIG_INCLUDE_DIR gdkmmconfig.h)
+ _GTK2_FIND_LIBRARY (GTK2_GDKMM_LIBRARY gdkmm true true)
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GTKMM_INCLUDE_DIR gtkmm.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GTKMMCONFIG_INCLUDE_DIR gtkmmconfig.h)
+ _GTK2_FIND_LIBRARY (GTK2_GTKMM_LIBRARY gtkmm true true)
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMM_INCLUDE_DIR cairomm/cairomm.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMMCONFIG_INCLUDE_DIR cairommconfig.h)
+ _GTK2_FIND_LIBRARY (GTK2_CAIROMM_LIBRARY cairomm true true)
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMM_INCLUDE_DIR pangomm.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMMCONFIG_INCLUDE_DIR pangommconfig.h)
+ _GTK2_FIND_LIBRARY (GTK2_PANGOMM_LIBRARY pangomm true true)
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_SIGC++_INCLUDE_DIR sigc++/sigc++.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_SIGC++CONFIG_INCLUDE_DIR sigc++config.h)
+ _GTK2_FIND_LIBRARY (GTK2_SIGC++_LIBRARY sigc true true)
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GIOMM_INCLUDE_DIR giomm.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GIOMMCONFIG_INCLUDE_DIR giommconfig.h)
+ _GTK2_FIND_LIBRARY (GTK2_GIOMM_LIBRARY giomm true true)
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_ATKMM_INCLUDE_DIR atkmm.h)
+ _GTK2_FIND_LIBRARY (GTK2_ATKMM_LIBRARY atkmm true true)
+
+ elseif(_GTK2_component STREQUAL "glade")
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GLADE_INCLUDE_DIR glade/glade.h)
+ _GTK2_FIND_LIBRARY (GTK2_GLADE_LIBRARY glade false true)
+
+ elseif(_GTK2_component STREQUAL "glademm")
+
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GLADEMM_INCLUDE_DIR libglademm.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GLADEMMCONFIG_INCLUDE_DIR libglademmconfig.h)
+ _GTK2_FIND_LIBRARY (GTK2_GLADEMM_LIBRARY glademm true true)
+
+ else()
+ message(FATAL_ERROR "Unknown GTK2 component ${_component}")
+ endif()
+endforeach()
+
+#
+# Solve for the GTK2 version if we haven't already
+#
+if(NOT GTK2_FIND_VERSION AND GTK2_GTK_INCLUDE_DIR)
+ _GTK2_GET_VERSION(GTK2_MAJOR_VERSION
+ GTK2_MINOR_VERSION
+ GTK2_PATCH_VERSION
+ ${GTK2_GTK_INCLUDE_DIR}/gtk/gtkversion.h)
+ set(GTK2_VERSION ${GTK2_MAJOR_VERSION}.${GTK2_MINOR_VERSION}.${GTK2_PATCH_VERSION})
+endif()
+
+#
+# Try to enforce components
+#
+
+set(_GTK2_did_we_find_everything true) # This gets set to GTK2_FOUND
+
+include(FindPackageHandleStandardArgs)
+
+foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
+ string(TOUPPER ${_GTK2_component} _COMPONENT_UPPER)
+
+ if(_GTK2_component STREQUAL "gtk")
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK2_${_COMPONENT_UPPER} "Some or all of the gtk libraries were not found."
+ GTK2_GTK_LIBRARY
+ GTK2_GTK_INCLUDE_DIR
+
+ GTK2_GLIB_INCLUDE_DIR
+ GTK2_GLIBCONFIG_INCLUDE_DIR
+ GTK2_GLIB_LIBRARY
+
+ GTK2_GDK_INCLUDE_DIR
+ GTK2_GDKCONFIG_INCLUDE_DIR
+ GTK2_GDK_LIBRARY
+ )
+ elseif(_GTK2_component STREQUAL "gtkmm")
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK2_${_COMPONENT_UPPER} "Some or all of the gtkmm libraries were not found."
+ GTK2_GTKMM_LIBRARY
+ GTK2_GTKMM_INCLUDE_DIR
+ GTK2_GTKMMCONFIG_INCLUDE_DIR
+
+ GTK2_GLIBMM_INCLUDE_DIR
+ GTK2_GLIBMMCONFIG_INCLUDE_DIR
+ GTK2_GLIBMM_LIBRARY
+
+ GTK2_GDKMM_INCLUDE_DIR
+ GTK2_GDKMMCONFIG_INCLUDE_DIR
+ GTK2_GDKMM_LIBRARY
+ )
+ elseif(_GTK2_component STREQUAL "glade")
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK2_${_COMPONENT_UPPER} "The glade library was not found."
+ GTK2_GLADE_LIBRARY
+ GTK2_GLADE_INCLUDE_DIR
+ )
+ elseif(_GTK2_component STREQUAL "glademm")
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK2_${_COMPONENT_UPPER} "The glademm library was not found."
+ GTK2_GLADEMM_LIBRARY
+ GTK2_GLADEMM_INCLUDE_DIR
+ GTK2_GLADEMMCONFIG_INCLUDE_DIR
+ )
+ endif()
+
+ if(NOT GTK2_${_COMPONENT_UPPER}_FOUND)
+ set(_GTK2_did_we_find_everything false)
+ endif()
+endforeach()
+
+if(_GTK2_did_we_find_everything AND NOT GTK2_VERSION_CHECK_FAILED)
+ set(GTK2_FOUND true)
+else()
+ # Unset our variables.
+ set(GTK2_FOUND false)
+ set(GTK2_VERSION)
+ set(GTK2_VERSION_MAJOR)
+ set(GTK2_VERSION_MINOR)
+ set(GTK2_VERSION_PATCH)
+ set(GTK2_INCLUDE_DIRS)
+ set(GTK2_LIBRARIES)
+endif()
+
+if(GTK2_INCLUDE_DIRS)
+ list(REMOVE_DUPLICATES GTK2_INCLUDE_DIRS)
+endif()
+
diff --git a/CMakeScripts/Modules/FindGnomeVFS2.cmake b/CMakeScripts/Modules/FindGnomeVFS2.cmake
new file mode 100644
index 000000000..d942addac
--- /dev/null
+++ b/CMakeScripts/Modules/FindGnomeVFS2.cmake
@@ -0,0 +1,90 @@
+# - Try to find GnomeVFS2
+# Once done this will define
+#
+# GNOMEVFS2_FOUND - system has GnomeVFS2
+# GNOMEVFS2_INCLUDE_DIRS - the GnomeVFS2 include directory
+# GNOMEVFS2_LIBRARIES - Link these to use GnomeVFS2
+# GNOMEVFS2_DEFINITIONS - Compiler switches required for using GnomeVFS2
+#
+# 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.
+#
+
+
+if (GNOMEVFS2_LIBRARIES AND GNOMEVFS2_INCLUDE_DIRS)
+ # in cache already
+ set(GNOMEVFS2_FOUND TRUE)
+else (GNOMEVFS2_LIBRARIES AND GNOMEVFS2_INCLUDE_DIRS)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ include(UsePkgConfig)
+ pkgconfig(gnome-vfs-2.0 _GNOMEVFS2_INCLUDEDIR _GNOMEVFS2_LIBDIR _GNOMEVFS2_LDFLAGS _GNOMEVFS2_CFLAGS)
+ else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_GNOMEVFS2 gnome-vfs-2.0)
+ endif (PKG_CONFIG_FOUND)
+ endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_path(GNOMEVFS2_INCLUDE_DIR
+ NAMES
+ libgnomevfs/gnome-vfs.h
+ PATHS
+ ${_GNOMEVFS2_INCLUDEDIR}
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ $ENV{DEVLIBS_PATH}//include//
+ PATH_SUFFIXES
+ gnome-vfs-2.0
+ )
+
+ find_library(GNOMEVFS-2_LIBRARY
+ NAMES
+ gnomevfs-2
+ PATHS
+ ${_GNOMEVFS2_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ if (GNOMEVFS-2_LIBRARY)
+ set(GNOMEVFS-2_FOUND TRUE)
+ endif (GNOMEVFS-2_LIBRARY)
+
+ set(GNOMEVFS2_INCLUDE_DIRS
+ ${GNOMEVFS2_INCLUDE_DIR}
+ )
+
+ if (GNOMEVFS-2_FOUND)
+ set(GNOMEVFS2_LIBRARIES
+ ${GNOMEVFS2_LIBRARIES}
+ ${GNOMEVFS-2_LIBRARY}
+ )
+ endif (GNOMEVFS-2_FOUND)
+
+ if (GNOMEVFS2_INCLUDE_DIRS AND GNOMEVFS2_LIBRARIES)
+ set(GNOMEVFS2_FOUND TRUE)
+ endif (GNOMEVFS2_INCLUDE_DIRS AND GNOMEVFS2_LIBRARIES)
+
+ if (GNOMEVFS2_FOUND)
+ if (NOT GnomeVFS2_FIND_QUIETLY)
+ message(STATUS "Found GnomeVFS2: ${GNOMEVFS2_LIBRARIES}")
+ endif (NOT GnomeVFS2_FIND_QUIETLY)
+ else (GNOMEVFS2_FOUND)
+ if (GnomeVFS2_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find GnomeVFS2")
+ endif (GnomeVFS2_FIND_REQUIRED)
+ endif (GNOMEVFS2_FOUND)
+
+ # show the GNOMEVFS2_INCLUDE_DIRS and GNOMEVFS2_LIBRARIES variables only in the advanced view
+ mark_as_advanced(GNOMEVFS2_INCLUDE_DIRS GNOMEVFS2_LIBRARIES)
+
+endif (GNOMEVFS2_LIBRARIES AND GNOMEVFS2_INCLUDE_DIRS)
+
diff --git a/CMakeScripts/Modules/FindLCMS.cmake b/CMakeScripts/Modules/FindLCMS.cmake
new file mode 100644
index 000000000..a69d88a42
--- /dev/null
+++ b/CMakeScripts/Modules/FindLCMS.cmake
@@ -0,0 +1,90 @@
+# - Try to find LCMS
+# Once done this will define
+#
+# LCMS_FOUND - system has LCMS
+# LCMS_INCLUDE_DIRS - the LCMS include directory
+# LCMS_LIBRARIES - Link these to use LCMS
+# LCMS_DEFINITIONS - Compiler switches required for using LCMS
+#
+# 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.
+#
+
+
+if (LCMS_LIBRARIES AND LCMS_INCLUDE_DIRS)
+ # in cache already
+ set(LCMS_FOUND TRUE)
+else (LCMS_LIBRARIES AND LCMS_INCLUDE_DIRS)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ include(UsePkgConfig)
+ pkgconfig(lcms _LCMS_INCLUDEDIR _LCMS_LIBDIR _LCMS_LDFLAGS _LCMS_CFLAGS)
+ else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_LCMS lcms)
+ endif (PKG_CONFIG_FOUND)
+ endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_path(LCMS_INCLUDE_DIR
+ NAMES
+ lcms.h
+ PATHS
+ ${_LCMS_INCLUDEDIR}
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ $ENV{DEVLIBS_PATH}//include//
+ PATH_SUFFIXES
+ lcms
+ )
+
+ find_library(LCMS_LIBRARY
+ NAMES
+ lcms
+ PATHS
+ ${_LCMS_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ if (LCMS_LIBRARY)
+ set(LCMS_FOUND TRUE)
+ endif (LCMS_LIBRARY)
+
+ set(LCMS_INCLUDE_DIRS
+ ${LCMS_INCLUDE_DIR}
+ )
+
+ if (LCMS_FOUND)
+ set(LCMS_LIBRARIES
+ ${LCMS_LIBRARIES}
+ ${LCMS_LIBRARY}
+ )
+ endif (LCMS_FOUND)
+
+ if (LCMS_INCLUDE_DIRS AND LCMS_LIBRARIES)
+ set(LCMS_FOUND TRUE)
+ endif (LCMS_INCLUDE_DIRS AND LCMS_LIBRARIES)
+
+ if (LCMS_FOUND)
+ if (NOT LCMS_FIND_QUIETLY)
+ message(STATUS "Found LCMS: ${LCMS_LIBRARIES}")
+ endif (NOT LCMS_FIND_QUIETLY)
+ else (LCMS_FOUND)
+ if (LCMS_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find LCMS")
+ endif (LCMS_FIND_REQUIRED)
+ endif (LCMS_FOUND)
+
+ # show the LCMS_INCLUDE_DIRS and LCMS_LIBRARIES variables only in the advanced view
+ mark_as_advanced(LCMS_INCLUDE_DIRS LCMS_LIBRARIES)
+
+endif (LCMS_LIBRARIES AND LCMS_INCLUDE_DIRS)
+
diff --git a/CMakeScripts/Modules/FindLibWPG.cmake b/CMakeScripts/Modules/FindLibWPG.cmake
new file mode 100644
index 000000000..0d83cddee
--- /dev/null
+++ b/CMakeScripts/Modules/FindLibWPG.cmake
@@ -0,0 +1,90 @@
+# - 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 <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.
+#
+
+
+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
+ if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ include(UsePkgConfig)
+ pkgconfig(libwpg-0.1 _LIBWPG_INCLUDEDIR _LIBWPG_LIBDIR _LIBWPG_LDFLAGS _LIBWPG_CFLAGS)
+ else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_LIBWPG libwpg-0.1)
+ endif (PKG_CONFIG_FOUND)
+ endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_path(LIBWPG_INCLUDE_DIR
+ NAMES
+ libwpg/libwpg.h
+ PATHS
+ ${_LIBWPG_INCLUDEDIR}
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ $ENV{DEVLIBS_PATH}//include//
+ PATH_SUFFIXES
+ libwpg-0.1
+ )
+
+ find_library(LIBWPG-0.1_LIBRARY
+ NAMES
+ wpg-0.1
+ PATHS
+ ${_LIBWPG_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ if (LIBWPG-0.1_LIBRARY)
+ set(LIBWPG-0.1_FOUND TRUE)
+ endif (LIBWPG-0.1_LIBRARY)
+
+ set(LIBWPG_INCLUDE_DIRS
+ ${LIBWPG_INCLUDE_DIR}
+ )
+
+ if (LIBWPG-0.1_FOUND)
+ set(LIBWPG_LIBRARIES
+ ${LIBWPG_LIBRARIES}
+ ${LIBWPG-0.1_LIBRARY}
+ )
+ endif (LIBWPG-0.1_FOUND)
+
+ if (LIBWPG_INCLUDE_DIRS AND LIBWPG_LIBRARIES)
+ set(LIBWPG_FOUND TRUE)
+ endif (LIBWPG_INCLUDE_DIRS AND LIBWPG_LIBRARIES)
+
+ if (LIBWPG_FOUND)
+ if (NOT LibWPG_FIND_QUIETLY)
+ message(STATUS "Found LibWPG: ${LIBWPG_LIBRARIES}")
+ endif (NOT LibWPG_FIND_QUIETLY)
+ else (LIBWPG_FOUND)
+ if (LibWPG_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find LibWPG")
+ endif (LibWPG_FIND_REQUIRED)
+ endif (LIBWPG_FOUND)
+
+ # show the LIBWPG_INCLUDE_DIRS and LIBWPG_LIBRARIES variables only in the advanced view
+ mark_as_advanced(LIBWPG_INCLUDE_DIRS LIBWPG_LIBRARIES)
+
+endif (LIBWPG_LIBRARIES AND LIBWPG_INCLUDE_DIRS)
+
diff --git a/CMakeScripts/Modules/FindPANGOMM.cmake b/CMakeScripts/Modules/FindPANGOMM.cmake
new file mode 100644
index 000000000..953c49ef0
--- /dev/null
+++ b/CMakeScripts/Modules/FindPANGOMM.cmake
@@ -0,0 +1,89 @@
+# - Try to find PANGOMM
+# Once done this will define
+#
+# PANGOMM_FOUND - system has PANGOMM
+# PANGOMM_INCLUDE_DIRS - the PANGOMM include directory
+# PANGOMM_LIBRARIES - Link these to use PANGOMM
+# PANGOMM_DEFINITIONS - Compiler switches required for using PANGOMM
+#
+# 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.
+#
+
+
+if (PANGOMM_LIBRARIES AND PANGOMM_INCLUDE_DIRS)
+ # in cache already
+ set(PANGOMM_FOUND TRUE)
+else (PANGOMM_LIBRARIES AND PANGOMM_INCLUDE_DIRS)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ include(UsePkgConfig)
+ pkgconfig(pangomm-1.4 _PANGOMM_INCLUDEDIR _PANGOMM_LIBDIR _PANGOMM_LDFLAGS _PANGOMM_CFLAGS)
+ else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_PANGOMM pangomm-1.4)
+ endif (PKG_CONFIG_FOUND)
+ endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_path(PANGOMM_INCLUDE_DIR
+ NAMES
+ pangomm.h
+ PATHS
+ ${_PANGOMM_INCLUDEDIR}
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ PATH_SUFFIXES
+ pangomm-1.4
+ )
+
+ find_library(PANGOMM-1.4_LIBRARY
+ NAMES
+ pangomm-1.4
+ PATHS
+ ${_PANGOMM_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ if (PANGOMM-1.4_LIBRARY)
+ set(PANGOMM-1.4_FOUND TRUE)
+ endif (PANGOMM-1.4_LIBRARY)
+
+ set(PANGOMM_INCLUDE_DIRS
+ ${PANGOMM_INCLUDE_DIR}
+ )
+
+ if (PANGOMM-1.4_FOUND)
+ set(PANGOMM_LIBRARIES
+ ${PANGOMM_LIBRARIES}
+ ${PANGOMM-1.4_LIBRARY}
+ )
+ endif (PANGOMM-1.4_FOUND)
+
+ if (PANGOMM_INCLUDE_DIRS AND PANGOMM_LIBRARIES)
+ set(PANGOMM_FOUND TRUE)
+ endif (PANGOMM_INCLUDE_DIRS AND PANGOMM_LIBRARIES)
+
+ if (PANGOMM_FOUND)
+ if (NOT PANGOMM_FIND_QUIETLY)
+ message(STATUS "Found PANGOMM: ${PANGOMM_LIBRARIES}")
+ endif (NOT PANGOMM_FIND_QUIETLY)
+ else (PANGOMM_FOUND)
+ if (PANGOMM_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find PANGOMM")
+ endif (PANGOMM_FIND_REQUIRED)
+ endif (PANGOMM_FOUND)
+
+ # show the PANGOMM_INCLUDE_DIRS and PANGOMM_LIBRARIES variables only in the advanced view
+ mark_as_advanced(PANGOMM_INCLUDE_DIRS PANGOMM_LIBRARIES)
+
+endif (PANGOMM_LIBRARIES AND PANGOMM_INCLUDE_DIRS)
+
diff --git a/CMakeScripts/Modules/FindPopt.cmake b/CMakeScripts/Modules/FindPopt.cmake
new file mode 100644
index 000000000..e1368be75
--- /dev/null
+++ b/CMakeScripts/Modules/FindPopt.cmake
@@ -0,0 +1,90 @@
+# - Try to find Popt
+# Once done this will define
+#
+# POPT_FOUND - system has Popt
+# POPT_INCLUDE_DIRS - the Popt include directory
+# POPT_LIBRARIES - Link these to use Popt
+# POPT_DEFINITIONS - Compiler switches required for using Popt
+#
+# 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.
+#
+
+
+if (POPT_LIBRARIES AND POPT_INCLUDE_DIRS)
+ # in cache already
+ set(POPT_FOUND TRUE)
+else (POPT_LIBRARIES AND POPT_INCLUDE_DIRS)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ include(UsePkgConfig)
+ pkgconfig(popt _POPT_INCLUDEDIR _POPT_LIBDIR _POPT_LDFLAGS _POPT_CFLAGS)
+ else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_POPT popt)
+ endif (PKG_CONFIG_FOUND)
+ endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_path(POPT_INCLUDE_DIR
+ NAMES
+ popt.h
+ PATHS
+ ${_POPT_INCLUDEDIR}
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ $ENV{DEVLIBS_PATH}//include//
+ PATH_SUFFIXES
+ popt
+ )
+
+ find_library(POPT_LIBRARY
+ NAMES
+ popt
+ PATHS
+ ${_POPT_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ if (POPT_LIBRARY)
+ set(POPT_FOUND TRUE)
+ endif (POPT_LIBRARY)
+
+ set(POPT_INCLUDE_DIRS
+ ${POPT_INCLUDE_DIR}
+ )
+
+ if (POPT_FOUND)
+ set(POPT_LIBRARIES
+ ${POPT_LIBRARIES}
+ ${POPT_LIBRARY}
+ )
+ endif (POPT_FOUND)
+
+ if (POPT_INCLUDE_DIRS AND POPT_LIBRARIES)
+ set(POPT_FOUND TRUE)
+ endif (POPT_INCLUDE_DIRS AND POPT_LIBRARIES)
+
+ if (POPT_FOUND)
+ if (NOT Popt_FIND_QUIETLY)
+ message(STATUS "Found Popt: ${POPT_LIBRARIES}")
+ endif (NOT Popt_FIND_QUIETLY)
+ else (POPT_FOUND)
+ if (Popt_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find Popt")
+ endif (Popt_FIND_REQUIRED)
+ endif (POPT_FOUND)
+
+ # show the POPT_INCLUDE_DIRS and POPT_LIBRARIES variables only in the advanced view
+ mark_as_advanced(POPT_INCLUDE_DIRS POPT_LIBRARIES)
+
+endif (POPT_LIBRARIES AND POPT_INCLUDE_DIRS)
+
diff --git a/CMakeScripts/Modules/FindPython.cmake b/CMakeScripts/Modules/FindPython.cmake
new file mode 100644
index 000000000..1ac451541
--- /dev/null
+++ b/CMakeScripts/Modules/FindPython.cmake
@@ -0,0 +1,13 @@
+# figure out Python flags
+FIND_PACKAGE(PythonInterp)
+IF(PYTHONINTERP_FOUND)
+ EXEC_PROGRAM(${PYTHON_EXECUTABLE}
+ ARGS ${CMAKE_SOURCE_DIR}/makelib/python_config_var.py LIBS
+ OUTPUT_VARIABLE PYTHON_LINK_LIBRARIES )
+ EXEC_PROGRAM(${PYTHON_EXECUTABLE}
+ ARGS ${CMAKE_SOURCE_DIR}/makelib/python_config_var.py LINKFORSTATIC
+ OUTPUT_VARIABLE PYTHON_LINKFORSTATIC )
+ELSE(PYTHONINTERP_FOUND)
+ SET(PYTHON_LINK_LIBRARIES "")
+ SET(PYTHON_LINKFORSTATIC "")
+ENDIF(PYTHONINTERP_FOUND)
diff --git a/CMakeScripts/Modules/FindSigC++.cmake b/CMakeScripts/Modules/FindSigC++.cmake
new file mode 100644
index 000000000..ed0abc545
--- /dev/null
+++ b/CMakeScripts/Modules/FindSigC++.cmake
@@ -0,0 +1,106 @@
+# - Try to find SIGC++
+# Once done this will define
+#
+# SIGC++_FOUND - system has SIGC++
+# SIGC++_INCLUDE_DIRS - the SIGC++ include directory
+# SIGC++_LIBRARIES - Link these to use SIGC++
+# SIGC++_DEFINITIONS - Compiler switches required for using SIGC++
+#
+# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
+#
+# Redistribution and use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+
+if (SIGC++_LIBRARIES AND SIGC++_INCLUDE_DIRS)
+ # in cache already
+ set(SIGC++_FOUND TRUE)
+else (SIGC++_LIBRARIES AND SIGC++_INCLUDE_DIRS)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ include(UsePkgConfig)
+ pkgconfig(sigc++-2.0 _SIGC++_INCLUDEDIR _SIGC++_LIBDIR _SIGC++_LDFLAGS _SIGC++_CFLAGS)
+ else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_SIGC++ sigc++-2.0)
+ endif (PKG_CONFIG_FOUND)
+ endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+
+ find_path(SIGC++_INCLUDE_DIR
+ NAMES
+ sigc++/sigc++.h
+ PATHS
+ ${_SIGC++_INCLUDEDIR}
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ PATH_SUFFIXES
+ sigc++-2.0
+ )
+
+ find_path(SIGC++_CONFIG_INCLUDE_DIR
+ NAMES
+ sigc++config.h
+ PATHS
+ ${_SIGC++_INCLUDEDIR}
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /opt/local/lib/sigc++-2.0/include
+ /sw/include
+ /usr/lib/sigc++-2.0/include
+ /usr/lib64/sigc++-2.0/include
+ )
+
+ find_library(SIGC-2.0_LIBRARY
+ NAMES
+ sigc-2.0
+ PATHS
+ ${_SIGC++_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ if (SIGC-2.0_LIBRARY)
+ set(SIGC-2.0_FOUND TRUE)
+ endif (SIGC-2.0_LIBRARY)
+
+ set(SIGC++_INCLUDE_DIRS
+ ${SIGC++_INCLUDE_DIR}
+ ${SIGC++_CONFIG_INCLUDE_DIR}
+ )
+
+ if (SIGC-2.0_FOUND)
+ set(SIGC++_LIBRARIES
+ ${SIGC++_LIBRARIES}
+ ${SIGC-2.0_LIBRARY}
+ )
+ endif (SIGC-2.0_FOUND)
+
+ if (SIGC++_INCLUDE_DIRS AND SIGC++_LIBRARIES)
+ set(SIGC++_FOUND TRUE)
+ endif (SIGC++_INCLUDE_DIRS AND SIGC++_LIBRARIES)
+
+ if (SIGC++_FOUND)
+ if (NOT SIGC++_FIND_QUIETLY)
+ message(STATUS "Found SIGC++: ${SIGC++_LIBRARIES}")
+ endif (NOT SIGC++_FIND_QUIETLY)
+ else (SIGC++_FOUND)
+ if (SIGC++_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find SIGC++")
+ endif (SIGC++_FIND_REQUIRED)
+ endif (SIGC++_FOUND)
+
+ # show the SIGC++_INCLUDE_DIRS and SIGC++_LIBRARIES variables only in the advanced view
+ mark_as_advanced(SIGC++_INCLUDE_DIRS SIGC++_LIBRARIES)
+
+endif (SIGC++_LIBRARIES AND SIGC++_INCLUDE_DIRS)
+
+