35 lines
1.1 KiB
Text
35 lines
1.1 KiB
Text
|
include(../../cmake/AddPlatformExecutable.cmake)
|
||
|
|
||
|
add_platform(
|
||
|
MAIN_FILE
|
||
|
main.cpp.in
|
||
|
LINK_LIBRARIES
|
||
|
Core
|
||
|
)
|
||
|
|
||
|
function(add_platform_commands target)
|
||
|
set_target_properties(
|
||
|
${target}
|
||
|
PROPERTIES
|
||
|
SUFFIX ".html"
|
||
|
)
|
||
|
|
||
|
set(DUMMY_NAME ${target}-CopyShaders)
|
||
|
|
||
|
add_custom_target(${DUMMY_NAME} ALL DEPENDS ${CMAKE_BINARY_DIR}/${target}-dummy)
|
||
|
|
||
|
if(ENABLE_MACOS)
|
||
|
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${target}-dummy
|
||
|
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:${target}>/../Resources/shaders
|
||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/shaders $<TARGET_FILE_DIR:${target}>/../Resources/shaders
|
||
|
)
|
||
|
else()
|
||
|
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${target}-dummy
|
||
|
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:${target}>/shaders
|
||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/shaders $<TARGET_FILE_DIR:${target}>/shaders
|
||
|
)
|
||
|
endif()
|
||
|
|
||
|
add_dependencies(${target} ${DUMMY_NAME})
|
||
|
endfunction()
|