From 0fa61b0c955ee218340340549484ffcb8510ecc0 Mon Sep 17 00:00:00 2001 From: Robert Hauck Date: Wed, 11 Feb 2015 14:02:55 +0100 Subject: [PATCH] make libpng only selectable when using png --- CMakeLists.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ccca4c4c..c85b7303 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,18 +15,20 @@ endif() option(NANA_ENABLE_PNG "Enable the use of PNG" ON) if(NANA_ENABLE_PNG) add_definitions(-DNANA_ENABLE_PNG) -endif() -option(NANA_LIBPNG "Use the included libpng" ON) -if(NANA_LIBPNG) - add_definitions(-DNANA_LIBPNG) -else() - find_package(PNG) - if (PNG_FOUND) - include_directories( ${PNG_INCLUDE_DIRS}) + option(NANA_LIBPNG "Use the included libpng" ON) + if(NANA_LIBPNG) + add_definitions(-DNANA_LIBPNG) + else() + find_package(PNG) + if (PNG_FOUND) + include_directories( ${PNG_INCLUDE_DIRS}) + endif() endif() endif() + + #copy our new config.hpp (with removed PNG defines) execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/build/cmake/config.hpp ${CMAKE_SOURCE_DIR}/include/nana/)