diff --git a/cmake/webp-config.cmake b/cmake/webp-config.cmake deleted file mode 100644 index d3bc373..0000000 --- a/cmake/webp-config.cmake +++ /dev/null @@ -1,35 +0,0 @@ -# - Try to find libwebp -# -# Once done this will define -# WEBP_FOUND - System has libwebp -# WEBP_INCLUDE_DIRS - The libwebp include directories -# WEBP_LIBRARIES - The libraries needed to use libwebp - -find_path(WEBP_INCLUDE_PATH webp/decode.h /usr/include/) -if (WEBP_INCLUDE_PATH) - set(WEBP_INCLUDE_DIRS - ${WEBP_INCLUDE_PATH} - ) -else () - message("Include path for libwebp could not be determined!") -endif (WEBP_INCLUDE_PATH) - -find_library(WEBP_LIBRARIES webp) - -if (NOT WEBP_LIBRARIES) - message( "Library for webp was not found!") -endif () - -if (WEBP_INCLUDE_DIRS AND WEBP_LIBRARIES) - set(WEBP_FOUND TRUE) -else () - set(WEBP_FOUND FALSE) -endif () - -if (WEBP_FIND_REQUIRED) - if (NOT WEBP_FOUND) - message(FATAL_ERROR "Could not find libwebp!") - endif () -endif () - -mark_as_advanced(WEBP_LIBRARIES WEBP_INCLUDE_DIRS) diff --git a/cmake/webpdemux-config.cmake b/cmake/webpdemux-config.cmake deleted file mode 100644 index 17fff8a..0000000 --- a/cmake/webpdemux-config.cmake +++ /dev/null @@ -1,35 +0,0 @@ -# - Try to find libwebpdemux -# -# Once done this will define -# WEBPDEMUX_FOUND - System has libwebpdemux -# WEBPDEMUX_INCLUDE_DIRS - The libwebpdemux include directories -# WEBPDEMUX_LIBRARIES - The libraries needed to use libwebpdemux - -find_path(WEBPDEMUX_INCLUDE_PATH webp/demux.h /usr/include/) -if (WEBPDEMUX_INCLUDE_PATH) - set(WEBPDEMUX_INCLUDE_DIRS - ${WEBPDEMUX_INCLUDE_PATH} - ) -else () - message("Include path for libwebpdemux could not be determined!") -endif (WEBPDEMUX_INCLUDE_PATH) - -find_library(WEBPDEMUX_LIBRARIES webpdemux) - -if (NOT WEBPDEMUX_LIBRARIES) - message( "Library for webpdemux was not found!") -endif () - -if (WEBPDEMUX_INCLUDE_DIRS AND WEBPDEMUX_LIBRARIES) - set(WEBPDEMUX_FOUND TRUE) -else () - set(WEBPDEMUX_FOUND FALSE) -endif () - -if (WEBPDEMUX_FIND_REQUIRED) - if (NOT WEBPDEMUX_FOUND) - message(FATAL_ERROR "Could not find libwebpdemux!") - endif () -endif () - -mark_as_advanced(WEBPDEMUX_LIBRARIES WEBPDEMUX_INCLUDE_DIRS) diff --git a/webp-viewer/CMakeLists.txt b/webp-viewer/CMakeLists.txt index f6e92e8..d533a45 100644 --- a/webp-viewer/CMakeLists.txt +++ b/webp-viewer/CMakeLists.txt @@ -65,8 +65,8 @@ else () endif () # libwebp -set(webp_DIR "../cmake/" ) -find_package (webp REQUIRED) +find_package(PkgConfig) +pkg_search_module (WEBP REQUIRED libwebp) if (WEBP_FOUND) include_directories(${WEBP_INCLUDE_DIRS}) target_link_libraries (webp-viewer ${WEBP_LIBRARIES}) @@ -75,8 +75,7 @@ else () endif () # libwebpdemux -set(webpdemux_DIR "../cmake/" ) -find_package (webpdemux REQUIRED) +pkg_search_module (WEBPDEMUX REQUIRED libwebpdemux) if (WEBPDEMUX_FOUND) include_directories(${WEBPDEMUX_INCLUDE_DIRS}) target_link_libraries (webp-viewer ${WEBPDEMUX_LIBRARIES})