Make sure that the png library name is always defined
authorkoda
Tue, 02 Jun 2015 18:10:46 +0100
changeset 10975 47c3a00f8037
parent 10974 0f9fc5923be4
child 10976 56f07b52213a
Make sure that the png library name is always defined
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})