# HG changeset patch
# User koda
# Date 1433265046 -3600
# Node ID 47c3a00f8037f5979a44de4effaf3fa65d91a94a
# Parent  0f9fc5923be49d63589c4c23d4147b1889ff0703
Make sure that the png library name is always defined

diff -r 0f9fc5923be4 -r 47c3a00f8037 tools/CMakeLists.txt
--- a/tools/CMakeLists.txt	Tue Jun 02 17:57:15 2015 +0100
+++ b/tools/CMakeLists.txt	Tue Jun 02 18:10:46 2015 +0100
@@ -8,6 +8,7 @@
 
 if(APPLE)
     find_package(Qt4 REQUIRED QUIET)
+    find_package(PNG REQUIRED)
     find_package(SDL REQUIRED)
     find_package(SDL_image REQUIRED)
     find_package(SDL_net REQUIRED)
@@ -32,11 +33,9 @@
     #remove the "libSDLmain.a" from the SDL_LIBRARY variable
     string(REGEX REPLACE ".*;(.*)" "\\1" sdl_library_only "${sdl_library_only}")
 
-    if(NOT NOPNG)
-        #get the neme of the library (harmelss if it is static)
-        string(REGEX REPLACE ".*/(.*)$" "\\1" PNG_LIBNAME "${PNG_LIBRARY}")
-        string(REGEX REPLACE ".*/(.*)$" "\\1" ZLIB_LIBNAME "${ZLIB_LIBRARY}")
-    endif()
+    #get the neme of the library (harmelss if it is static)
+    string(REGEX REPLACE ".*/(.*)$" "\\1" PNG_LIBNAME "${PNG_LIBRARY}")
+    string(REGEX REPLACE ".*/(.*)$" "\\1" ZLIB_LIBNAME "${ZLIB_LIBRARY}")
 
     set(frameworks_dir ${CMAKE_INSTALL_PREFIX}/${target_library_install_dir})
     if(${BUILD_ENGINE_LIBRARY})