mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-04-19 19:15:08 +02:00
build: use pkg-config to find correct libpng version
as recommended by this StackOverflow answer: https://stackoverflow.com/a/30981965
This commit is contained in:
parent
3f75fd5a3a
commit
40e4869f69
1 changed files with 15 additions and 1 deletions
|
@ -2,7 +2,21 @@ cmake_minimum_required(VERSION 2.8.12)
|
|||
project(MINEDMAP CXX)
|
||||
|
||||
|
||||
find_package(PNG REQUIRED)
|
||||
# search for pkg-config
|
||||
include (FindPkgConfig)
|
||||
if (NOT PKG_CONFIG_FOUND)
|
||||
message (FATAL_ERROR "pkg-config not found")
|
||||
endif ()
|
||||
|
||||
# check for libpng
|
||||
pkg_check_modules (LIBPNG libpng16 REQUIRED)
|
||||
if (NOT LIBPNG_FOUND)
|
||||
message(FATAL_ERROR "You don't seem to have libpng16 development libraries installed")
|
||||
else ()
|
||||
include_directories (${LIBPNG_INCLUDE_DIRS})
|
||||
link_directories (${LIBPNG_LIBRARY_DIRS})
|
||||
link_libraries (${LIBPNG_LIBRARIES})
|
||||
endif ()
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue