summaryrefslogtreecommitdiffstats
path: root/ksokoban
diff options
context:
space:
mode:
authorAlexander Golubev <[email protected]>2016-02-25 06:23:55 +0300
committerSlávek Banko <[email protected]>2016-03-14 23:04:46 +0100
commit22eaaf46994712a7ea19be99d49c5ceb889470bd (patch)
tree6813293435ece498f1d90a99adfa5e9a49c875fe /ksokoban
parentfa5d2dca53e1046fe38ac7cf0210d45ad5cc5107 (diff)
downloadtdegames-22eaaf46994712a7ea19be99d49c5ceb889470bd.tar.gz
tdegames-22eaaf46994712a7ea19be99d49c5ceb889470bd.zip
Initial cmake conversion
(cherry picked from commit c70db62d3671e524d23ac974d296eb218159b000)
Diffstat (limited to 'ksokoban')
-rw-r--r--ksokoban/CMakeLists.txt41
-rw-r--r--ksokoban/data/CMakeLists.txt10
-rw-r--r--ksokoban/images/CMakeLists.txt43
-rw-r--r--ksokoban/levels/CMakeLists.txt23
4 files changed, 117 insertions, 0 deletions
diff --git a/ksokoban/CMakeLists.txt b/ksokoban/CMakeLists.txt
new file mode 100644
index 00000000..6ffa3316
--- /dev/null
+++ b/ksokoban/CMakeLists.txt
@@ -0,0 +1,41 @@
+#################################################
+#
+# (C) 2016 Alexander Golubev
+# fatzer2 (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+add_subdirectory( images )
+add_subdirectory( data )
+add_subdirectory( levels )
+
+include_directories(
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/levels
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+
+##### ksokoban (executable) #####################
+
+tde_add_executable( ksokoban AUTOMOC
+ SOURCES Bookmark.cpp History.cpp HtmlPrinter.cpp ImageData.cpp
+ InternalCollections.cpp LevelCollection.cpp LevelMap.cpp MainWindow.cpp
+ Map.cpp MapDelta.cpp ModalLabel.cpp Move.cpp MoveSequence.cpp
+ PathFinder.cpp PlayField.cpp StaticImage.cpp main.cpp
+ LINK tdecore-shared tdeui-shared tdeio-shared tdeio-shared
+ DESTINATION ${BIN_INSTALL_DIR}
+ DEPENDENCIES ksokoban_levels_data_c
+ ksokoban_images_data_c
+)
diff --git a/ksokoban/data/CMakeLists.txt b/ksokoban/data/CMakeLists.txt
new file mode 100644
index 00000000..e1114b1b
--- /dev/null
+++ b/ksokoban/data/CMakeLists.txt
@@ -0,0 +1,10 @@
+# This file is genereted by trinity-automake-cmake-convert script by Fat-Zer
+
+tde_install_icons( ksokoban )
+
+
+##### other data ################################
+
+install( FILES ksokoban.desktop
+ DESTINATION ${XDG_APPS_INSTALL_DIR}
+)
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
+)
diff --git a/ksokoban/levels/CMakeLists.txt b/ksokoban/levels/CMakeLists.txt
new file mode 100644
index 00000000..1847d3ec
--- /dev/null
+++ b/ksokoban/levels/CMakeLists.txt
@@ -0,0 +1,23 @@
+#################################################
+#
+# (C) 2016 Alexander Golubev
+# fatzer2 (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+##################################################
+
+get_target_property( BIN2C_EXE bin2c LOCATION)
+
+add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/data.c
+ COMMAND
+ "${BIN2C_EXE}" \"\" "${CMAKE_CURRENT_SOURCE_DIR}/level.data"
+ DEPENDS bin2c ${CMAKE_CURRENT_SOURCE_DIR}/level.data
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+add_custom_target ( ksokoban_levels_data_c
+ DEPENDS data.c
+)