summaryrefslogtreecommitdiffstats
path: root/ksokoban/images/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'ksokoban/images/CMakeLists.txt')
-rw-r--r--ksokoban/images/CMakeLists.txt43
1 files changed, 43 insertions, 0 deletions
diff --git a/ksokoban/images/CMakeLists.txt b/ksokoban/images/CMakeLists.txt
new file mode 100644
index 00000000..e58ecba3
--- /dev/null
+++ b/ksokoban/images/CMakeLists.txt
@@ -0,0 +1,43 @@
+#################################################
+#
+# (C) 2016 Alexander Golubev
+# fatzer2 (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+add_definitions( -DUSE_LIBZ )
+
+# FIXME: that should potentialy break the cross
+# compilation, If it is possible in
+# generall.
+
+add_executable( bin2c bin2c.c )
+target_link_libraries( bin2c z )
+
+get_target_property( BIN2C_EXE bin2c LOCATION)
+
+foreach( _img goal.png halfstone_1.png halfstone_2.png halfstone_3.png
+ halfstone_4.png man.png object.png saveman.png stone_1.png stone_2.png
+ stone_3.png stone_4.png stone_5.png stone_6.png treasure.png starfield.png
+ )
+ list( APPEND IMAGES "${CMAKE_CURRENT_SOURCE_DIR}/${_img}" )
+endforeach( )
+
+add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/data.c
+ COMMAND "${BIN2C_EXE}" \"\" ${IMAGES}
+ DEPENDS bin2c ${IMAGES}
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+)
+
+add_custom_target ( ksokoban_images_data_c
+ DEPENDS data.c
+)