diff options
Diffstat (limited to 'CMake/FindCairo.cmake')
-rw-r--r-- | CMake/FindCairo.cmake | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/CMake/FindCairo.cmake b/CMake/FindCairo.cmake index 046bb250..01ba7d6c 100644 --- a/CMake/FindCairo.cmake +++ b/CMake/FindCairo.cmake @@ -8,37 +8,41 @@ # Define CAIRO_MIN_VERSION for which version desired. # -INCLUDE(FindPkgConfig) - -IF(Cairo_FIND_REQUIRED) - SET(_pkgconfig_REQUIRED "REQUIRED") -ELSE(Cairo_FIND_REQUIRED) - SET(_pkgconfig_REQUIRED "") -ENDIF(Cairo_FIND_REQUIRED) - -IF(CAIRO_MIN_VERSION) - PKG_SEARCH_MODULE(CAIRO ${_pkgconfig_REQUIRED} cairo>=${CAIRO_MIN_VERSION}) -ELSE(CAIRO_MIN_VERSION) - PKG_SEARCH_MODULE(CAIRO ${_pkgconfig_REQUIRED} cairo) -ENDIF(CAIRO_MIN_VERSION) - -IF(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND) - FIND_PATH(CAIRO_INCLUDE_DIRS cairo.h) - FIND_LIBRARY(CAIRO_LIBRARIES cairo) - - # Report results - IF(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS) - SET(CAIRO_FOUND 1) - IF(NOT Cairo_FIND_QUIETLY) - MESSAGE(STATUS "Found Cairo: ${CAIRO_LIBRARIES}") - ENDIF(NOT Cairo_FIND_QUIETLY) - ELSE(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS) - IF(Cairo_FIND_REQUIRED) - MESSAGE(SEND_ERROR "Could not find Cairo") - ELSE(Cairo_FIND_REQUIRED) - IF(NOT Cairo_FIND_QUIETLY) - MESSAGE(STATUS "Could not find Cairo") - ENDIF(NOT Cairo_FIND_QUIETLY) - ENDIF(Cairo_FIND_REQUIRED) - ENDIF(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS) -ENDIF(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND) +include(FindPkgConfig) + +if(Cairo_FIND_REQUIRED) + set(_pkgconfig_REQUIRED "REQUIRED") +else(Cairo_FIND_REQUIRED) + set(_pkgconfig_REQUIRED "") +endif(Cairo_FIND_REQUIRED) + +if(CAIRO_MIN_VERSION) + pkg_search_module(CAIRO ${_pkgconfig_REQUIRED} cairo>=${CAIRO_MIN_VERSION}) +else(CAIRO_MIN_VERSION) + pkg_search_module(CAIRO ${_pkgconfig_REQUIRED} cairo) +endif(CAIRO_MIN_VERSION) + +if(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND) + FIND_PATH(CAIRO_INCLUDE_DIRS cairo.h) + FIND_LIBRARY(CAIRO_LIBRARIES cairo) +endif(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND) + +# Report results +if(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS) + + set(CAIRO_FOUND 1) + if(NOT Cairo_FIND_QUIETLY) + message(STATUS "Found Cairo: includes '${CAIRO_INCLUDE_DIRS}', libraries '${CAIRO_LIBRARIES}'") + endif(NOT Cairo_FIND_QUIETLY) + +else(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS) + + if(Cairo_FIND_REQUIRED) + message(SEND_ERROR "Could not find Cairo") + else(Cairo_FIND_REQUIRED) + if(NOT Cairo_FIND_QUIETLY) + message(STATUS "Could not find Cairo") + endif(NOT Cairo_FIND_QUIETLY) + endif(Cairo_FIND_REQUIRED) + +endif(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS) |