Skip to content

Commit

Permalink
use pkg-config to find GLFW 3.3+ during builds
Browse files Browse the repository at this point in the history
  • Loading branch information
striezel committed Mar 22, 2024
1 parent ab67bfe commit 797012e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions webp-viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# We might support earlier versions, too, but try to use a more recent one.
cmake_minimum_required (VERSION 3.8)

project(webp-viewer)
Expand Down Expand Up @@ -57,15 +56,15 @@ else ()
endif ()

# GLFW for window handling
find_package (glfw3 3.3 REQUIRED)
find_package(PkgConfig)
pkg_search_module (glfw3 REQUIRED glfw3>=3.3)
if (glfw3_FOUND)
target_link_libraries (webp-viewer glfw)
target_link_libraries (webp-viewer ${glfw3_LIBRARIES})
else ()
message ( FATAL_ERROR "GLFW was not found!" )
message ( FATAL_ERROR "GLFW 3.3 or later was not found!" )
endif ()

# libwebp
find_package(PkgConfig)
pkg_search_module (WEBP REQUIRED libwebp)
if (WEBP_FOUND)
include_directories(${WEBP_INCLUDE_DIRS})
Expand Down

0 comments on commit 797012e

Please sign in to comment.