summaryrefslogtreecommitdiffstats
path: root/ksokoban/images/CMakeLists.txt
blob: e58ecba3684843c0a53605ed5ddcb38f09b1815a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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
)