diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeGraphVizOptions.cmake | 83 | ||||
-rw-r--r-- | Modules/CMakePrintHelpers.cmake | 146 | ||||
-rw-r--r-- | Modules/FindGTK2.cmake | 175 | ||||
-rw-r--r-- | Modules/FindPNG.cmake | 33 | ||||
-rw-r--r-- | Modules/Qt4Macros.cmake | 9 |
5 files changed, 354 insertions, 92 deletions
diff --git a/Modules/CMakeGraphVizOptions.cmake b/Modules/CMakeGraphVizOptions.cmake new file mode 100644 index 0000000..e4af54c --- /dev/null +++ b/Modules/CMakeGraphVizOptions.cmake @@ -0,0 +1,83 @@ +##section Variables specific to the graphviz support +##end +##module +# - The builtin graphviz support of CMake. +# CMake can generate graphviz files, showing the dependencies between +# the targets in a project and also external libraries which are linked +# against. +# When CMake is run with the --graphiz=foo option, it will produce +# * a foo.dot file showing all dependencies in the project +# * a foo.dot.<target> file for each target, file showing on which other targets the respective target depends +# * a foo.dot.<target>.dependers file, showing which other targets depend on the respective target +# +# This can result in huge graphs. Using the file CMakeGraphVizOptions.cmake +# the look and content of the generated graphs can be influenced. +# This file is searched first in ${CMAKE_BINARY_DIR} and then in +# ${CMAKE_SOURCE_DIR}. If found, it is read and the variables set in it +# are used to adjust options for the generated graphviz files. +##end +# +##variable +# GRAPHVIZ_GRAPH_TYPE - The graph type +# Mandatory : NO +# Default : "digraph" +##end +##variable +# GRAPHVIZ_GRAPH_NAME - The graph name. +# Mandatory : NO +# Default : "GG" +##end +##variable +# GRAPHVIZ_GRAPH_HEADER - The header written at the top of the graphviz file. +# Mandatory : NO +# Default : "node [n fontsize = "12"];" +##end +##variable +# GRAPHVIZ_NODE_PREFIX - The prefix for each node in the graphviz file. +# Mandatory : NO +# Default : "node" +##end +##variable +# GRAPHVIZ_EXECUTABLES - Set this to FALSE to exclude executables from the generated graphs. +# Mandatory : NO +# Default : TRUE +##end +##variable +# GRAPHVIZ_STATIC_LIBS - Set this to FALSE to exclude static libraries from the generated graphs. +# Mandatory : NO +# Default : TRUE +##end +##variable +# GRAPHVIZ_SHARED_LIBS - Set this to FALSE to exclude shared libraries from the generated graphs. +# Mandatory : NO +# Default : TRUE +##end +##variable +# GRAPHVIZ_MODULE_LIBS - Set this to FALSE to exclude static libraries from the generated graphs. +# Mandatory : NO +# Default : TRUE +##end +##variable +# GRAPHVIZ_EXTERNAL_LIBS - Set this to FALSE to exclude external libraries from the generated graphs. +# Mandatory : NO +# Default : TRUE +##end +##variable +# GRAPHVIZ_IGNORE_TARGETS - A list of regular expressions for ignoring targets. +# Mandatory : NO +# Default : empty +##end + +#============================================================================= +# Copyright 2007-2009 Kitware, Inc. +# Copyright 2013 Alexander Neundorf <neundorf@kde.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. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) diff --git a/Modules/CMakePrintHelpers.cmake b/Modules/CMakePrintHelpers.cmake new file mode 100644 index 0000000..ef5d857 --- /dev/null +++ b/Modules/CMakePrintHelpers.cmake @@ -0,0 +1,146 @@ +# - Convenience macros for printing properties and variables, useful e.g. for debugging. +# +# +# CMAKE_PRINT_PROPERTIES([TARGETS target1 .. targetN] +# [SOURCES source1 .. sourceN] +# [DIRECTORIES dir1 .. dirN] +# [TESTS test1 .. testN] +# [CACHE_ENTRIES entry1 .. entryN] +# PROPERTIES prop1 .. propN ) +# +# This macro prints the values of the properties of the given targets, +# source files, directories, tests or cache entries. Exactly one of the +# scope keywords must be used. +# Example: +# cmake_print_properties(TARGETS foo bar PROPERTIES LOCATION INTERFACE_INCLUDE_DIRS) +# This will print the LOCATION and INTERFACE_INCLUDE_DIRS properties for both +# targets foo and bar. +# +# +# CMAKE_PRINT_VARIABLES(var1 var2 .. varN) +# +# This macro will print the name of each variable followed by its value. +# Example: +# cmake_print_variables(CMAKE_C_COMPILER CMAKE_MAJOR_VERSION THIS_ONE_DOES_NOT_EXIST) +# Gives: +# -- CMAKE_C_COMPILER="/usr/bin/gcc" ; CMAKE_MAJOR_VERSION="2" ; THIS_ONE_DOES_NOT_EXIST="" + +#============================================================================= +# Copyright 2013 Alexander Neundorf, <neundorf@kde.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. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +include(CMakeParseArguments) + +function(CMAKE_PRINT_VARIABLES) + set(msg "") + foreach(var ${ARGN}) + if(msg) + set(msg "${msg} ; ") + endif() + set(msg "${msg}${var}=\"${${var}}\"") + endforeach() + message(STATUS "${msg}") +endfunction() + + +function(CMAKE_PRINT_PROPERTIES ) + set(options ) + set(oneValueArgs ) + set(multiValueArgs TARGETS SOURCES TESTS DIRECTORIES CACHE_ENTRIES PROPERTIES ) + + cmake_parse_arguments(CPP "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(CPP_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to cmake_print_properties(): \"${CPP_UNPARSED_ARGUMENTS}\"") + return() + endif() + + if(NOT CPP_PROPERTIES) + message(FATAL_ERROR "Required argument PROPERTIES missing in cmake_print_properties() call") + return() + endif() + + set(mode) + set(items) + set(keyword) + + if(CPP_TARGETS) + set(items ${CPP_TARGETS}) + set(mode ${mode} TARGETS) + set(keyword TARGET) + endif() + + if(CPP_SOURCES) + set(items ${CPP_SOURCES}) + set(mode ${mode} SOURCES) + set(keyword SOURCE) + endif() + + if(CPP_TESTS) + set(items ${CPP_TESTS}) + set(mode ${mode} TESTS) + set(keyword TEST) + endif() + + if(CPP_DIRECTORIES) + set(items ${CPP_DIRECTORIES}) + set(mode ${mode} DIRECTORIES) + set(keyword DIRECTORY) + endif() + + if(CPP_CACHE_ENTRIES) + set(items ${CPP_CACHE_ENTRIES}) + set(mode ${mode} CACHE_ENTRIES) + set(keyword CACHE) + endif() + + if(NOT mode) + message(FATAL_ERROR "Mode keyword missing in cmake_print_properties() call, must be one of TARGETS SOURCES TESTS DIRECTORIES CACHE_ENTRIES PROPERTIES") + return() + endif() + + list(LENGTH mode modeLength) + if("${modeLength}" GREATER 1) + message(FATAL_ERROR "Multiple mode keyword used in cmake_print_properties() call, it must be exactly one of TARGETS SOURCES TESTS DIRECTORIES CACHE_ENTRIES PROPERTIES") + return() + endif() + + set(msg "\n") + foreach(item ${items}) + + set(itemExists TRUE) + if(keyword STREQUAL "TARGET") + if(NOT TARGET ${item}) + set(itemExists FALSE) + set(msg "${msg}\n No such TARGET \"${item}\" !\n\n") + endif() + endif() + + if (itemExists) + set(msg "${msg} Properties for ${keyword} ${item}:\n") + foreach(prop ${CPP_PROPERTIES}) + + get_property(propertySet ${keyword} ${item} PROPERTY "${prop}" SET) + + if(propertySet) + get_property(property ${keyword} ${item} PROPERTY "${prop}") + set(msg "${msg} ${item}.${prop} = \"${property}\"\n") + else() + set(msg "${msg} ${item}.${prop} = <NOTFOUND>\n") + endif() + endforeach() + endif() + + endforeach() + message(STATUS "${msg}") + +endfunction() diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index de17f16..4f522e5 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -28,7 +28,6 @@ # 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 # @@ -67,6 +66,17 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +# Version 1.5 (UNRELEASED) (CMake 2.8.12) +# * 14236: Detect gthread library +# Detect pangocairo on windows +# Detect pangocairo with gtk module instead of with gtkmm +# * 14259: Use vc100 libraries with MSVC11 +# * 14260: Export a GTK2_DEFINITIONS variable to set /vd2 when appropriate +# (i.e. MSVC) +# * Use the optimized/debug syntax for _LIBRARY and _LIBRARIES variables when +# appropriate. A new set of _RELEASE variables was also added. +# * Remove GTK2_SKIP_MARK_AS_ADVANCED option, as now the variables are +# marked as advanced by SelectLibraryConfigurations # Version 1.4 (10/4/2012) (CMake 2.8.10) # * 12596: Missing paths for FindGTK2 on NetBSD # * 12049: Fixed detection of GTK include files in the lib folder on @@ -117,6 +127,9 @@ # _OUT_micro = Micro version number # _gtkversion_hdr = Header file to parse #============================================================= + +include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) + function(_GTK2_GET_VERSION _OUT_major _OUT_minor _OUT_micro _gtkversion_hdr) file(STRINGS ${_gtkversion_hdr} _contents REGEX "#define GTK_M[A-Z]+_VERSION[ \t]+") if(_contents) @@ -145,7 +158,7 @@ endfunction() #============================================================= # _GTK2_FIND_INCLUDE_DIR # Internal function to find the GTK include directories -# _var = variable to set +# _var = variable to set (_INCLUDE_DIR is appended) # _hdr = header file to look for #============================================================= function(_GTK2_FIND_INCLUDE_DIR _var _hdr) @@ -201,7 +214,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr) message(STATUS "Adding ${_gtk2_arch_dir} to search path for multiarch support") endif() endif() - find_path(${_var} ${_hdr} + find_path(${_var}_INCLUDE_DIR ${_hdr} PATHS ${_gtk2_arch_dir} /usr/local/lib64 @@ -228,11 +241,8 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr) ${_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() + if(${_var}_INCLUDE_DIR) + set(GTK2_INCLUDE_DIRS ${GTK2_INCLUDE_DIRS} ${${_var}_INCLUDE_DIR} PARENT_SCOPE) endif() endfunction() @@ -240,7 +250,7 @@ endfunction() #============================================================= # _GTK2_FIND_LIBRARY # Internal function to find libraries packaged with GTK2 -# _var = library variable to create +# _var = library variable to create (_LIBRARY is appended) #============================================================= function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version) @@ -322,10 +332,10 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version) if(GTK2_DEBUG) message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] " - "While searching for ${_var}, our proposed library list is ${_lib_list}") + "While searching for ${_var}_LIBRARY, our proposed library list is ${_lib_list}") endif() - find_library(${_var} + find_library(${_var}_LIBRARY_RELEASE NAMES ${_lib_list} PATHS /opt/gnome/lib @@ -339,34 +349,34 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version) 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}") + "While searching for ${_var}_LIBRARY_DEBUG our proposed library list is ${_libd_list}") endif() - find_library(${_var}_DEBUG + find_library(${_var}_LIBRARY_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 ) + endif() - 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) + select_library_configurations(${_var}) + + set(${_var}_LIBRARY ${${_var}_LIBRARY} PARENT_SCOPE) + + set(GTK2_LIBRARIES ${GTK2_LIBRARIES} ${${_var}_LIBRARY}) + set(GTK2_LIBRARIES ${GTK2_LIBRARIES} PARENT_SCOPE) + + if(GTK2_DEBUG) + message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] " + "${_var}_LIBRARY_RELEASE = \"${${_var}_LIBRARY_RELEASE}\"") + message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] " + "${_var}_LIBRARY_DEBUG = \"${${_var}_LIBRARY_DEBUG}\"") + message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] " + "${_var}_LIBRARY = \"${${_var}_LIBRARY}\"") endif() + endfunction() #============================================================= @@ -395,7 +405,7 @@ if(GTK2_FIND_VERSION) 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) + _GTK2_FIND_INCLUDE_DIR(GTK2_GTK gtk/gtk.h) if(GTK2_GTK_INCLUDE_DIR) _GTK2_GET_VERSION(GTK2_MAJOR_VERSION GTK2_MINOR_VERSION @@ -445,90 +455,89 @@ list(APPEND GTK2_LIBRARIES ${FREETYPE_LIBRARIES}) foreach(_GTK2_component ${GTK2_FIND_COMPONENTS}) if(_GTK2_component STREQUAL "gtk") - _GTK2_FIND_INCLUDE_DIR(GTK2_GTK_INCLUDE_DIR gtk/gtk.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_GTK gtk/gtk.h) if(UNIX) - _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-x11 false true) - _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-x11 false true) + _GTK2_FIND_LIBRARY (GTK2_GTK gtk-x11 false true) + _GTK2_FIND_LIBRARY (GTK2_GDK gdk-x11 false true) else() - _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-win32 false true) - _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-win32 false true) + _GTK2_FIND_LIBRARY (GTK2_GTK gtk-win32 false true) + _GTK2_FIND_LIBRARY (GTK2_GDK gdk-win32 false true) endif() - _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_GDK gdk/gdk.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_GDKCONFIG gdkconfig.h) - _GTK2_FIND_INCLUDE_DIR(GTK2_CAIRO_INCLUDE_DIR cairo.h) - _GTK2_FIND_LIBRARY (GTK2_CAIRO_LIBRARY cairo false false) + _GTK2_FIND_INCLUDE_DIR(GTK2_CAIRO cairo.h) + _GTK2_FIND_LIBRARY (GTK2_CAIRO cairo false false) - _GTK2_FIND_INCLUDE_DIR(GTK2_FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_FONTCONFIG 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_PANGO pango/pango.h) + _GTK2_FIND_LIBRARY (GTK2_PANGO pango false true) - _GTK2_FIND_LIBRARY (GTK2_PANGOCAIRO_LIBRARY pangocairo false true) + _GTK2_FIND_LIBRARY (GTK2_PANGOCAIRO pangocairo 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_PIXBUF gdk-pixbuf/gdk-pixbuf.h) + _GTK2_FIND_LIBRARY (GTK2_GDK_PIXBUF gdk_pixbuf false true) - _GTK2_FIND_LIBRARY (GTK2_GTHREAD_LIBRARY gthread false true) + _GTK2_FIND_LIBRARY (GTK2_GTHREAD gthread false true) - _GTK2_FIND_LIBRARY (GTK2_GIO_LIBRARY gio false true) + _GTK2_FIND_LIBRARY (GTK2_GIO gio false true) - _GTK2_FIND_INCLUDE_DIR(GTK2_ATK_INCLUDE_DIR atk/atk.h) - _GTK2_FIND_LIBRARY (GTK2_ATK_LIBRARY atk false true) + _GTK2_FIND_INCLUDE_DIR(GTK2_ATK atk/atk.h) + _GTK2_FIND_LIBRARY (GTK2_ATK atk 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_GOBJECT gobject/gobject.h) + _GTK2_FIND_LIBRARY (GTK2_GOBJECT gobject false true) - _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_GLIB glib.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_GLIBCONFIG glibconfig.h) + _GTK2_FIND_LIBRARY (GTK2_GLIB glib false true) elseif(_GTK2_component STREQUAL "gtkmm") - _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_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 gtkmm.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_GTKMMCONFIG gtkmmconfig.h) + _GTK2_FIND_LIBRARY (GTK2_GTKMM gtkmm 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_GDKMM gdkmm.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_GDKMMCONFIG gdkmmconfig.h) + _GTK2_FIND_LIBRARY (GTK2_GDKMM gdkmm 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 pangomm.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMMCONFIG pangommconfig.h) + _GTK2_FIND_LIBRARY (GTK2_PANGOMM pangomm 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_CAIROMM cairomm/cairomm.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMMCONFIG cairommconfig.h) + _GTK2_FIND_LIBRARY (GTK2_CAIROMM cairomm true true) - _GTK2_FIND_INCLUDE_DIR(GTK2_ATKMM_INCLUDE_DIR atkmm.h) - _GTK2_FIND_LIBRARY (GTK2_ATKMM_LIBRARY atkmm true true) + _GTK2_FIND_INCLUDE_DIR(GTK2_GIOMM giomm.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_GIOMMCONFIG giommconfig.h) + _GTK2_FIND_LIBRARY (GTK2_GIOMM giomm true true) - _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_ATKMM atkmm.h) + _GTK2_FIND_LIBRARY (GTK2_ATKMM atkmm 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_GLIBMM glibmm.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_GLIBMMCONFIG glibmmconfig.h) + _GTK2_FIND_LIBRARY (GTK2_GLIBMM glibmm true true) + _GTK2_FIND_INCLUDE_DIR(GTK2_SIGC++ sigc++/sigc++.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_SIGC++CONFIG sigc++config.h) + _GTK2_FIND_LIBRARY (GTK2_SIGC++ sigc 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) + _GTK2_FIND_INCLUDE_DIR(GTK2_GLADE glade/glade.h) + _GTK2_FIND_LIBRARY (GTK2_GLADE 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) + _GTK2_FIND_INCLUDE_DIR(GTK2_GLADEMM libglademm.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_GLADEMMCONFIG libglademmconfig.h) + _GTK2_FIND_LIBRARY (GTK2_GLADEMM glademm true true) else() message(FATAL_ERROR "Unknown GTK2 component ${_component}") diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index fef4669..33c2971 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -39,10 +39,37 @@ if(ZLIB_FOUND) ) list(APPEND PNG_NAMES png libpng) - foreach(v 16 15 14 12) - list(APPEND PNG_NAMES png${v} libpng${v} png${v}d libpng${v}d) + unset(PNG_NAMES_DEBUG) + set(_PNG_VERSION_SUFFIXES 17 16 15 14 12) + if (PNG_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\..*)?$") + string(REGEX REPLACE + "^([0-9]+)\\.([0-9]+).*" "\\1\\2" + _PNG_VERSION_SUFFIX_MIN "${PNG_FIND_VERSION}") + if (PNG_FIND_VERSION_EXACT) + set(_PNG_VERSION_SUFFIXES ${_PNG_VERSION_SUFFIX_MIN}) + else () + string(REGEX REPLACE + "${_PNG_VERSION_SUFFIX_MIN}.*" "${_PNG_VERSION_SUFFIX_MIN}" + _PNG_VERSION_SUFFIXES "${_PNG_VERSION_SUFFIXES}") + endif () + unset(_PNG_VERSION_SUFFIX_MIN) + endif () + foreach(v IN LISTS _PNG_VERSION_SUFFIXES) + list(APPEND PNG_NAMES png${v} libpng${v}) + list(APPEND PNG_NAMES_DEBUG png${v}d libpng${v}d) endforeach() - find_library(PNG_LIBRARY NAMES ${PNG_NAMES} ) +message(STATUS "PNG r: ${PNG_NAMES} d: ${PNG_NAMES_DEBUG}") + unset(_PNG_VERSION_SUFFIXES) + find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES}) + find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG}) + unset(PNG_NAMES) + unset(PNG_NAMES_DEBUG) + + include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) + select_library_configurations(PNG) + # Set by select_library_configurations(), but we want the one from + # find_package_handle_standard_args() below. + unset(PNG_FOUND) if (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR) # png.h includes zlib.h. Sigh. diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 5e13b59..f1aedd7 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -113,19 +113,16 @@ macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target) set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}") string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}") - set(targetincludes) - set(targetdefines) if(moc_target) - list(APPEND targetincludes "$<TARGET_PROPERTY:${moc_target},INCLUDE_DIRECTORIES>") - list(APPEND targetdefines "$<TARGET_PROPERTY:${moc_target},COMPILE_DEFINITIONS>") + set(targetincludes "$<TARGET_PROPERTY:${moc_target},INCLUDE_DIRECTORIES>") + set(targetdefines "$<TARGET_PROPERTY:${moc_target},COMPILE_DEFINITIONS>") set(targetincludes "$<$<BOOL:${targetincludes}>:-I$<JOIN:${targetincludes},\n-I>\n>") set(targetdefines "$<$<BOOL:${targetdefines}>:-D$<JOIN:${targetdefines},\n-D>\n>") file (GENERATE OUTPUT ${_moc_parameters_file} - CONTENT "${targetdefines}${targetincludes}${targetoptions}${_moc_parameters}\n" - CONDITION 1 + CONTENT "${targetdefines}${targetincludes}${_moc_parameters}\n" ) set(targetincludes) |