aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindPango.cmake
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-03-23 17:10:45 +0100
committerMarvin W <git@larma.de>2017-03-23 17:16:08 +0100
commite6f89f8751e6e65d4a36a125cc3fe398098ba504 (patch)
tree54acce89355ee07b05db761d6d0dad8dad4e0f36 /cmake/FindPango.cmake
parentef0483765a0fd567f25b1f0af6df04e8973e5624 (diff)
downloaddino-e6f89f8751e6e65d4a36a125cc3fe398098ba504.tar.gz
dino-e6f89f8751e6e65d4a36a125cc3fe398098ba504.zip
New CMake
- add install and uninstall targets - compatibility for systems without pkg-config
Diffstat (limited to 'cmake/FindPango.cmake')
-rw-r--r--cmake/FindPango.cmake32
1 files changed, 32 insertions, 0 deletions
diff --git a/cmake/FindPango.cmake b/cmake/FindPango.cmake
new file mode 100644
index 00000000..b934c6ff
--- /dev/null
+++ b/cmake/FindPango.cmake
@@ -0,0 +1,32 @@
+include(PkgConfigWithFallback)
+find_pkg_config_with_fallback(Pango
+ PKG_CONFIG_NAME pango
+ LIB_NAMES pango-1.0
+ INCLUDE_NAMES pango/pango.h
+ INCLUDE_DIR_SUFFIXES pango-1.0 pango-1.0/include
+ DEPENDS GObject
+)
+
+if(Pango_FOUND AND NOT Pango_VERSION)
+ find_path(Pango_INCLUDE_DIR "pango/pango.h" HINTS ${Pango_INCLUDE_DIRS})
+
+ if(Pango_INCLUDE_DIR)
+ file(STRINGS "${Pango_INCLUDE_DIR}/pango/pango-features.h" Pango_MAJOR_VERSION REGEX "^#define PANGO_VERSION_MAJOR +\\(?([0-9]+)\\)?$")
+ string(REGEX REPLACE "^#define PANGO_VERSION_MAJOR \\(?([0-9]+)\\)?$" "\\1" Pango_MAJOR_VERSION "${Pango_MAJOR_VERSION}")
+ file(STRINGS "${Pango_INCLUDE_DIR}/pango/pango-features.h" Pango_MINOR_VERSION REGEX "^#define PANGO_VERSION_MINOR +\\(?([0-9]+)\\)?$")
+ string(REGEX REPLACE "^#define PANGO_VERSION_MINOR \\(?([0-9]+)\\)?$" "\\1" Pango_MINOR_VERSION "${Pango_MINOR_VERSION}")
+ file(STRINGS "${Pango_INCLUDE_DIR}/pango/pango-features.h" Pango_MICRO_VERSION REGEX "^#define PANGO_VERSION_MICRO +\\(?([0-9]+)\\)?$")
+ string(REGEX REPLACE "^#define PANGO_VERSION_MICRO \\(?([0-9]+)\\)?$" "\\1" Pango_MICRO_VERSION "${Pango_MICRO_VERSION}")
+ set(Pango_VERSION "${Pango_MAJOR_VERSION}.${Pango_MINOR_VERSION}.${Pango_MICRO_VERSION}")
+ unset(Pango_MAJOR_VERSION)
+ unset(Pango_MINOR_VERSION)
+ unset(Pango_MICRO_VERSION)
+ endif()
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Pango
+ FOUND_VAR Pango_FOUND
+ REQUIRED_VARS Pango_LIBRARY
+ VERSION_VAR Pango_VERSION
+) \ No newline at end of file