--- a/hedgewars/CMakeLists.txt Mon Apr 23 19:23:28 2012 +0200
+++ b/hedgewars/CMakeLists.txt Tue Apr 24 06:53:39 2012 +0200
@@ -142,9 +142,16 @@
message(FATAL_ERROR "No Pascal compiler found!")
endif()
+
+#DEPENDECIES AND EXECUTABLES SECTION
find_package(PNG)
if(${PNG_FOUND})
+ message(STATUS "PNG screenshots enabled (library found at ${PNG_LIBRARY})")
set(pascal_compiler_flags_cmn "-dPNG_SCREENSHOTS" ${pascal_compiler_flags_cmn})
+ if(APPLE) # need to explictly link with the static lib
+ string(REGEX REPLACE "(.*)libpng.*" "\\1" PNG_LIBDIR "${PNG_LIBRARY}")
+ set(pascal_compiler_flags_cmn "-k${PNG_LIBDIR}/libpng.a" ${pascal_compiler_flags_cmn})
+ endif()
else()
message(STATUS "PNG library not found, switching to screenshots in BMP format")
endif()
@@ -153,7 +160,6 @@
set(pascal_compiler_flags ${noexecstack_flags} ${pascal_compiler_flags_cmn} ${hwengine_project})
-#DEPENDECIES AND EXECUTABLES SECTION
IF(NOT APPLE)
#here is the command for standard executables or for shared library
add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}"