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/)