1
0
Fork 0
forked from suyu/suyu

CMake: Use IMPORTED target for libpng

This commit is contained in:
Yuri Kunde Schlesner 2017-05-27 19:05:50 -07:00
parent 01ebb65c30
commit 4660bc1c78
2 changed files with 5 additions and 8 deletions

View file

@ -1,5 +1,5 @@
# CMake 3.2 required for cmake to know the right flags for CXX standard on OSX # CMake 3.5 required for support for IMPORTED find_package libraries
cmake_minimum_required(VERSION 3.2) cmake_minimum_required(VERSION 3.5)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules)
function(download_bundled_external remote_path lib_name prefix_var) function(download_bundled_external remote_path lib_name prefix_var)
@ -131,9 +131,7 @@ set_property(DIRECTORY APPEND PROPERTY
COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG> $<$<NOT:$<CONFIG:Debug>>:NDEBUG>) COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG> $<$<NOT:$<CONFIG:Debug>>:NDEBUG>)
find_package(PNG QUIET) find_package(PNG QUIET)
if (PNG_FOUND) if (NOT PNG_FOUND)
add_definitions(-DHAVE_PNG)
else()
message(STATUS "libpng not found. Some debugging features have been disabled.") message(STATUS "libpng not found. Some debugging features have been disabled.")
endif() endif()

View file

@ -87,7 +87,6 @@ if (ARCHITECTURE_x86_64)
endif() endif()
if (PNG_FOUND) if (PNG_FOUND)
target_link_libraries(video_core PRIVATE ${PNG_LIBRARIES}) target_link_libraries(video_core PRIVATE PNG::PNG)
target_include_directories(video_core PRIVATE ${PNG_INCLUDE_DIRS}) target_compile_definitions(video_core PRIVATE HAVE_PNG)
target_compile_definitions(video_core PRIVATE ${PNG_DEFINITIONS})
endif() endif()