Remove the need to copy icon files to the wx build directory

This means in tree builds no longer have extra icon files floating around
This commit is contained in:
Arthur Moore 2015-03-22 08:14:18 -04:00
parent fd0d379d2d
commit 11cc454066
3 changed files with 8 additions and 14 deletions

View File

@ -69,19 +69,13 @@ include_directories(widgets)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
# Copy over needed icons
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../art/vbam.png DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../art/wxvbam.xpm DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
# wxrc does not support xrs files in -c output (> 10x compression)
# so do it manually using slow but portable bin2c.cmake script
#Compress the xrc file (and png image) to an xrs file (> 10x compression)
ADD_CUSTOM_COMMAND(OUTPUT wxvbam.xrs
# doing this in its own dir prevents name prefixes
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/wxvbam.xrc wxvbam.xrc
COMMAND wxrc wxvbam.xrc -o wxvbam.xrs
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${XRC_ITEM}
COMMAND wxrc ${CMAKE_CURRENT_SOURCE_DIR}/wxvbam.xrc -o ${CMAKE_CURRENT_BINARY_DIR}/wxvbam.xrs
DEPENDS wxvbam.xrc)
# wxrc does not support xrs files in -c output
# so do it manually using slow but portable bin2c.cmake script
ADD_CUSTOM_COMMAND(OUTPUT builtin-xrc.h
COMMAND ${CMAKE_COMMAND} -DINFILE=wxvbam.xrs -DOUTFILE=builtin-xrc.h -DVARNAME=builtin_xrs -P ${CMAKE_CURRENT_SOURCE_DIR}/bin2c.cmake
DEPENDS wxvbam.xrs)
@ -133,7 +127,7 @@ SET( SRC_WX
cmdhandlers.h
cmd-evtable.h
#Icon file
wxvbam.xpm
../art/wxvbam.xpm
)
IF(ENABLE_OPENAL)

View File

@ -26,7 +26,7 @@
// ImageMagick makes the name wxvbam, but wx expects wxvbam_xpm
#define wxvbam wxvbam_xpm
const
#include "wxvbam.xpm"
#include "../art/wxvbam.xpm"
#undef wxvbam
#endif

View File

@ -456,7 +456,7 @@
<object class="wxMenuItem" name="wxID_ABOUT"/>
</object>
</object>
<object class="wxIcon" name="MainIcon">vbam.png</object>
<object class="wxIcon" name="MainIcon">../art/vbam.png</object>
<object class="wxDialog" name="GBPrinter">
<title>GB Printer</title>
<object class="wxBoxSizer">