# HG changeset patch
# User koda
# Date 1335147261 -7200
# Node ID be298851fc7b1c1632c22c99af5a8798b5b521f8
# Parent  e6094d329108a1f5a53265ae9eb930692f6c74cc
when libpng is not found, gratiously fallback to bmp screenshots; untested

diff -r e6094d329108 -r be298851fc7b hedgewars/CMakeLists.txt
--- a/hedgewars/CMakeLists.txt	Mon Apr 23 04:05:18 2012 +0200
+++ b/hedgewars/CMakeLists.txt	Mon Apr 23 04:14:21 2012 +0200
@@ -142,6 +142,13 @@
     message(FATAL_ERROR "No Pascal compiler found!")
 endif()
 
+find_package(png)
+if(${PNG_LIBRARY})
+    set(pascal_compiler_flags_cmn "-dPNG_SCREENSHOTS" ${pascal_compiler_flags_cmn})
+else()
+    message(STATUS "PNG library not found, switching to screenshots in BMP format")
+endif()
+
 set(pascal_compiler ${fpc_executable})
 set(pascal_compiler_flags ${noexecstack_flags} ${pascal_compiler_flags_cmn} ${hwengine_project})
 
diff -r e6094d329108 -r be298851fc7b hedgewars/options.inc
--- a/hedgewars/options.inc	Mon Apr 23 04:05:18 2012 +0200
+++ b/hedgewars/options.inc	Mon Apr 23 04:14:21 2012 +0200
@@ -64,7 +64,6 @@
 {$ENDIF}
 
 {$IFNDEF MOBILE}
-    {$DEFINE PNG_SCREENSHOTS}
     {$DEFINE USE_AM_NUMCOLUMN}
 {$ENDIF}