2016-09-25 16:19:39 -04:00
|
|
|
#############################################################################
|
|
|
|
# Name: build/cmake/demos/CMakeLists.txt
|
|
|
|
# Purpose: CMake script for demos
|
|
|
|
# Author: Tobias Taschner
|
|
|
|
# Created: 2016-10-21
|
|
|
|
# Copyright: (c) 2016 wxWidgets development team
|
|
|
|
# Licence: wxWindows licence
|
|
|
|
#############################################################################
|
|
|
|
|
|
|
|
function(wx_add_demo name)
|
|
|
|
cmake_parse_arguments(DEMO "" "NAME" "DATA;LIBRARIES" ${ARGN})
|
|
|
|
if(NOT DEMO_NAME)
|
|
|
|
set(DEMO_NAME ${name})
|
|
|
|
endif()
|
|
|
|
wx_list_add_prefix(src_files
|
|
|
|
"${wxSOURCE_DIR}/demos/${name}/"
|
|
|
|
${DEMO_UNPARSED_ARGUMENTS})
|
|
|
|
if(WIN32)
|
|
|
|
list(APPEND src_files ${wxSOURCE_DIR}/demos/${name}/${DEMO_NAME}.rc)
|
|
|
|
endif()
|
|
|
|
add_executable(${DEMO_NAME} WIN32 MACOSX_BUNDLE ${src_files})
|
|
|
|
if(DEMO_DATA)
|
|
|
|
# TODO: unify with data handling for samples
|
|
|
|
# TODO: handle data files differently for OS X bundles
|
|
|
|
# Copy data files to output directory
|
|
|
|
foreach(data_file ${DEMO_DATA})
|
2017-12-09 08:38:11 -05:00
|
|
|
list(APPEND cmds COMMAND ${CMAKE_COMMAND}
|
2016-09-25 16:19:39 -04:00
|
|
|
-E copy ${wxSOURCE_DIR}/demos/${name}/${data_file}
|
2018-01-10 16:48:39 -05:00
|
|
|
${wxOUTPUT_DIR}/${wxPLATFORM_LIB_DIR}/${data_file})
|
2016-09-25 16:19:39 -04:00
|
|
|
endforeach()
|
|
|
|
add_custom_command(
|
|
|
|
TARGET ${DEMO_NAME} ${cmds}
|
|
|
|
COMMENT "Copying demo data files...")
|
|
|
|
endif()
|
|
|
|
if(wxBUILD_SHARED)
|
|
|
|
target_compile_definitions(${DEMO_NAME} PRIVATE WXUSINGDLL)
|
|
|
|
endif()
|
2018-05-18 16:01:02 -04:00
|
|
|
wx_exe_link_libraries(${DEMO_NAME} core ${DEMO_LIBRARIES})
|
2016-09-25 16:19:39 -04:00
|
|
|
wx_set_common_target_properties(${DEMO_NAME})
|
|
|
|
set_target_properties(${DEMO_NAME} PROPERTIES FOLDER "Demos")
|
2018-01-10 16:56:42 -05:00
|
|
|
set_target_properties(${DEMO_NAME} PROPERTIES
|
|
|
|
VS_DEBUGGER_WORKING_DIRECTORY "${wxOUTPUT_DIR}/${wxCOMPILER_PREFIX}${wxARCH_SUFFIX}_${lib_suffix}"
|
|
|
|
)
|
2016-09-25 16:19:39 -04:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
wx_add_demo(bombs
|
|
|
|
bombs.cpp
|
2018-09-21 14:41:07 -04:00
|
|
|
bombs.h
|
2016-09-25 16:19:39 -04:00
|
|
|
bombs1.cpp
|
|
|
|
game.cpp
|
2018-09-21 14:41:07 -04:00
|
|
|
game.h
|
2016-09-25 16:19:39 -04:00
|
|
|
)
|
2018-09-21 14:41:07 -04:00
|
|
|
|
2016-09-25 16:19:39 -04:00
|
|
|
wx_add_demo(forty
|
|
|
|
canvas.cpp
|
2018-09-21 14:41:07 -04:00
|
|
|
canvas.h
|
2016-09-25 16:19:39 -04:00
|
|
|
card.cpp
|
2018-09-21 14:41:07 -04:00
|
|
|
card.h
|
|
|
|
forty.cpp
|
|
|
|
forty.h
|
2016-09-25 16:19:39 -04:00
|
|
|
game.cpp
|
2018-09-21 14:41:07 -04:00
|
|
|
game.h
|
2016-09-25 16:19:39 -04:00
|
|
|
pile.cpp
|
2018-09-21 14:41:07 -04:00
|
|
|
pile.h
|
2016-09-25 16:19:39 -04:00
|
|
|
playerdg.cpp
|
2018-09-21 14:41:07 -04:00
|
|
|
playerdg.h
|
2016-09-25 16:19:39 -04:00
|
|
|
scoredg.cpp
|
2018-09-21 14:41:07 -04:00
|
|
|
scoredg.h
|
2016-09-25 16:19:39 -04:00
|
|
|
scorefil.cpp
|
2018-09-21 14:41:07 -04:00
|
|
|
scorefil.h
|
2016-09-25 16:19:39 -04:00
|
|
|
DATA
|
|
|
|
about.htm
|
|
|
|
LIBRARIES
|
2018-08-27 14:40:55 -04:00
|
|
|
html xml
|
2016-09-25 16:19:39 -04:00
|
|
|
)
|
2018-09-21 14:41:07 -04:00
|
|
|
|
|
|
|
wx_add_demo(fractal
|
|
|
|
fractal.cpp
|
|
|
|
)
|
|
|
|
|
2016-09-25 16:19:39 -04:00
|
|
|
wx_add_demo(life
|
|
|
|
dialogs.cpp
|
2018-09-21 14:41:07 -04:00
|
|
|
dialogs.h
|
2016-09-25 16:19:39 -04:00
|
|
|
game.cpp
|
2018-09-21 14:41:07 -04:00
|
|
|
game.h
|
|
|
|
life.cpp
|
|
|
|
life.h
|
2016-09-25 16:19:39 -04:00
|
|
|
reader.cpp
|
2018-09-21 14:41:07 -04:00
|
|
|
reader.h
|
2016-09-25 16:19:39 -04:00
|
|
|
DATA
|
|
|
|
breeder.lif
|
|
|
|
)
|
2018-09-21 14:41:07 -04:00
|
|
|
|
|
|
|
wx_add_demo(poem
|
|
|
|
wxpoem.cpp
|
|
|
|
wxpoem.h
|
2016-09-25 16:19:39 -04:00
|
|
|
DATA
|
|
|
|
wxpoem.txt wxpoem.dat wxpoem.idx
|
|
|
|
LIBRARIES
|
|
|
|
html
|
|
|
|
NAME
|
|
|
|
wxpoem
|
|
|
|
)
|