diff options
Diffstat (limited to 'CMake')
-rw-r--r-- | CMake/FindCairo.cmake | 61 | ||||
-rw-r--r-- | CMake/FindEpollShim.cmake | 17 | ||||
-rw-r--r-- | CMake/FindGdkPixbuf.cmake | 65 | ||||
-rw-r--r-- | CMake/FindPango.cmake | 61 |
4 files changed, 102 insertions, 102 deletions
diff --git a/CMake/FindCairo.cmake b/CMake/FindCairo.cmake index 36c28095..10ab8fb0 100644 --- a/CMake/FindCairo.cmake +++ b/CMake/FindCairo.cmake @@ -8,40 +8,35 @@ # Define CAIRO_MIN_VERSION for which version desired. # -INCLUDE(FindPkgConfig) +find_package(PkgConfig) -IF(Cairo_FIND_REQUIRED) - SET(_pkgconfig_REQUIRED "REQUIRED") -ELSE(Cairo_FIND_REQUIRED) - SET(_pkgconfig_REQUIRED "") -ENDIF(Cairo_FIND_REQUIRED) +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(CAIRO_MIN_VERSION) + pkg_check_modules(CAIRO ${_pkgconfig_REQUIRED} cairo>=${CAIRO_MIN_VERSION}) +else(CAIRO_MIN_VERSION) + pkg_check_modules(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) +if(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND) + find_path(CAIRO_INCLUDE_DIRS cairo.h) + find_library(CAIRO_LIBRARIES cairo) +else(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND) + # Make paths absolute https://stackoverflow.com/a/35476270 + # Important on FreeBSD because /usr/local/lib is not on /usr/bin/ld's default path + set(CAIRO_LIBS_ABSOLUTE) + foreach(lib ${CAIRO_LIBRARIES}) + set(var_name CAIRO_${lib}_ABS) + find_library(${var_name} ${lib} ${CAIRO_LIBRARY_DIRS}) + list(APPEND CAIRO_LIBS_ABSOLUTE ${${var_name}}) + endforeach() + set(CAIRO_LIBRARIES ${CAIRO_LIBS_ABSOLUTE}) +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: ${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) - -# Hide advanced variables from CMake GUIs -MARK_AS_ADVANCED(CAIRO_LIBRARIES CAIRO_INCLUDE_DIRS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CAIRO DEFAULT_MSG CAIRO_LIBRARIES CAIRO_INCLUDE_DIRS) +mark_as_advanced(CAIRO_LIBRARIES CAIRO_INCLUDE_DIRS) diff --git a/CMake/FindEpollShim.cmake b/CMake/FindEpollShim.cmake new file mode 100644 index 00000000..b6bed142 --- /dev/null +++ b/CMake/FindEpollShim.cmake @@ -0,0 +1,17 @@ +# - Find EpollShim +# Once done, this will define +# +# EPOLLSHIM_FOUND - System has EpollShim +# EPOLLSHIM_INCLUDE_DIRS - The EpollShim include directories +# EPOLLSHIM_LIBRARIES - The libraries needed to use EpollShim + +find_path(EPOLLSHIM_INCLUDE_DIRS NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim) +find_library(EPOLLSHIM_LIBRARIES NAMES epoll-shim libepoll-shim HINTS /usr/local/lib) + +if (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) + set(EPOLLSHIM_FOUND TRUE) +endif (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(EPOLLSHIM DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS) +mark_as_advanced(EPOLLSHIM_INCLUDE_DIRS EPOLLSHIM_LIBRARIES) diff --git a/CMake/FindGdkPixbuf.cmake b/CMake/FindGdkPixbuf.cmake index 4ea1d5b9..9cad4f92 100644 --- a/CMake/FindGdkPixbuf.cmake +++ b/CMake/FindGdkPixbuf.cmake @@ -8,43 +8,36 @@ # Define GDK_PIXBUF_MIN_VERSION for which version desired. # -INCLUDE(FindPkgConfig) +find_package(PkgConfig) -IF(GdkPixbuf_FIND_REQUIRED) - SET(_pkgconfig_REQUIRED "REQUIRED") -ELSE(GdkPixbuf_FIND_REQUIRED) - SET(_pkgconfig_REQUIRED "") -ENDIF(GdkPixbuf_FIND_REQUIRED) +if(GdkPixbuf_FIND_REQUIRED) + set(_pkgconfig_REQUIRED "REQUIRED") +else(GdkPixbuf_FIND_REQUIRED) + set(_pkgconfig_REQUIRED "") +endif(GdkPixbuf_FIND_REQUIRED) -IF(GDK_PIXBUF_MIN_VERSION) - PKG_SEARCH_MODULE(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0>=${GDK_PIXBUF_MIN_VERSION}") -ELSE(GDK_PIXBUF_MIN_VERSION) - PKG_SEARCH_MODULE(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0") -ENDIF(GDK_PIXBUF_MIN_VERSION) +if(GDK_PIXBUF_MIN_VERSION) + pkg_check_modules(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0>=${GDK_PIXBUF_MIN_VERSION}") +else(GDK_PIXBUF_MIN_VERSION) + pkg_check_modules(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0") +endif(GDK_PIXBUF_MIN_VERSION) -IF(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND) - FIND_PATH(GDK_PIXBUF_INCLUDE_DIRS gdk-pixbuf/gdk-pixbuf.h) - FIND_LIBRARY(GDK_PIXBUF_LIBRARIES gdk_pixbuf-2.0) +if(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND) + find_path(GDK_PIXBUF_INCLUDE_DIRS gdk-pixbuf/gdk-pixbuf.h) + find_library(GDK_PIXBUF_LIBRARIES gdk_pixbuf-2.0) +else(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND) + SET(GdkPixbuf_FOUND 1) + # Make paths absolute https://stackoverflow.com/a/35476270 + # Important on FreeBSD because /usr/local/lib is not on /usr/bin/ld's default path + set(GDK_PIXBUF_LIBS_ABSOLUTE) + foreach(lib ${GDK_PIXBUF_LIBRARIES}) + set(var_name GDK_PIXBUF_${lib}_ABS) + find_library(${var_name} ${lib} ${GDK_PIXBUF_LIBRARY_DIRS}) + list(APPEND GDK_PIXBUF_LIBS_ABSOLUTE ${${var_name}}) + endforeach() + set(GDK_PIXBUF_LIBRARIES ${GDK_PIXBUF_LIBS_ABSOLUTE}) +endif(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND) - # Report results - IF(GDK_PIXBUF_LIBRARIES AND GDK_PIXBUF_INCLUDE_DIRS) - SET(GDK_PIXBUF_FOUND 1) - SET(GdkPixbuf_FOUND 1) - IF(NOT GdkPixbuf_FIND_QUIETLY) - MESSAGE(STATUS "Found GdkPixbuf: ${GDK_PIXBUF_LIBRARIES}") - ENDIF(NOT GdkPixbuf_FIND_QUIETLY) - ELSE(GDK_PIXBUF_LIBRARIES AND GDK_PIXBUF_INCLUDE_DIRS) - IF(GdkPixbuf_FIND_REQUIRED) - MESSAGE(SEND_ERROR "Could not find GdkPixbuf") - ELSE(GdkPixbuf_FIND_REQUIRED) - IF(NOT GdkPixbuf_FIND_QUIETLY) - MESSAGE(STATUS "Could not find GdkPixbuf") - ENDIF(NOT GdkPixbuf_FIND_QUIETLY) - ENDIF(GdkPixbuf_FIND_REQUIRED) - ENDIF(GDK_PIXBUF_LIBRARIES AND GDK_PIXBUF_INCLUDE_DIRS) -ELSE(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND) - SET(GdkPixbuf_FOUND 1) -ENDIF(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND) - -# Hide advanced variables from CMake GUIs -MARK_AS_ADVANCED(GDK_PIXBUF_LIBRARIES GDK_PIXBUF_INCLUDE_DIRS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GDK_PIXBUF DEFAULT_MSG GDK_PIXBUF_LIBRARIES GDK_PIXBUF_INCLUDE_DIRS) +mark_as_advanced(GDK_PIXBUF_LIBRARIES GDK_PIXBUF_INCLUDE_DIRS) diff --git a/CMake/FindPango.cmake b/CMake/FindPango.cmake index 64bf9ac4..eb296d75 100644 --- a/CMake/FindPango.cmake +++ b/CMake/FindPango.cmake @@ -8,40 +8,35 @@ # Define PANGO_MIN_VERSION for which version desired. # -INCLUDE(FindPkgConfig) +find_package(PkgConfig) -IF(Pango_FIND_REQUIRED) - SET(_pkgconfig_REQUIRED "REQUIRED") -ELSE(Pango_FIND_REQUIRED) - SET(_pkgconfig_REQUIRED "") -ENDIF(Pango_FIND_REQUIRED) +if(Pango_FIND_REQUIRED) + set(_pkgconfig_REQUIRED "REQUIRED") +else(Pango_FIND_REQUIRED) + set(_pkgconfig_REQUIRED "") +endif(Pango_FIND_REQUIRED) -IF(PANGO_MIN_VERSION) - PKG_SEARCH_MODULE(PANGO ${_pkgconfig_REQUIRED} "pango>=${PANGO_MIN_VERSION} pangocairo>=${PANGO_MIN_VERSION}") -ELSE(PANGO_MIN_VERSION) - PKG_SEARCH_MODULE(PANGO ${_pkgconfig_REQUIRED} "pango pangocairo") -ENDIF(PANGO_MIN_VERSION) +if(PANGO_MIN_VERSION) + pkg_check_modules(PANGO ${_pkgconfig_REQUIRED} "pango>=${PANGO_MIN_VERSION}" "pangocairo>=${PANGO_MIN_VERSION}") +else(PANGO_MIN_VERSION) + pkg_check_modules(PANGO ${_pkgconfig_REQUIRED} pango pangocairo) +endif(PANGO_MIN_VERSION) -IF(NOT PANGO_FOUND AND NOT PKG_CONFIG_FOUND) - FIND_PATH(PANGO_INCLUDE_DIRS pango.h) - FIND_LIBRARY(PANGO_LIBRARIES pango pangocairo) +if(NOT PANGO_FOUND AND NOT PKG_CONFIG_FOUND) + find_path(PANGO_INCLUDE_DIRS pango.h) + find_library(PANGO_LIBRARIES pango pangocairo) +else(NOT PANGO_FOUND AND NOT PKG_CONFIG_FOUND) + # Make paths absolute https://stackoverflow.com/a/35476270 + # Important on FreeBSD because /usr/local/lib is not on /usr/bin/ld's default path + set(PANGO_LIBS_ABSOLUTE) + foreach(lib ${PANGO_LIBRARIES}) + set(var_name PANGO_${lib}_ABS) + find_library(${var_name} ${lib} ${PANGO_LIBRARY_DIRS}) + list(APPEND PANGO_LIBS_ABSOLUTE ${${var_name}}) + endforeach() + set(PANGO_LIBRARIES ${PANGO_LIBS_ABSOLUTE}) +endif(NOT PANGO_FOUND AND NOT PKG_CONFIG_FOUND) - # Report results - IF(PANGO_LIBRARIES AND PANGO_INCLUDE_DIRS) - SET(PANGO_FOUND 1) - IF(NOT Pango_FIND_QUIETLY) - MESSAGE(STATUS "Found Pango: ${PANGO_LIBRARIES}") - ENDIF(NOT Pango_FIND_QUIETLY) - ELSE(PANGO_LIBRARIES AND PANGO_INCLUDE_DIRS) - IF(Pango_FIND_REQUIRED) - MESSAGE(SEND_ERROR "Could not find Pango") - ELSE(Pango_FIND_REQUIRED) - IF(NOT Pango_FIND_QUIETLY) - MESSAGE(STATUS "Could not find Pango") - ENDIF(NOT Pango_FIND_QUIETLY) - ENDIF(Pango_FIND_REQUIRED) - ENDIF(PANGO_LIBRARIES AND PANGO_INCLUDE_DIRS) -ENDIF(NOT PANGO_FOUND AND NOT PKG_CONFIG_FOUND) - -# Hide advanced variables from CMake GUIs -MARK_AS_ADVANCED(PANGO_LIBRARIES PANGO_INCLUDE_DIRS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PANGO DEFAULT_MSG PANGO_LIBRARIES PANGO_INCLUDE_DIRS) +mark_as_advanced(PANGO_LIBRARIES PANGO_INCLUDE_DIRS) |