diff options
author | Marvin W <git@larma.de> | 2017-04-23 10:01:40 +0200 |
---|---|---|
committer | Marvin W <git@larma.de> | 2017-04-26 21:48:53 +0200 |
commit | eddf17c68274c3e8ecf86a13858243159ffe9714 (patch) | |
tree | db92b3ea3ffd453a16df9e53d0b454d172b8c8f2 /cmake/FindCairo.cmake | |
parent | 3eb9aa0fa79ea9fcebb5f702f81c2e54aafdc8cc (diff) | |
download | dino-eddf17c68274c3e8ecf86a13858243159ffe9714.tar.gz dino-eddf17c68274c3e8ecf86a13858243159ffe9714.zip |
cmake/signal-protocol: shared lib, mark_as_advanced and others
Diffstat (limited to 'cmake/FindCairo.cmake')
-rw-r--r-- | cmake/FindCairo.cmake | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/cmake/FindCairo.cmake b/cmake/FindCairo.cmake index 5d2a2fbf..5277b1bb 100644 --- a/cmake/FindCairo.cmake +++ b/cmake/FindCairo.cmake @@ -7,14 +7,15 @@ find_pkg_config_with_fallback(Cairo ) if(Cairo_FOUND AND NOT Cairo_VERSION) - find_path(Cairo_INCLUDE_DIR "cairo.h" HINTS ${Cairo_INCLUDE_DIRS}) + find_file(Cairo_VERSION_HEADER "cairo-version.h" HINTS ${Cairo_INCLUDE_DIRS}) + mark_as_advanced(Cairo_VERSION_HEADER) - if(Cairo_INCLUDE_DIR) - file(STRINGS "${Cairo_INCLUDE_DIR}/cairo-version.h" Cairo_MAJOR_VERSION REGEX "^#define CAIRO_VERSION_MAJOR +\\(?([0-9]+)\\)?$") + if(Cairo_VERSION_HEADER) + file(STRINGS "${Cairo_VERSION_HEADER}" Cairo_MAJOR_VERSION REGEX "^#define CAIRO_VERSION_MAJOR +\\(?([0-9]+)\\)?$") string(REGEX REPLACE "^#define CAIRO_VERSION_MAJOR \\(?([0-9]+)\\)?$" "\\1" Cairo_MAJOR_VERSION "${Cairo_MAJOR_VERSION}") - file(STRINGS "${Cairo_INCLUDE_DIR}/cairo-version.h" Cairo_MINOR_VERSION REGEX "^#define CAIRO_VERSION_MINOR +\\(?([0-9]+)\\)?$") + file(STRINGS "${Cairo_VERSION_HEADER}" Cairo_MINOR_VERSION REGEX "^#define CAIRO_VERSION_MINOR +\\(?([0-9]+)\\)?$") string(REGEX REPLACE "^#define CAIRO_VERSION_MINOR \\(?([0-9]+)\\)?$" "\\1" Cairo_MINOR_VERSION "${Cairo_MINOR_VERSION}") - file(STRINGS "${Cairo_INCLUDE_DIR}/cairo-version.h" Cairo_MICRO_VERSION REGEX "^#define CAIRO_VERSION_MICRO +\\(?([0-9]+)\\)?$") + file(STRINGS "${Cairo_VERSION_HEADER}" Cairo_MICRO_VERSION REGEX "^#define CAIRO_VERSION_MICRO +\\(?([0-9]+)\\)?$") string(REGEX REPLACE "^#define CAIRO_VERSION_MICRO \\(?([0-9]+)\\)?$" "\\1" Cairo_MICRO_VERSION "${Cairo_MICRO_VERSION}") set(Cairo_VERSION "${Cairo_MAJOR_VERSION}.${Cairo_MINOR_VERSION}.${Cairo_MICRO_VERSION}") unset(Cairo_MAJOR_VERSION) @@ -25,7 +26,5 @@ endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Cairo - FOUND_VAR Cairo_FOUND REQUIRED_VARS Cairo_LIBRARY - VERSION_VAR Cairo_VERSION -)
\ No newline at end of file + VERSION_VAR Cairo_VERSION)
\ No newline at end of file |