aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindGLib.cmake
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-04-23 10:01:40 +0200
committerMarvin W <git@larma.de>2017-04-26 21:48:53 +0200
commiteddf17c68274c3e8ecf86a13858243159ffe9714 (patch)
treedb92b3ea3ffd453a16df9e53d0b454d172b8c8f2 /cmake/FindGLib.cmake
parent3eb9aa0fa79ea9fcebb5f702f81c2e54aafdc8cc (diff)
downloaddino-eddf17c68274c3e8ecf86a13858243159ffe9714.tar.gz
dino-eddf17c68274c3e8ecf86a13858243159ffe9714.zip
cmake/signal-protocol: shared lib, mark_as_advanced and others
Diffstat (limited to 'cmake/FindGLib.cmake')
-rw-r--r--cmake/FindGLib.cmake15
1 files changed, 7 insertions, 8 deletions
diff --git a/cmake/FindGLib.cmake b/cmake/FindGLib.cmake
index eb054e65..a2feeecc 100644
--- a/cmake/FindGLib.cmake
+++ b/cmake/FindGLib.cmake
@@ -9,14 +9,15 @@ find_pkg_config_with_fallback(GLib
)
if(GLib_FOUND AND NOT GLib_VERSION)
- find_path(GLib_CONFIG_INCLUDE_DIR "glibconfig.h" HINTS ${GLib_INCLUDE_DIRS})
+ find_file(GLib_CONFIG_HEADER "glibconfig.h" HINTS ${GLib_INCLUDE_DIRS})
+ mark_as_advanced(GLib_CONFIG_HEADER)
- if(GLib_CONFIG_INCLUDE_DIR)
- file(STRINGS "${GLib_CONFIG_INCLUDE_DIR}/glibconfig.h" GLib_MAJOR_VERSION REGEX "^#define GLIB_MAJOR_VERSION +([0-9]+)")
+ if(GLib_CONFIG_HEADER)
+ file(STRINGS "${GLib_CONFIG_HEADER}" GLib_MAJOR_VERSION REGEX "^#define GLIB_MAJOR_VERSION +([0-9]+)")
string(REGEX REPLACE "^#define GLIB_MAJOR_VERSION ([0-9]+)$" "\\1" GLib_MAJOR_VERSION "${GLib_MAJOR_VERSION}")
- file(STRINGS "${GLib_CONFIG_INCLUDE_DIR}/glibconfig.h" GLib_MINOR_VERSION REGEX "^#define GLIB_MINOR_VERSION +([0-9]+)")
+ file(STRINGS "${GLib_CONFIG_HEADER}" GLib_MINOR_VERSION REGEX "^#define GLIB_MINOR_VERSION +([0-9]+)")
string(REGEX REPLACE "^#define GLIB_MINOR_VERSION ([0-9]+)$" "\\1" GLib_MINOR_VERSION "${GLib_MINOR_VERSION}")
- file(STRINGS "${GLib_CONFIG_INCLUDE_DIR}/glibconfig.h" GLib_MICRO_VERSION REGEX "^#define GLIB_MICRO_VERSION +([0-9]+)")
+ file(STRINGS "${GLib_CONFIG_HEADER}" GLib_MICRO_VERSION REGEX "^#define GLIB_MICRO_VERSION +([0-9]+)")
string(REGEX REPLACE "^#define GLIB_MICRO_VERSION ([0-9]+)$" "\\1" GLib_MICRO_VERSION "${GLib_MICRO_VERSION}")
set(GLib_VERSION "${GLib_MAJOR_VERSION}.${GLib_MINOR_VERSION}.${GLib_MICRO_VERSION}")
unset(GLib_MAJOR_VERSION)
@@ -27,7 +28,5 @@ endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLib
- FOUND_VAR GLib_FOUND
REQUIRED_VARS GLib_LIBRARY
- VERSION_VAR GLib_VERSION
-) \ No newline at end of file
+ VERSION_VAR GLib_VERSION) \ No newline at end of file