diff options
Diffstat (limited to 'cmake/Modules/FindPixman.cmake')
-rw-r--r-- | cmake/Modules/FindPixman.cmake | 56 |
1 files changed, 46 insertions, 10 deletions
diff --git a/cmake/Modules/FindPixman.cmake b/cmake/Modules/FindPixman.cmake index f024b71a..a6f2fad2 100644 --- a/cmake/Modules/FindPixman.cmake +++ b/cmake/Modules/FindPixman.cmake @@ -1,13 +1,49 @@ -find_package(PkgConfig) - -if (PKG_CONFIG_FOUND) - pkg_check_modules(PIXMAN pixman-1) -else() - find_path(PIXMAN_INCLUDE_DIRS NAMES pixman.h PATH_SUFFIXES pixman-1) - find_library(PIXMAN_LIBRARIES NAMES pixman-1) - find_package_handle_standard_args(PIXMAN DEFAULT_MSG PIXMAN_LIBRARIES PIXMAN_INCLUDE_DIRS) +#[=======================================================================[.rst: +FindPixman +---------- + +Find the Pixman library + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables if found: + +``PIXMAN_INCLUDE_DIRS`` + where to find pixman.h, etc. +``PIXMAN_LIBRARIES`` + the libraries to link against to use Pixman. +``PIXMAN_FOUND`` + TRUE if found + +#]=======================================================================] + +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_Pixman QUIET pixman-1) endif() -if(Pixman_FIND_REQUIRED AND NOT PIXMAN_FOUND) - message(FATAL_ERROR "Could not find Pixman") +find_path(Pixman_INCLUDE_DIR NAMES pixman.h + PATH_SUFFIXES + pixman-1 + HINTS + ${PC_Pixman_INCLUDE_DIRS} +) +mark_as_advanced(Pixman_INCLUDE_DIR) + +find_library(Pixman_LIBRARY NAMES pixman-1 + HINTS + ${PC_Pixman_LIBRARY_DIRS} +) +mark_as_advanced(Pixman_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Pixman + REQUIRED_VARS + Pixman_LIBRARY Pixman_INCLUDE_DIR +) + +if(Pixman_FOUND) + set(PIXMAN_INCLUDE_DIRS ${Pixman_INCLUDE_DIR}) + set(PIXMAN_LIBRARIES ${Pixman_LIBRARY}) endif() |