fix(cmake): copy assets

This commit is contained in:
maelstrom 2025-08-12 00:19:15 +02:00
parent 384c249874
commit 56ffc3f88c
2 changed files with 20 additions and 7 deletions

View file

@ -2,4 +2,13 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/deps.cmake)
add_executable(client "src/main.cpp")
target_link_libraries(client PRIVATE openblocks glfw)
add_dependencies(client openblocks)
add_dependencies(client openblocks)
if(WIN32)
# Copy assets
add_custom_command(
TARGET client POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/assets
$<TARGET_FILE_DIR:client>/assets)
endif()

View file

@ -39,17 +39,21 @@ qt_add_executable(editor MANUAL_FINALIZATION ${PROJECT_SOURCES})
target_include_directories(editor PRIVATE .)
target_link_libraries(editor PRIVATE openblocks Qt6::Widgets Qt6::OpenGLWidgets ${QSCINTILLA_LIBRARY})
# Copy assets
add_custom_command(
TARGET editor POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/assets
$<TARGET_FILE_DIR:editor>/assets)
set_target_properties(editor PROPERTIES
WIN32_EXECUTABLE ON
)
# Copy Qt files
if (WIN32)
#include("${QT_DEPLOY_SUPPORT}")
# Copy assets
add_custom_command(
TARGET editor POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/assets
$<TARGET_FILE_DIR:editor>/assets)
# Copy over QScintilla DLLs
# TODO: Use a better approach?
add_custom_command(