when libpng is not found, gratiously fallback to bmp screenshots; untested
authorkoda
Mon, 23 Apr 2012 04:14:21 +0200
changeset 6915 be298851fc7b
parent 6914 e6094d329108
child 6916 50243b6ffab5
when libpng is not found, gratiously fallback to bmp screenshots; untested
hedgewars/CMakeLists.txt
hedgewars/options.inc
--- 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})
 
--- 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}