From 31a0be24db8603de4dbb9080cd8d8c9ce07ec0ce Mon Sep 17 00:00:00 2001 From: verbalshadow Date: Fri, 9 Jan 2009 20:22:29 +0000 Subject: [PATCH] Cmake: New FindGTK2 --- CMakeScripts/DefineDependsandFlags.cmake | 6 +- CMakeScripts/FindATKMM.cmake | 89 --- CMakeScripts/FindCAIROMM.cmake | 89 --- CMakeScripts/FindGDKMM.cmake | 105 ---- CMakeScripts/FindGIOMM.cmake | 90 --- CMakeScripts/FindGLIBMM.cmake | 104 ---- CMakeScripts/FindGTK2.cmake | 720 +++++++++++------------ CMakeScripts/FindGtkMM.cmake | 129 ---- src/CMakeLists.txt | 29 +- 9 files changed, 352 insertions(+), 1009 deletions(-) delete mode 100644 CMakeScripts/FindATKMM.cmake delete mode 100644 CMakeScripts/FindCAIROMM.cmake delete mode 100644 CMakeScripts/FindGDKMM.cmake delete mode 100644 CMakeScripts/FindGIOMM.cmake delete mode 100644 CMakeScripts/FindGLIBMM.cmake delete mode 100644 CMakeScripts/FindGtkMM.cmake diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index b2d3943df..d527355ed 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -1,7 +1,7 @@ # Include dependencies: -find_package(GTK2 REQUIRED) -find_package(GtkMM REQUIRED) +find_package(GTK2 COMPONENTS gtk gtkmm REQUIRED) +#find_package(GtkMM REQUIRED) find_package(SigC++ REQUIRED) find_package(XML2 REQUIRED) find_package(XSLT REQUIRED) @@ -21,7 +21,6 @@ INCLUDE(IncludeJava) #Linking LIST(APPEND INKSCAPE_LIBS ${GTK2_LIBRARIES} -${GTKMM_LIBRARIES} ${SIGC++_LIBRARIES} ${GSL_LIBRARIES} ${XML2_LIBRARIES} @@ -42,7 +41,6 @@ ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/src ${GTK2_INCLUDE_DIRS} -${GTKMM_INCLUDE_DIRS} ${SIGC++_INCLUDE_DIRS} ${GSL_INCLUDE_DIRS} ${XML2_INCLUDE_DIRS} diff --git a/CMakeScripts/FindATKMM.cmake b/CMakeScripts/FindATKMM.cmake deleted file mode 100644 index 4998572ad..000000000 --- a/CMakeScripts/FindATKMM.cmake +++ /dev/null @@ -1,89 +0,0 @@ -# - Try to find ATKMM -# Once done this will define -# -# ATKMM_FOUND - system has ATKMM -# ATKMM_INCLUDE_DIRS - the ATKMM include directory -# ATKMM_LIBRARIES - Link these to use ATKMM -# ATKMM_DEFINITIONS - Compiler switches required for using ATKMM -# -# 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 (ATKMM_LIBRARIES AND ATKMM_INCLUDE_DIRS) - # in cache already - set(ATKMM_FOUND TRUE) -else (ATKMM_LIBRARIES AND ATKMM_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(atkmm-1.6 _ATKMM_INCLUDEDIR _ATKMM_LIBDIR _ATKMM_LDFLAGS _ATKMM_CFLAGS) - else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_package(PkgConfig) - if (PKG_CONFIG_FOUND) - pkg_check_modules(_ATKMM atkmm-1.6) - endif (PKG_CONFIG_FOUND) - endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_path(ATKMM_INCLUDE_DIR - NAMES - atkmm.h - PATHS - ${_ATKMM_INCLUDEDIR} - /usr/include - /usr/local/include - /opt/local/include - /sw/include - PATH_SUFFIXES - atkmm-1.6 - ) - - find_library(ATKMM-1.6_LIBRARY - NAMES - atkmm-1.6 - PATHS - ${_ATKMM_LIBDIR} - /usr/lib - /usr/local/lib - /opt/local/lib - /sw/lib - ) - - if (ATKMM-1.6_LIBRARY) - set(ATKMM-1.6_FOUND TRUE) - endif (ATKMM-1.6_LIBRARY) - - set(ATKMM_INCLUDE_DIRS - ${ATKMM_INCLUDE_DIR} - ) - - if (ATKMM-1.6_FOUND) - set(ATKMM_LIBRARIES - ${ATKMM_LIBRARIES} - ${ATKMM-1.6_LIBRARY} - ) - endif (ATKMM-1.6_FOUND) - - if (ATKMM_INCLUDE_DIRS AND ATKMM_LIBRARIES) - set(ATKMM_FOUND TRUE) - endif (ATKMM_INCLUDE_DIRS AND ATKMM_LIBRARIES) - - if (ATKMM_FOUND) - if (NOT ATKMM_FIND_QUIETLY) - message(STATUS "Found ATKMM: ${ATKMM_LIBRARIES}") - endif (NOT ATKMM_FIND_QUIETLY) - else (ATKMM_FOUND) - if (ATKMM_FIND_REQUIRED) - message(FATAL_ERROR "Could not find ATKMM") - endif (ATKMM_FIND_REQUIRED) - endif (ATKMM_FOUND) - - # show the ATKMM_INCLUDE_DIRS and ATKMM_LIBRARIES variables only in the advanced view - mark_as_advanced(ATKMM_INCLUDE_DIRS ATKMM_LIBRARIES) - -endif (ATKMM_LIBRARIES AND ATKMM_INCLUDE_DIRS) - diff --git a/CMakeScripts/FindCAIROMM.cmake b/CMakeScripts/FindCAIROMM.cmake deleted file mode 100644 index 16d6a6456..000000000 --- a/CMakeScripts/FindCAIROMM.cmake +++ /dev/null @@ -1,89 +0,0 @@ -# - Try to find CAIROMM -# Once done this will define -# -# CAIROMM_FOUND - system has CAIROMM -# CAIROMM_INCLUDE_DIRS - the CAIROMM include directory -# CAIROMM_LIBRARIES - Link these to use CAIROMM -# CAIROMM_DEFINITIONS - Compiler switches required for using CAIROMM -# -# 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 (CAIROMM_LIBRARIES AND CAIROMM_INCLUDE_DIRS) - # in cache already - set(CAIROMM_FOUND TRUE) -else (CAIROMM_LIBRARIES AND CAIROMM_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(cairomm-1.0 _CAIROMM_INCLUDEDIR _CAIROMM_LIBDIR _CAIROMM_LDFLAGS _CAIROMM_CFLAGS) - else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_package(PkgConfig) - if (PKG_CONFIG_FOUND) - pkg_check_modules(_CAIROMM cairomm-1.0) - endif (PKG_CONFIG_FOUND) - endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_path(CAIROMM_INCLUDE_DIR - NAMES - cairomm/cairomm.h - PATHS - ${_CAIROMM_INCLUDEDIR} - /usr/include - /usr/local/include - /opt/local/include - /sw/include - PATH_SUFFIXES - cairomm-1.0 - ) - - find_library(CAIROMM-1.0_LIBRARY - NAMES - cairomm-1.0 - PATHS - ${_CAIROMM_LIBDIR} - /usr/lib - /usr/local/lib - /opt/local/lib - /sw/lib - ) - - if (CAIROMM-1.0_LIBRARY) - set(CAIROMM-1.0_FOUND TRUE) - endif (CAIROMM-1.0_LIBRARY) - - set(CAIROMM_INCLUDE_DIRS - ${CAIROMM_INCLUDE_DIR} - ) - - if (CAIROMM-1.0_FOUND) - set(CAIROMM_LIBRARIES - ${CAIROMM_LIBRARIES} - ${CAIROMM-1.0_LIBRARY} - ) - endif (CAIROMM-1.0_FOUND) - - if (CAIROMM_INCLUDE_DIRS AND CAIROMM_LIBRARIES) - set(CAIROMM_FOUND TRUE) - endif (CAIROMM_INCLUDE_DIRS AND CAIROMM_LIBRARIES) - - if (CAIROMM_FOUND) - if (NOT CAIROMM_FIND_QUIETLY) - message(STATUS "Found CAIROMM: ${CAIROMM_LIBRARIES}") - endif (NOT CAIROMM_FIND_QUIETLY) - else (CAIROMM_FOUND) - if (CAIROMM_FIND_REQUIRED) - message(FATAL_ERROR "Could not find CAIROMM") - endif (CAIROMM_FIND_REQUIRED) - endif (CAIROMM_FOUND) - - # show the CAIROMM_INCLUDE_DIRS and CAIROMM_LIBRARIES variables only in the advanced view - mark_as_advanced(CAIROMM_INCLUDE_DIRS CAIROMM_LIBRARIES) - -endif (CAIROMM_LIBRARIES AND CAIROMM_INCLUDE_DIRS) - diff --git a/CMakeScripts/FindGDKMM.cmake b/CMakeScripts/FindGDKMM.cmake deleted file mode 100644 index 60c98e096..000000000 --- a/CMakeScripts/FindGDKMM.cmake +++ /dev/null @@ -1,105 +0,0 @@ -# - Try to find GDKMM -# Once done this will define -# -# GDKMM_FOUND - system has GDKMM -# GDKMM_INCLUDE_DIRS - the GDKMM include directory -# GDKMM_LIBRARIES - Link these to use GDKMM -# GDKMM_DEFINITIONS - Compiler switches required for using GDKMM -# -# 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 (GDKMM_LIBRARIES AND GDKMM_INCLUDE_DIRS) - # in cache already - set(GDKMM_FOUND TRUE) -else (GDKMM_LIBRARIES AND GDKMM_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(gdkmm-2.4 _GDKMM_INCLUDEDIR _GDKMM_LIBDIR _GDKMM_LDFLAGS _GDKMM_CFLAGS) - else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_package(PkgConfig) - if (PKG_CONFIG_FOUND) - pkg_check_modules(_GDKMM gdkmm-2.4) - endif (PKG_CONFIG_FOUND) - endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_path(GDKMM_INCLUDE_DIR - NAMES - gdkmm.h - PATHS - ${_GDKMM_INCLUDEDIR} - /usr/include - /usr/local/include - /opt/local/include - /opt/local/include/gdkmm-2.4 - /sw/include - PATH_SUFFIXES - gdkmm-2.4 - ) - - find_path(GDKMM_CONFIG_INCLUDE_DIR - NAMES - gdkmmconfig.h - PATHS - ${_GDKMM_INCLUDEDIR} - /usr/include - /usr/local/include - /opt/local/include - /opt/local/lib/gdkmm-2.4/include - /sw/include - /usr/lib/gdkmm-2.4/include - /usr/lib64/gdkmm-2.4/include - ) - - find_library(GDKMM-2.4_LIBRARY - NAMES - gdkmm-2.4 - PATHS - ${_GDKMM_LIBDIR} - /usr/lib - /usr/local/lib - /opt/local/lib - /sw/lib - ) - - if (GDKMM-2.4_LIBRARY) - set(GDKMM-2.4_FOUND TRUE) - endif (GDKMM-2.4_LIBRARY) - - set(GDKMM_INCLUDE_DIRS - ${GDKMM_INCLUDE_DIR} - ${GDKMM_CONFIG_INCLUDE_DIR} - ) - - if (GDKMM-2.4_FOUND) - set(GDKMM_LIBRARIES - ${GDKMM_LIBRARIES} - ${GDKMM-2.4_LIBRARY} - ) - endif (GDKMM-2.4_FOUND) - - if (GDKMM_INCLUDE_DIRS AND GDKMM_LIBRARIES) - set(GDKMM_FOUND TRUE) - endif (GDKMM_INCLUDE_DIRS AND GDKMM_LIBRARIES) - - if (GDKMM_FOUND) - if (NOT GDKMM_FIND_QUIETLY) - message(STATUS "Found GDKMM: ${GDKMM_LIBRARIES}") - endif (NOT GDKMM_FIND_QUIETLY) - else (GDKMM_FOUND) - if (GDKMM_FIND_REQUIRED) - message(FATAL_ERROR "Could not find GDKMM") - endif (GDKMM_FIND_REQUIRED) - endif (GDKMM_FOUND) - - # show the GDKMM_INCLUDE_DIRS and GDKMM_LIBRARIES variables only in the advanced view - mark_as_advanced(GDKMM_INCLUDE_DIRS GDKMM_LIBRARIES) - -endif (GDKMM_LIBRARIES AND GDKMM_INCLUDE_DIRS) - diff --git a/CMakeScripts/FindGIOMM.cmake b/CMakeScripts/FindGIOMM.cmake deleted file mode 100644 index 953f84b68..000000000 --- a/CMakeScripts/FindGIOMM.cmake +++ /dev/null @@ -1,90 +0,0 @@ -# - Try to find GIOMM -# Once done this will define -# -# GIOMM_FOUND - system has GIOMM -# GIOMM_INCLUDE_DIRS - the GIOMM include directory -# GIOMM_LIBRARIES - Link these to use GIOMM -# GIOMM_DEFINITIONS - Compiler switches required for using GIOMM -# -# 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 (GIOMM_LIBRARIES AND GIOMM_INCLUDE_DIRS) - # in cache already - set(GIOMM_FOUND TRUE) -else (GIOMM_LIBRARIES AND GIOMM_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(giomm-2.4 _GIOMM_INCLUDEDIR _GIOMM_LIBDIR _GIOMM_LDFLAGS _GIOMM_CFLAGS) - else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_package(PkgConfig) - if (PKG_CONFIG_FOUND) - pkg_check_modules(_GIOMM giomm-2.4) - endif (PKG_CONFIG_FOUND) - endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_path(GIOMM_INCLUDE_DIR - NAMES - giomm.h - PATHS - ${_GIOMM_INCLUDEDIR} - /usr/include - /usr/local/include - /opt/local/include - /opt/local/include/giomm-2.4/ - /sw/include - PATH_SUFFIXES - giomm-2.4 - ) - - find_library(GIOMM-2.4_LIBRARY - NAMES - giomm-2.4 - PATHS - ${_GIOMM_LIBDIR} - /usr/lib - /usr/local/lib - /opt/local/lib - /sw/lib - ) - - if (GIOMM-2.4_LIBRARY) - set(GIOMM-2.4_FOUND TRUE) - endif (GIOMM-2.4_LIBRARY) - - set(GIOMM_INCLUDE_DIRS - ${GIOMM_INCLUDE_DIR} - ) - - if (GIOMM-2.4_FOUND) - set(GIOMM_LIBRARIES - ${GIOMM_LIBRARIES} - ${GIOMM-2.4_LIBRARY} - ) - endif (GIOMM-2.4_FOUND) - - if (GIOMM_INCLUDE_DIRS AND GIOMM_LIBRARIES) - set(GIOMM_FOUND TRUE) - endif (GIOMM_INCLUDE_DIRS AND GIOMM_LIBRARIES) - - if (GIOMM_FOUND) - if (NOT GIOMM_FIND_QUIETLY) - message(STATUS "Found GIOMM: ${GIOMM_LIBRARIES}") - endif (NOT GIOMM_FIND_QUIETLY) - else (GIOMM_FOUND) - if (GIOMM_FIND_REQUIRED) - message(FATAL_ERROR "Could not find GIOMM") - endif (GIOMM_FIND_REQUIRED) - endif (GIOMM_FOUND) - - # show the GIOMM_INCLUDE_DIRS and GIOMM_LIBRARIES variables only in the advanced view - mark_as_advanced(GIOMM_INCLUDE_DIRS GIOMM_LIBRARIES) - -endif (GIOMM_LIBRARIES AND GIOMM_INCLUDE_DIRS) - diff --git a/CMakeScripts/FindGLIBMM.cmake b/CMakeScripts/FindGLIBMM.cmake deleted file mode 100644 index 435faf868..000000000 --- a/CMakeScripts/FindGLIBMM.cmake +++ /dev/null @@ -1,104 +0,0 @@ -# - Try to find glibmm -# Once done this will define -# -# GLIBMM_FOUND - system has glibmm -# GLIBMM_INCLUDE_DIRS - the glibmm include directory -# GLIBMM_LIBRARIES - Link these to use glibmm -# GLIBMM_DEFINITIONS - Compiler switches required for using glibmm -# -# 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 (GLIBMM_LIBRARIES AND GLIBMM_INCLUDE_DIRS) - # in cache already - set(GLIBMM_FOUND TRUE) -else (GLIBMM_LIBRARIES AND GLIBMM_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(glibmm-2.4 _GLIBMM_INCLUDEDIR _GLIBMM_LIBDIR _GLIBMM_LDFLAGS _GLIBMM_CFLAGS) - else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_package(PkgConfig) - if (PKG_CONFIG_FOUND) - pkg_check_modules(_GLIBMM glibmm-2.4) - endif (PKG_CONFIG_FOUND) - endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_path(GLIBMM_INCLUDE_DIR - NAMES - glibmm.h - PATHS - ${_GLIBMM_INCLUDEDIR} - /usr/include - /usr/local/include - /opt/local/include - /opt/local/lib/glibmm-2.4/include - /sw/include - PATH_SUFFIXES - glibmm-2.4 - ) - - find_path(GLIBMM_CONFIG_INCLUDE_DIR - NAMES - glibmmconfig.h - PATHS - ${_GLIBMM_INCLUDEDIR} - /usr/include - /usr/local/include - /opt/local/include - /opt/local/lib/glibmm-2.4/include - /sw/include - /usr/lib/glibmm-2.4/include - /usr/lib64/glibmm-2.4/include - ) - find_library(GLIBMM-2.4_LIBRARY - NAMES - glibmm-2.4 - PATHS - ${_GLIBMM_LIBDIR} - /usr/lib - /usr/local/lib - /opt/local/lib - /sw/lib - ) - - if (GLIBMM-2.4_LIBRARY) - set(GLIBMM-2.4_FOUND TRUE) - endif (GLIBMM-2.4_LIBRARY) - - set(GLIBMM_INCLUDE_DIRS - ${GLIBMM_INCLUDE_DIR} - ${GLIBMM_CONFIG_INCLUDE_DIR} - ) - - if (GLIBMM-2.4_FOUND) - set(GLIBMM_LIBRARIES - ${GLIBMM_LIBRARIES} - ${GLIBMM-2.4_LIBRARY} - ) - endif (GLIBMM-2.4_FOUND) - - if (GLIBMM_INCLUDE_DIRS AND GLIBMM_LIBRARIES) - set(GLIBMM_FOUND TRUE) - endif (GLIBMM_INCLUDE_DIRS AND GLIBMM_LIBRARIES) - - if (GLIBMM_FOUND) - if (NOT glibmm_FIND_QUIETLY) - message(STATUS "Found glibmm: ${GLIBMM_LIBRARIES}") - endif (NOT glibmm_FIND_QUIETLY) - else (GLIBMM_FOUND) - if (glibmm_FIND_REQUIRED) - message(FATAL_ERROR "Could not find glibmm") - endif (glibmm_FIND_REQUIRED) - endif (GLIBMM_FOUND) - - # show the GLIBMM_INCLUDE_DIRS and GLIBMM_LIBRARIES variables only in the advanced view - mark_as_advanced(GLIBMM_INCLUDE_DIRS GLIBMM_LIBRARIES) - -endif (GLIBMM_LIBRARIES AND GLIBMM_INCLUDE_DIRS) - diff --git a/CMakeScripts/FindGTK2.cmake b/CMakeScripts/FindGTK2.cmake index 06105bd04..b8b88bf4d 100644 --- a/CMakeScripts/FindGTK2.cmake +++ b/CMakeScripts/FindGTK2.cmake @@ -1,409 +1,363 @@ +# - FindGTK2.cmake +# This module finds the GTK2/GTKMM widget libraries # -# try to find GTK2 (and glib) and GTK2GLArea +# Specify one or more of the following components +# as you call this Find macro: # -# GTK2_INCLUDE_DIRS - Directories to include to use GTK2 -# GTK2_LIBRARIES - Files to link against to use GTK2 -# GTK2_FOUND - If false, don't try to use GTK2 -# GTK2_GL_FOUND - If false, don't try to use GTK2's GL features +# 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 # -# Copyright (c) 2004 Jan Woetzel -# Copyright (c) 2006 Andreas Schneider +# 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 # -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. +#================= +# Example Usage: # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# FIND_PACKAGE(GTK2 COMPONENTS gtk) +# or +# FIND_PACKAGE(GTK2 COMPONENTS gtk glade) # if you're also using glade # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. +# INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS}) +# ADD_EXECUTABLE(foo foo.cc) +# TARGET_LINK_LIBRARIES(foo ${GTK2_LIBRARIES}) +#================= +# +# Copyright (c) 2008 +# Philip Lowman # -################################################################### +# 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 # -# Copyright (c) 2004 Jan Woetzel -# Copyright (c) 2006 Andreas Schneider -# 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 name of the nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +#============================================================= +# _GTK2_FIND_INCLUDE_DIR +# Internal macro to find the GTK include directories +# _var = variable to set +# _hdr = header file to look for +#============================================================= +MACRO(_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 + # FIXME + glibmm-2.4 + glib-2.0 + atk-1.0 + atkmm-1.6 + cairo + cairomm-1.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/include + /usr/local/lib + /usr/include + /usr/lib + [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/include + [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/lib + PATH_SUFFIXES + ${_suffixes} + ) + + IF(${_var}) + LIST(APPEND GTK2_INCLUDE_DIRS ${${_var}}) + IF(NOT GTK2_SKIP_MARK_AS_ADVANCED) + MARK_AS_ADVANCED(${_var}) + ENDIF() + ENDIF() +ENDMACRO() + +#============================================================= +# _GTK2_FIND_LIBRARY +# Internal macro to find libraries packaged with GTK2 +# _var = library variable to create +#============================================================= +MACRO(_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}) + # Add vc80/vc90 midfixes + IF(MSVC80) + SET(_library ${_library}-vc80) + SET(_library_d ${_library}-d) + ELSEIF(MSVC90) + SET(_library ${_library}-vc90) + SET(_library_d ${_library}-d) + ENDIF() + 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}] Whilst searching for ${_var} our proposed library list is ${_lib_list}") + ENDIF() + + FIND_LIBRARY(${_var} + NAMES ${_lib_list} + PATHS + [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}] Whilst searching for ${_var}_DEBUG our proposed library list is ${_libd_list}") + ENDIF() + + FIND_LIBRARY(${_var}_DEBUG + NAMES ${_libd_list} + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/lib + ) + IF(NOT GTK2_SKIP_MARK_AS_ADVANCED) + MARK_AS_ADVANCED(${_var}_DEBUG) + ENDIF() + ELSE() + SET(${_var}_DEBUG ${${_var}}) + ENDIF() + + IF(${_var}) + LIST(APPEND GTK2_LIBRARIES optimized ${${_var}} debug ${${_var}_DEBUG} ) + IF(NOT GTK2_SKIP_MARK_AS_ADVANCED) + MARK_AS_ADVANCED(${_var}) + ENDIF() + ENDIF() +ENDMACRO() +#============================================================= + # -# 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 OWNER 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. +# main() # -IF (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) - # in cache already - SET(GTK2_FOUND TRUE) -ELSE (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) - - #check whether cmake version is 2.4 or greater - if (${CMAKE_MAJOR_VERSION} GREATER 1 AND ${CMAKE_MINOR_VERSION} GREATER 3) - SET(GTK2_CMAKE_24 TRUE) - endif (${CMAKE_MAJOR_VERSION} GREATER 1 AND ${CMAKE_MINOR_VERSION} GREATER 3) - - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - if (GTK2_CMAKE_24) - include(UsePkgConfig) - else (GTK2_CMAKE_24) - find_package(PkgConfig) - endif (GTK2_CMAKE_24) - INCLUDE(UsePkgConfig) - - if (GTK2_CMAKE_24) - pkgconfig(gtk+-2.0 _GTK2_INCLUDEDIR _GTK2_LIBDIR _GTK2_LDFLAGS _GTK2_CFLAGS) - MESSAGE(STATUS "DEBUG pkgconfig found: ${_GTK2_INCLUDEDIR} ${_GTK2_LIBDIR} ${_GTK2_LDFLAGS} ${_GTK2_CFLAGS}") - else (GTK2_CMAKE_24) - if (PKG_CONFIG_FOUND) - pkg_check_modules(_GTK2 gtk+-2.0) - endif (PKG_CONFIG_FOUND) - endif (GTK2_CMAKE_24) - - FIND_PATH(GTK2_GTK_INCLUDE_PATH gtk/gtk.h - $ENV{GTK2_HOME} - ${_GTK2_INCLUDEDIR} - /usr/include/gtk-2.0 - /usr/local/include/gtk-2.0 - /opt/gnome/include/gtk-2.0 - /opt/local/include/gtk-2.0 - $ENV{DEVLIBS_PATH}//include// - ) +SET(GTK2_FOUND) +SET(GTK2_INCLUDE_DIRS) +SET(GTK2_LIBRARIES) - # Some Linux distributions (e.g. Red Hat) have glibconfig.h - # and glib.h in different directories, so we need to look - # for both. - # - Atanas Georgiev - if (GTK2_CMAKE_24) - pkgconfig(glib-2.0 _GLIB2_INCLUDEDIR _GLIB2inkDir _GLIB2_LDFLAGS _GLIB2_CFLAGS) - pkgconfig(gmodule-2.0 _GMODULE2_INCLUDEDIR _GMODULE2inkDir _GMODULE2_LDFLAGS _GMODULE2_CFLAGS) - else (GTK2_CMAKE_24) - if (PKG_CONFIG_FOUND) - pkg_check_modules(_GLIB2 glib-2.0) - pkg_check_modules(_GMODULE2 gmodule-2.0) - endif (PKG_CONFIG_FOUND) - endif (GTK2_CMAKE_24) - - SET(GDIR /opt/gnome/lib/glib-2.0/include) - FIND_PATH(GTK2_GLIBCONFIG_INCLUDE_PATH glibconfig.h - ${_GLIB2_INCLUDEDIR} - /opt/gnome/lib64/glib-2.0/include - /opt/gnome/lib/glib-2.0/include - /usr/lib64/glib-2.0/include - /usr/lib/glib-2.0/include - /opt/local/lib/glib-2.0/include - $ENV{DEVLIBS_PATH}//include// - ) - #MESSAGE(STATUS "DEBUG: GTK2_GLIBCONFIG_INCLUDE_PATH = ${GTK2_GLIBCONFIG_INCLUDE_PATH}") - - FIND_PATH(GTK2_GLIB_INCLUDE_PATH glib.h - ${_GLIB2_INCLUDEDIR} - /opt/gnome/include/glib-2.0 - /usr/include/glib-2.0 - /opt/local/include/glib-2.0 - $ENV{DEVLIBS_PATH}//include// - ) - #MESSAGE(STATUS "DEBUG: GTK2_GLIBCONFIG_INCLUDE_PATH = ${GTK2_GLIBCONFIG_INCLUDE_PATH}") - - FIND_PATH(GTK2_GTKGL_INCLUDE_PATH gtkgl/gtkglarea.h - ${_GLIB2_INCLUDEDIR} - /usr/include - /usr/local/include - /usr/openwin/share/include - /opt/gnome/include - /opt/local/include - $ENV{DEVLIBS_PATH}//include// - ) +IF(NOT GTK2_FIND_COMPONENTS) + MESSAGE(FATAL_ERROR "You must specify components with this module. See the documentation at the top of FindGTK2.cmake") +ENDIF() - if (GTK2_CMAKE_24) - pkgconfig(pango _PANGO_INCLUDEDIR _PANGOinkDir _PANGO_LDFLAGS _PANGO_CFLAGS) - else (GTK2_CMAKE_24) - if (PKG_CONFIG_FOUND) - pkg_check_modules(_PANGO pango) - endif (PKG_CONFIG_FOUND) - endif (GTK2_CMAKE_24) - - FIND_PATH(GTK2_PANGO_INCLUDE_PATH pango/pango.h - ${_PANGO_INCLUDEDIR} - /opt/gnome/include/pango-1.0 - /usr/include/pango-1.0 - /opt/local/include/pango-1.0 - $ENV{DEVLIBS_PATH}//include// - ) +FOREACH(_component ${GTK2_FIND_COMPONENTS}) + IF(_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 0 1) - if (GTK2_CMAKE_24) - pkgconfig(gdk-2.0 _GDK2_INCLUDEDIR _GDK2inkDir _GDK2_LDFLAGS _GDK2_CFLAGS) - else (GTK2_CMAKE_24) - if (PKG_CONFIG_FOUND) - pkg_check_modules(_GDK2 gdk-2.0) - endif (PKG_CONFIG_FOUND) - endif (GTK2_CMAKE_24) - - FIND_PATH(GTK2_GDKCONFIG_INCLUDE_PATH gdkconfig.h - ${_GDK2_INCLUDEDIR} - /opt/gnome/lib/gtk-2.0/include - /opt/gnome/lib64/gtk-2.0/include - /usr/lib/gtk-2.0/include - /usr/lib64/gtk-2.0/include - /opt/local/lib/gtk-2.0/include - $ENV{DEVLIBS_PATH}//include// - ) + _GTK2_FIND_INCLUDE_DIR(GTK2_GDK_INCLUDE_DIR gdk/gdk.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_GDKCONFIG_INCLUDE_DIR gdkconfig.h) + _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-x11 0 1) + _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-win32 0 1) - if (GTK2_CMAKE_24) - pkgconfig(cairo _CAIRO_INCLUDEDIR _CAIROinkDir _CAIRO_LDFLAGS _CAIRO_CFLAGS) - else (GTK2_CMAKE_24) - if (PKG_CONFIG_FOUND) - pkg_check_modules(_CAIRO cairo) - endif (PKG_CONFIG_FOUND) - endif (GTK2_CMAKE_24) - - FIND_PATH(GTK2_CAIRO_INCLUDE_PATH cairo.h - ${_CAIRO_INCLUDEDIR} - /opt/gnome/include/cairo - /usr/include - /usr/include/cairo - /opt/local/include/cairo - $ENV{DEVLIBS_PATH}//include// - ) - #MESSAGE(STATUS "DEBUG: GTK2_CAIRO_INCLUDE_PATH = ${GTK2_CAIRO_INCLUDE_PATH}") - - if (GTK2_CMAKE_24) - pkgconfig(atk _ATK_INCLUDEDIR _ATKinkDir _ATK_LDFLAGS _ATK_CFLAGS) - else (GTK2_CMAKE_24) - if (PKG_CONFIG_FOUND) - pkg_check_modules(_ATK atk) - endif (PKG_CONFIG_FOUND) - endif (GTK2_CMAKE_24) - - FIND_PATH(GTK2_ATK_INCLUDE_PATH atk/atk.h - ${_ATK_INCLUDEDIR} - /opt/gnome/include/atk-1.0 - /usr/include/atk-1.0 - /opt/local/include/atk-1.0 - $ENV{DEVLIBS_PATH}//include// - ) - #MESSAGE(STATUS "DEBUG: GTK2_ATK_INCLUDE_PATH = ${GTK2_ATK_INCLUDE_PATH}") - - FIND_LIBRARY(GTK2_GTKGL_LIBRARY - NAMES - gtkgl - PATHS - ${_GTK2_INCLUDEDIR} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - ) + _GTK2_FIND_INCLUDE_DIR(GTK2_GTK_INCLUDE_DIR gtk/gtk.h) + _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-x11 0 1) + _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-win32 0 1) - FIND_LIBRARY(GTK2_GTK_LIBRARY - NAMES - gtk-x11-2.0 - PATHS - ${_GTK2_LIBDIR} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - ) + _GTK2_FIND_INCLUDE_DIR(GTK2_CAIRO_INCLUDE_DIR cairo.h) + _GTK2_FIND_LIBRARY (GTK2_CAIRO_LIBRARY cairo 0 0) - FIND_LIBRARY(GTK2_GDK_LIBRARY - NAMES - gdk-x11-2.0 - PATHS - ${_GDK2_LIBDIR} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - ) + _GTK2_FIND_INCLUDE_DIR(GTK2_PANGO_INCLUDE_DIR pango/pango.h) + _GTK2_FIND_LIBRARY (GTK2_PANGO_LIBRARY pango 0 1) - FIND_LIBRARY(GTK2_GMODULE_LIBRARY - NAMES - gmodule-2.0 - PATHS - ${_GMODULE2_LIBDIR} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - ) + _GTK2_FIND_INCLUDE_DIR(GTK2_ATK_INCLUDE_DIR atk/atk.h) + _GTK2_FIND_LIBRARY (GTK2_ATK_LIBRARY atk 0 1) - FIND_LIBRARY(GTK2_GLIB_LIBRARY - NAMES - glib-2.0 - PATHS - ${_GLIB2_LIBDIR} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - ) + #ELSEIF(_component STREQUAL "gdk_pixbuf") + #_GTK2_FIND_INCLUDE_DIR(GTK2_GDKPIXBUF_INCLUDE_DIR gdk-pixbuf/gdk-pixbuf.h) + #_GTK2_FIND_LIBRARY (GTK2_GDKPIXBUF_LIBRARY gdk_pixbuf 0 1) - FIND_LIBRARY(GTK2_Xi_LIBRARY - NAMES - Xi - PATHS - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - ) + ELSEIF(_component STREQUAL "gtkmm") - FIND_LIBRARY(GTK2_GTHREAD_LIBRARY - NAMES - gthread-2.0 - PATHS - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - ) + _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 1 1) + _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 1 1) - FIND_LIBRARY(GTK2_GOBJECT_LIBRARY - NAMES - gobject-2.0 - PATHS - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - ) + _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 1 1) - IF(GTK2_GTK_INCLUDE_PATH) - IF(GTK2_GLIBCONFIG_INCLUDE_PATH) - IF(GTK2_GLIB_INCLUDE_PATH) - IF(GTK2_GTK_LIBRARY) - IF(GTK2_GLIB_LIBRARY) - IF(GTK2_PANGO_INCLUDE_PATH) - IF(GTK2_ATK_INCLUDE_PATH) - IF(GTK2_CAIRO_INCLUDE_PATH) - # Assume that if gtk and glib were found, the other - # supporting libraries have also been found. - - SET(GTK2_FOUND TRUE) - - SET(GTK2_INCLUDE_DIRS - ${GTK2_GTK_INCLUDE_PATH} - ${GTK2_GLIBCONFIG_INCLUDE_PATH} - ${GTK2_GLIB_INCLUDE_PATH} - ${GTK2_PANGO_INCLUDE_PATH} - ${GTK2_GDKCONFIG_INCLUDE_PATH} - ${GTK2_ATK_INCLUDE_PATH} - ${GTK2_CAIRO_INCLUDE_PATH} - ) - - SET(GTK2_LIBRARIES - ${GTK2_GTK_LIBRARY} - ${GTK2_GDK_LIBRARY} - ${GTK2_GLIB_LIBRARY} - ) - #${GTK2_GOBJECT_LIBRARY}) - - IF(GTK2_GMODULE_LIBRARY) - SET(GTK2_LIBRARIES - ${GTK2_LIBRARIES} - ${GTK2_GMODULE_LIBRARY} - ) - ENDIF(GTK2_GMODULE_LIBRARY) - - IF(GTK2_GTHREAD_LIBRARY) - SET(GTK2_LIBRARIES - ${GTK2_LIBRARIES} - ${GTK2_GTHREAD_LIBRARY} - ) - SET(GTK2_LIBRARIES ${GTK2_LIBRARIES}) - ENDIF(GTK2_GTHREAD_LIBRARY) - ELSE(GTK2_CAIRO_INCLUDE_PATH) - MESSAGE(STATUS "Can not find cairo") - ENDIF(GTK2_CAIRO_INCLUDE_PATH) - ELSE(GTK2_ATK_INCLUDE_PATH) - MESSAGE(STATUS "Can not find atk") - ENDIF(GTK2_ATK_INCLUDE_PATH) - ELSE(GTK2_PANGO_INCLUDE_PATH) - MESSAGE(STATUS "Can not find pango includes") - ENDIF(GTK2_PANGO_INCLUDE_PATH) - ELSE(GTK2_GLIB_LIBRARY) - MESSAGE(STATUS "Can not find glib lib") - ENDIF(GTK2_GLIB_LIBRARY) - ELSE(GTK2_GTK_LIBRARY) - MESSAGE(STATUS "Can not find gtk lib") - ENDIF(GTK2_GTK_LIBRARY) - ELSE(GTK2_GLIB_INCLUDE_PATH) - MESSAGE(STATUS "Can not find glib includes") - ENDIF(GTK2_GLIB_INCLUDE_PATH) - ELSE(GTK2_GLIBCONFIG_INCLUDE_PATH) - MESSAGE(STATUS "Can not find glibconfig") - ENDIF(GTK2_GLIBCONFIG_INCLUDE_PATH) - ELSE (GTK2_GTK_INCLUDE_PATH) - MESSAGE(STATUS "Can not find gtk includes") - ENDIF (GTK2_GTK_INCLUDE_PATH) - - IF (GTK2_FOUND) - IF (NOT GTK2_FIND_QUIETLY) - MESSAGE(STATUS "Found GTK2: ${GTK2_LIBRARIES}") - ENDIF (NOT GTK2_FIND_QUIETLY) - ELSE (GTK2_FOUND) - IF (GTK2_FIND_REQUIRED) - MESSAGE(SEND_ERROR "Could NOT find GTK2") - ENDIF (GTK2_FIND_REQUIRED) - ENDIF (GTK2_FOUND) - - MARK_AS_ADVANCED( - GTK2_GDK_LIBRARY - GTK2_GLIB_INCLUDE_PATH - GTK2_GLIB_LIBRARY - GTK2_GLIBCONFIG_INCLUDE_PATH - GTK2_GMODULE_LIBRARY - GTK2_GTHREAD_LIBRARY - GTK2_Xi_LIBRARY - GTK2_GTK_INCLUDE_PATH - GTK2_GTK_LIBRARY - GTK2_GTKGL_INCLUDE_PATH - GTK2_GTKGL_LIBRARY - GTK2_ATK_INCLUDE_PATH - GTK2_GDKCONFIG_INCLUDE_PATH - #GTK2_GOBJECT_LIBRARY - GTK2_PANGO_INCLUDE_PATH - ) -ENDIF (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) + _GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMM_INCLUDE_DIR cairomm/cairomm.h) + _GTK2_FIND_LIBRARY (GTK2_CAIROMM_LIBRARY cairomm 1 1) + + _GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMM_INCLUDE_DIR pangomm.h) + _GTK2_FIND_LIBRARY (GTK2_PANGOMM_LIBRARY pangomm 1 1) + + _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 1 1) + + _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 1 1) + + _GTK2_FIND_INCLUDE_DIR(GTK2_ATKMM_INCLUDE_DIR atkmm.h) + _GTK2_FIND_LIBRARY (GTK2_ATKMM_LIBRARY atkmm 1 1) + + ELSEIF(_component STREQUAL "glade") + + _GTK2_FIND_INCLUDE_DIR(GTK2_GLADE_INCLUDE_DIR glade/glade.h) + _GTK2_FIND_LIBRARY (GTK2_GLADE_LIBRARY glade 0 1) + + ELSEIF(_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 1 1) + + ELSE() + MESSAGE(FATAL_ERROR "Unknown GTK2 component ${_component}") + ENDIF() +ENDFOREACH() + +# +# Try to enforce components +# -# vim:et ts=2 sw=2 comments=\:\# +SET(_did_we_find_everything true) # This gets set to GTK2_FOUND + +INCLUDE(FindPackageHandleStandardArgs) + +FOREACH(_component ${GTK2_FIND_COMPONENTS}) + STRING(TOUPPER ${_component} _COMPONENT_UPPER) + + IF(_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(_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(_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(_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(_did_we_find_everything false) + ENDIF() +ENDFOREACH() + +SET(GTK2_FOUND ${_did_we_find_everything}) diff --git a/CMakeScripts/FindGtkMM.cmake b/CMakeScripts/FindGtkMM.cmake deleted file mode 100644 index 1c9839503..000000000 --- a/CMakeScripts/FindGtkMM.cmake +++ /dev/null @@ -1,129 +0,0 @@ -# - Try to find GTKMM -# Once done this will define -# -# GTKMM_FOUND - system has GTKMM -# GTKMM_INCLUDE_DIRS - the GTKMM include directory -# GTKMM_LIBRARIES - Link these to use GTKMM -# GTKMM_DEFINITIONS - Compiler switches required for using GTKMM -# -# 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 (GTKMM_LIBRARIES AND GTKMM_INCLUDE_DIRS) - # in cache already - set(GTKMM_FOUND TRUE) -else (GTKMM_LIBRARIES AND GTKMM_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(gtkmm-2.4 _GTKMM_INCLUDEDIR _GTKMM_LIBDIR _GTKMM_LDFLAGS _GTKMM_CFLAGS) - else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_package(PkgConfig) - if (PKG_CONFIG_FOUND) - pkg_check_modules(_GTKMM gtkmm-2.4) - endif (PKG_CONFIG_FOUND) - endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_path(GTKMM_INCLUDE_DIR - NAMES - gtkmm.h - PATHS - ${_GTKMM_INCLUDEDIR} - /usr/include - /usr/local/include - /opt/local/include - /sw/include - PATH_SUFFIXES - gtkmm-2.4 - ) - - find_path(GTKMM_CONFIG_INCLUDE_DIR - NAMES - gtkmmconfig.h - PATHS - ${_GDKMM_INCLUDEDIR} - /usr/include - /usr/local/include - /opt/local/include - /opt/local/lib/gtkmm-2.4/include - /sw/include - /usr/lib/gtkmm-2.4/include - /usr/lib64/gtkmm-2.4/include - ) - - find_library(GTKMM-2.4_LIBRARY - NAMES - gtkmm-2.4 - PATHS - ${_GTKMM_LIBDIR} - /usr/lib - /usr/local/lib - /opt/local/lib - /sw/lib - ) - -find_package(ATKMM REQUIRED) -find_package(GDKMM REQUIRED) -find_package(GIOMM REQUIRED) -find_package(GLIBMM REQUIRED) -find_package(PANGOMM REQUIRED) -find_package(CAIROMM REQUIRED) - - if (GTKMM-2.4_LIBRARY) - set(GTKMM-2.4_FOUND TRUE) - endif (GTKMM-2.4_LIBRARY) - - set(GTKMM_INCLUDE_DIRS - ${GTKMM_INCLUDE_DIR} - ${GTKMM_CONFIG_INCLUDE_DIR} - ${ATKMM_INCLUDE_DIR} - ${ATKMM_CONFIG_INCLUDE_DIR} - ${GDKMM_INCLUDE_DIR} - ${GDKMM_CONFIG_INCLUDE_DIR} - ${GIOMM_INCLUDE_DIR} - ${GIOMM_CONFIG_INCLUDE_DIR} - ${GLIBMM_INCLUDE_DIR} - ${GLIBMM_CONFIG_INCLUDE_DIR} - ${PANGOMM_INCLUDE_DIR} - ${PANGOMM_CONFIG_INCLUDE_DIR} - ${CAIROMM_INCLUDE_DIR} - ${CAIROMM_CONFIG_INCLUDE_DIR} - ) - - if (GTKMM-2.4_FOUND) - set(GTKMM_LIBRARIES - ${GTKMM_LIBRARIES} - ${GTKMM-2.4_LIBRARY} - ${ATKMM_LIBRARIES} - ${GDKMM_LIBRARIES} - ${GIOMM_LIBRARIES} - ${GLIBMM_LIBRARIES} - ${PANGOMM_LIBRARIES} - ${CAIROMM_LIBRARIES} - ) - endif (GTKMM-2.4_FOUND) - - if (GTKMM_INCLUDE_DIRS AND GTKMM_LIBRARIES) - set(GTKMM_FOUND TRUE) - endif (GTKMM_INCLUDE_DIRS AND GTKMM_LIBRARIES) - - if (GTKMM_FOUND) - if (NOT GTKMM_FIND_QUIETLY) - message(STATUS "Found GTKMM: ${GTKMM_LIBRARIES}") - endif (NOT GTKMM_FIND_QUIETLY) - else (GTKMM_FOUND) - if (GTKMM_FIND_REQUIRED) - message(FATAL_ERROR "Could not find GTKMM") - endif (GTKMM_FIND_REQUIRED) - endif (GTKMM_FOUND) - - # show the GTKMM_INCLUDE_DIRS and GTKMM_LIBRARIES variables only in the advanced view - mark_as_advanced(GTKMM_INCLUDE_DIRS GTKMM_LIBRARIES) - -endif (GTKMM_LIBRARIES AND GTKMM_INCLUDE_DIRS) - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e30df661e..9f7cc33dc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -228,16 +228,10 @@ ui util widgets xml +2geom ) - -FOREACH(srclistsrc ${internalfolders}) - ADD_SUBDIRECTORY(${srclistsrc}) -ENDFOREACH(srclistsrc) - -SET(INKSCAPE_SRC ${INKSCAPE_SRC} ${GlibOutput}) -# All directories containing lists files that describe building internal libraries SET(libfolders -2geom +# Directories containing lists files that describe building internal libraries libavoid libcola libcroco @@ -248,19 +242,22 @@ libvpsc livarot ) -FOREACH(dirlistsrc ${libfolders}) - ADD_SUBDIRECTORY(${dirlistsrc}) -ENDFOREACH(dirlistsrc) +SET(dirs ${internalfolders} ${libfolders} +) -message(status "${INKSCAPE_LIBS}") +FOREACH(srclistsrc ${dirs}) + ADD_SUBDIRECTORY(${srclistsrc}) +ENDFOREACH(srclistsrc) + +SET(INKSCAPE_SRC ${INKSCAPE_SRC} ${GlibOutput}) + +#message(status "${INKSCAPE_LIBS}") ADD_LIBRARY(sp STATIC ${SP_SRC}) -TARGET_LINK_LIBRARIES(sp - 2geom avoid cola croco gdl nr nrtype vpsc livarot -) + # make executable for INKSCAPE ADD_EXECUTABLE(inkscape ${INKSCAPE_SRC}) TARGET_LINK_LIBRARIES(inkscape - 2geom avoid cola croco gdl nr nrtype vpsc livarot sp ${internalfolders} + ${internalfolders} sp avoid cola croco gdl nr nrtype vpsc livarot ${INKSCAPE_LIBS} ) # make executable for INKVIEW -- 2.30.2