From 6a15214db07ebf00ef41aff74bdce220aa387dea Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Fri, 16 Mar 2007 13:45:56 +0000 Subject: Move it into kdelibs (need by kdebase and amarok) I will remove it from these two module next monday svn path=/trunk/KDE/kdelibs/; revision=643161 --- modules/FindGObject.cmake | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 modules/FindGObject.cmake (limited to 'modules/FindGObject.cmake') diff --git a/modules/FindGObject.cmake b/modules/FindGObject.cmake new file mode 100644 index 00000000..6501fcbc --- /dev/null +++ b/modules/FindGObject.cmake @@ -0,0 +1,73 @@ +# - Try to find GObject +# Once done this will define +# +# GOBJECT_FOUND - system has GObject +# GOBJECT_INCLUDE_DIR - the GObject include directory +# GOBJECT_LIBRARIES - the libraries needed to use GObject +# GOBJECT_DEFINITIONS - Compiler switches required for using GObject +# +# (c)2006, Tim Beaulen + + +IF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) + # in cache already + SET(GObject_FIND_QUIETLY TRUE) +ELSE (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) + SET(GObject_FIND_QUIETLY FALSE) +ENDIF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) + +IF (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + INCLUDE(UsePkgConfig) + PKGCONFIG(gobject-2.0 _GObjectIncDir _GObjectLinkDir _GObjectLinkFlags _GObjectCflags) + #MESSAGE(STATUS "DEBUG: GObject include directory = ${_GObjectIncDir}") + #MESSAGE(STATUS "DEBUG: GObject link directory = ${_GObjectLinkDir}") + #MESSAGE(STATUS "DEBUG: GObject link flags = ${_GObjectLinkFlags}") + #MESSAGE(STATUS "DEBUG: GObject CFlags = ${_GObjectCflags}") + SET(GOBJECT_DEFINITIONS ${_GObjectCflags}) +ENDIF (NOT WIN32) + +FIND_PATH(GOBJECT_INCLUDE_DIR gobject.h + PATHS + ${_GObjectIncDir} + ${_GObjectIncDir}/glib-2.0/gobject/ + /usr/include/glib-2.0/gobject/ + #PATH_SUFFIXES gst + ) + +FIND_LIBRARY(_GObjectLibs NAMES gobject-2.0 + PATHS + ${_GObjectLinkDir} + ) +FIND_LIBRARY(_GModuleLibs NAMES gmodule-2.0 + PATHS + ${_GObjectLinkDir} + ) +FIND_LIBRARY(_GThreadLibs NAMES gthread-2.0 + PATHS + ${_GObjectLinkDir} + ) +FIND_LIBRARY(_GLibs NAMES glib-2.0 + PATHS + ${_GObjectLinkDir} + ) + +SET( GOBJECT_LIBRARIES ${_GObjectLibs} ${_GModuleLibs} ${_GThreadLibs} ${_GLibs} ) + +IF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) + SET(GOBJECT_FOUND TRUE) +ELSE (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) + SET(GOBJECT_FOUND FALSE) +ENDIF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) + +IF (GOBJECT_FOUND) + IF (NOT GObject_FIND_QUIETLY) + MESSAGE(STATUS "Found GObject libraries: ${GOBJECT_LIBRARIES}") + MESSAGE(STATUS "Found GObject includes : ${GOBJECT_INCLUDE_DIR}") + ENDIF (NOT GObject_FIND_QUIETLY) +ELSE (GOBJECT_FOUND) + MESSAGE(STATUS "Could NOT find GObject") +ENDIF (GOBJECT_FOUND) + +MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR GOBJECT_LIBRARIES) -- cgit v1.2.1 From 05b64921612794802f499f96e7e60a07f10deaa0 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Thu, 5 Apr 2007 11:51:18 +0000 Subject: Fix cmake file when we require it svn path=/trunk/KDE/kdelibs/; revision=650763 --- modules/FindGObject.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules/FindGObject.cmake') diff --git a/modules/FindGObject.cmake b/modules/FindGObject.cmake index 6501fcbc..62bed220 100644 --- a/modules/FindGObject.cmake +++ b/modules/FindGObject.cmake @@ -67,7 +67,9 @@ IF (GOBJECT_FOUND) MESSAGE(STATUS "Found GObject includes : ${GOBJECT_INCLUDE_DIR}") ENDIF (NOT GObject_FIND_QUIETLY) ELSE (GOBJECT_FOUND) + IF (GObject_FIND_REQUIRED) MESSAGE(STATUS "Could NOT find GObject") + ENDIF(OpenEXR_FIND_REQUIRED) ENDIF (GOBJECT_FOUND) MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR GOBJECT_LIBRARIES) -- cgit v1.2.1 From 3ee8770fef4161ab283d2ce398979c1ae2e927ee Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Thu, 5 Apr 2007 14:59:43 +0000 Subject: fix typo svn path=/trunk/KDE/kdelibs/; revision=650850 --- modules/FindGObject.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/FindGObject.cmake') diff --git a/modules/FindGObject.cmake b/modules/FindGObject.cmake index 62bed220..64d6717e 100644 --- a/modules/FindGObject.cmake +++ b/modules/FindGObject.cmake @@ -69,7 +69,7 @@ IF (GOBJECT_FOUND) ELSE (GOBJECT_FOUND) IF (GObject_FIND_REQUIRED) MESSAGE(STATUS "Could NOT find GObject") - ENDIF(OpenEXR_FIND_REQUIRED) + ENDIF(GObjct_FIND_REQUIRED) ENDIF (GOBJECT_FOUND) MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR GOBJECT_LIBRARIES) -- cgit v1.2.1 From 27ac6b46d1da6b09ead94a46804e6809cb7451e2 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 6 Apr 2007 13:32:39 +0000 Subject: fix typo svn path=/trunk/KDE/kdelibs/; revision=651077 --- modules/FindGObject.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/FindGObject.cmake') diff --git a/modules/FindGObject.cmake b/modules/FindGObject.cmake index 64d6717e..4e2a03b7 100644 --- a/modules/FindGObject.cmake +++ b/modules/FindGObject.cmake @@ -69,7 +69,7 @@ IF (GOBJECT_FOUND) ELSE (GOBJECT_FOUND) IF (GObject_FIND_REQUIRED) MESSAGE(STATUS "Could NOT find GObject") - ENDIF(GObjct_FIND_REQUIRED) + ENDIF(GObject_FIND_REQUIRED) ENDIF (GOBJECT_FOUND) MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR GOBJECT_LIBRARIES) -- cgit v1.2.1 From 814455b7ad321c88e730662fda58261087b72e72 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Mon, 18 Feb 2008 19:06:32 +0000 Subject: some improvements to the docs: -some modules were not at all documented, only few are left now -the copyright message doesn't have to be printed for every module in the docs -fix FindKorundom.cmake, it didn't follow the style guide and had typos (e.g. Korumdum_FOUND instead of KORUNDUM_FOUND) Alex (will commit modified FindKDE4Internal.cmake after Christians commit) svn path=/trunk/KDE/kdelibs/; revision=776742 --- modules/FindGObject.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/FindGObject.cmake') diff --git a/modules/FindGObject.cmake b/modules/FindGObject.cmake index 4e2a03b7..3d3d6b3d 100644 --- a/modules/FindGObject.cmake +++ b/modules/FindGObject.cmake @@ -5,7 +5,7 @@ # GOBJECT_INCLUDE_DIR - the GObject include directory # GOBJECT_LIBRARIES - the libraries needed to use GObject # GOBJECT_DEFINITIONS - Compiler switches required for using GObject -# + # (c)2006, Tim Beaulen -- cgit v1.2.1 From 7ab5b5f8cb7a33937cc17f73d25713e29048bf8b Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Tue, 11 Nov 2008 12:27:23 +0000 Subject: Port it svn path=/trunk/KDE/kdelibs/; revision=882776 --- modules/FindGObject.cmake | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'modules/FindGObject.cmake') diff --git a/modules/FindGObject.cmake b/modules/FindGObject.cmake index 3d3d6b3d..3774b914 100644 --- a/modules/FindGObject.cmake +++ b/modules/FindGObject.cmake @@ -19,38 +19,37 @@ ENDIF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) IF (NOT WIN32) # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls - INCLUDE(UsePkgConfig) - PKGCONFIG(gobject-2.0 _GObjectIncDir _GObjectLinkDir _GObjectLinkFlags _GObjectCflags) - #MESSAGE(STATUS "DEBUG: GObject include directory = ${_GObjectIncDir}") - #MESSAGE(STATUS "DEBUG: GObject link directory = ${_GObjectLinkDir}") - #MESSAGE(STATUS "DEBUG: GObject link flags = ${_GObjectLinkFlags}") - #MESSAGE(STATUS "DEBUG: GObject CFlags = ${_GObjectCflags}") - SET(GOBJECT_DEFINITIONS ${_GObjectCflags}) + find_package(PkgConfig) + pkg_check_modules(GOBJECT gobject-2.0) + #MESSAGE(STATUS "DEBUG: GObject include directory = ${GOBJECT_INCLUDE_DIRS}") + #MESSAGE(STATUS "DEBUG: GObject link directory = ${GOBJECT_LIBRARY_DIRS}") + #MESSAGE(STATUS "DEBUG: GObject CFlags = ${GOBJECT_CFLAGS}") + SET(GOBJECT_DEFINITIONS ${GOBJECT_CFLAGS}) ENDIF (NOT WIN32) FIND_PATH(GOBJECT_INCLUDE_DIR gobject.h PATHS - ${_GObjectIncDir} - ${_GObjectIncDir}/glib-2.0/gobject/ + ${GOBJECT_INCLUDE_DIRS} + ${GOBJECT_INCLUDE_DIRS}/glib-2.0/gobject/ /usr/include/glib-2.0/gobject/ #PATH_SUFFIXES gst ) FIND_LIBRARY(_GObjectLibs NAMES gobject-2.0 PATHS - ${_GObjectLinkDir} + ${GOBJECT_LIBRARY_DIRS} ) FIND_LIBRARY(_GModuleLibs NAMES gmodule-2.0 PATHS - ${_GObjectLinkDir} + ${GOBJECT_LIBRARY_DIRS} ) FIND_LIBRARY(_GThreadLibs NAMES gthread-2.0 PATHS - ${_GObjectLinkDir} + ${GOBJECT_LIBRARY_DIRS} ) FIND_LIBRARY(_GLibs NAMES glib-2.0 PATHS - ${_GObjectLinkDir} + ${GOBJECT_LIBRARY_DIRS} ) SET( GOBJECT_LIBRARIES ${_GObjectLibs} ${_GModuleLibs} ${_GThreadLibs} ${_GLibs} ) -- cgit v1.2.1 From c379d4c4e0655fac2dadd4be57e2e5cd23d40572 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Tue, 2 Dec 2008 21:49:01 +0000 Subject: -rework all uses of find_package(PkgConfig)/pkg_check_modules(): the prefix used for pkgconfig config (e.g. SQLITE) now *always* gets an additional "PC_" prefix, so the prefix used for pkgconfig is now "PC_SQLITE_". This avoids name clashes between variables defined by the pkgconfig macro and the find module and unwanted effects. *Never* use the _CFLAGS coming from pkgconfig, but always CFLAGS_OTHER, since these shouldn't contain the include directories. If the include directories would be in the DEFINITIONS variable this could clash with the results of find_path() for finding include dirs. *Always* use both foo_INCLUDEDIR, foo_INCLUDE_DIRS for searching the include dir, and also both foo_LIBDIR and foo_LIBRARY_DIRS for searching the libraries. These directories coming from pkgconfig are *never* used exclusively, but *always* additionally to the standard search dirs, either before them (then using the "HINTS" keyword) or after them (then using the "PATHS" keyword) I hope I didn't break (too much) stuff. At least on my system it all seems to work the same way as it did before, with and without pkgconfig. Alex svn path=/trunk/KDE/kdelibs/; revision=891805 --- modules/FindGObject.cmake | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'modules/FindGObject.cmake') diff --git a/modules/FindGObject.cmake b/modules/FindGObject.cmake index 3774b914..538cad5f 100644 --- a/modules/FindGObject.cmake +++ b/modules/FindGObject.cmake @@ -19,37 +19,40 @@ ENDIF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) IF (NOT WIN32) # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls - find_package(PkgConfig) - pkg_check_modules(GOBJECT gobject-2.0) + FIND_PACKAGE(PkgConfig) + PKG_CHECK_MODULES(PC_GOBJECT gobject-2.0) #MESSAGE(STATUS "DEBUG: GObject include directory = ${GOBJECT_INCLUDE_DIRS}") #MESSAGE(STATUS "DEBUG: GObject link directory = ${GOBJECT_LIBRARY_DIRS}") #MESSAGE(STATUS "DEBUG: GObject CFlags = ${GOBJECT_CFLAGS}") - SET(GOBJECT_DEFINITIONS ${GOBJECT_CFLAGS}) + SET(GOBJECT_DEFINITIONS ${PC_GOBJECT_CFLAGS_OTHER}) ENDIF (NOT WIN32) FIND_PATH(GOBJECT_INCLUDE_DIR gobject.h PATHS - ${GOBJECT_INCLUDE_DIRS} - ${GOBJECT_INCLUDE_DIRS}/glib-2.0/gobject/ - /usr/include/glib-2.0/gobject/ - #PATH_SUFFIXES gst + ${PC_GOBJECT_INCLUDEDIR} + ${PC_GOBJECT_INCLUDE_DIRS} + PATH_SUFFIXES glib-2.0/gobject/ ) FIND_LIBRARY(_GObjectLibs NAMES gobject-2.0 PATHS - ${GOBJECT_LIBRARY_DIRS} + ${PC_GOBJECT_LIBDIR} + ${PC_GOBJECT_LIBRARY_DIRS} ) FIND_LIBRARY(_GModuleLibs NAMES gmodule-2.0 PATHS - ${GOBJECT_LIBRARY_DIRS} + ${PC_GOBJECT_LIBDIR} + ${PC_GOBJECT_LIBRARY_DIRS} ) FIND_LIBRARY(_GThreadLibs NAMES gthread-2.0 PATHS - ${GOBJECT_LIBRARY_DIRS} + ${PC_GOBJECT_LIBDIR} + ${PC_GOBJECT_LIBRARY_DIRS} ) FIND_LIBRARY(_GLibs NAMES glib-2.0 PATHS - ${GOBJECT_LIBRARY_DIRS} + ${PC_GOBJECT_LIBDIR} + ${PC_GOBJECT_LIBRARY_DIRS} ) SET( GOBJECT_LIBRARIES ${_GObjectLibs} ${_GModuleLibs} ${_GThreadLibs} ${_GLibs} ) @@ -71,4 +74,4 @@ ELSE (GOBJECT_FOUND) ENDIF(GObject_FIND_REQUIRED) ENDIF (GOBJECT_FOUND) -MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR GOBJECT_LIBRARIES) +MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR _GObjectLibs _GModuleLibs _GThreadLibs _GLibs) -- cgit v1.2.1 From 87c903a8e853eec433860818a01040da8d1c5f1a Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Sun, 4 Jan 2009 15:39:53 +0000 Subject: -add missing copyright notices, I hope I got it right -also a few empty lines here and there to make it look nicer Alex svn path=/trunk/KDE/kdelibs/; revision=905547 --- modules/FindGObject.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/FindGObject.cmake') diff --git a/modules/FindGObject.cmake b/modules/FindGObject.cmake index 538cad5f..d9e8df9c 100644 --- a/modules/FindGObject.cmake +++ b/modules/FindGObject.cmake @@ -6,7 +6,10 @@ # GOBJECT_LIBRARIES - the libraries needed to use GObject # GOBJECT_DEFINITIONS - Compiler switches required for using GObject -# (c)2006, Tim Beaulen +# Copyright (c) 2006, Tim Beaulen +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. IF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) -- cgit v1.2.1 From 50d0fa5ef424fde9c15404613fc662c2204db4e1 Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Sun, 10 Apr 2011 19:27:44 -0300 Subject: Clean up FindGObject.cmake. * Remove unnecessary WIN32 check. * Use the pkg-config paths as HINTS, not PATHS. * Use FindPackageHandleStandardArgs instead of duplicating its functionality. Reviewed-by: Alexander Neundorf --- modules/FindGObject.cmake | 50 +++++++++++------------------------------------ 1 file changed, 11 insertions(+), 39 deletions(-) (limited to 'modules/FindGObject.cmake') diff --git a/modules/FindGObject.cmake b/modules/FindGObject.cmake index d9e8df9c..af0c9f73 100644 --- a/modules/FindGObject.cmake +++ b/modules/FindGObject.cmake @@ -6,75 +6,47 @@ # GOBJECT_LIBRARIES - the libraries needed to use GObject # GOBJECT_DEFINITIONS - Compiler switches required for using GObject +# Copyright (c) 2011, Raphael Kubo da Costa # Copyright (c) 2006, Tim Beaulen # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -IF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) - # in cache already - SET(GObject_FIND_QUIETLY TRUE) -ELSE (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) - SET(GObject_FIND_QUIETLY FALSE) -ENDIF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) - -IF (NOT WIN32) - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - FIND_PACKAGE(PkgConfig) - PKG_CHECK_MODULES(PC_GOBJECT gobject-2.0) - #MESSAGE(STATUS "DEBUG: GObject include directory = ${GOBJECT_INCLUDE_DIRS}") - #MESSAGE(STATUS "DEBUG: GObject link directory = ${GOBJECT_LIBRARY_DIRS}") - #MESSAGE(STATUS "DEBUG: GObject CFlags = ${GOBJECT_CFLAGS}") - SET(GOBJECT_DEFINITIONS ${PC_GOBJECT_CFLAGS_OTHER}) -ENDIF (NOT WIN32) +FIND_PACKAGE(PkgConfig) +PKG_CHECK_MODULES(PC_GOBJECT gobject-2.0) +SET(GOBJECT_DEFINITIONS ${PC_GOBJECT_CFLAGS_OTHER}) FIND_PATH(GOBJECT_INCLUDE_DIR gobject.h - PATHS + HINTS ${PC_GOBJECT_INCLUDEDIR} ${PC_GOBJECT_INCLUDE_DIRS} PATH_SUFFIXES glib-2.0/gobject/ ) FIND_LIBRARY(_GObjectLibs NAMES gobject-2.0 - PATHS + HINTS ${PC_GOBJECT_LIBDIR} ${PC_GOBJECT_LIBRARY_DIRS} ) FIND_LIBRARY(_GModuleLibs NAMES gmodule-2.0 - PATHS + HINTS ${PC_GOBJECT_LIBDIR} ${PC_GOBJECT_LIBRARY_DIRS} ) FIND_LIBRARY(_GThreadLibs NAMES gthread-2.0 - PATHS + HINTS ${PC_GOBJECT_LIBDIR} ${PC_GOBJECT_LIBRARY_DIRS} ) FIND_LIBRARY(_GLibs NAMES glib-2.0 - PATHS + HINTS ${PC_GOBJECT_LIBDIR} ${PC_GOBJECT_LIBRARY_DIRS} ) SET( GOBJECT_LIBRARIES ${_GObjectLibs} ${_GModuleLibs} ${_GThreadLibs} ${_GLibs} ) -IF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) - SET(GOBJECT_FOUND TRUE) -ELSE (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) - SET(GOBJECT_FOUND FALSE) -ENDIF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES) - -IF (GOBJECT_FOUND) - IF (NOT GObject_FIND_QUIETLY) - MESSAGE(STATUS "Found GObject libraries: ${GOBJECT_LIBRARIES}") - MESSAGE(STATUS "Found GObject includes : ${GOBJECT_INCLUDE_DIR}") - ENDIF (NOT GObject_FIND_QUIETLY) -ELSE (GOBJECT_FOUND) - IF (GObject_FIND_REQUIRED) - MESSAGE(STATUS "Could NOT find GObject") - ENDIF(GObject_FIND_REQUIRED) -ENDIF (GOBJECT_FOUND) +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GOBJECT DEFAULT_MSG GOBJECT_LIBRARIES GOBJECT_INCLUDE_DIR) MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR _GObjectLibs _GModuleLibs _GThreadLibs _GLibs) -- cgit v1.2.1