From 5db6f02742b8f154b85673151e9482b81132cfcb Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 21 May 2022 17:47:15 -0400 Subject: [PATCH] Actually use SKIP_DATA variable when adding platform executable --- cmake/AddPlatformExecutable.cmake | 2 +- example/CMakeLists.txt | 3 ++- platforms/sdl/CMakeLists.txt | 4 ++-- tools/assetpipeline/CMakeLists.txt | 8 ++++++++ tools/modelcompiler/CMakeLists.txt | 3 ++- 5 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 tools/assetpipeline/CMakeLists.txt diff --git a/cmake/AddPlatformExecutable.cmake b/cmake/AddPlatformExecutable.cmake index 6b67492..c22a198 100755 --- a/cmake/AddPlatformExecutable.cmake +++ b/cmake/AddPlatformExecutable.cmake @@ -51,7 +51,7 @@ function(add_platform_executable) endif() if(COMMAND add_platform_commands) - add_platform_commands(${add_platform_executable_TARGET} ${CMAKE_CURRENT_SOURCE_DIR}/data) + add_platform_commands(${add_platform_executable_TARGET} ${CMAKE_CURRENT_SOURCE_DIR}/game ${add_platform_executable_SKIP_DATA}) endif() set_output_dir(${add_platform_executable_TARGET}) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index ee7ec40..e9fb457 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -6,7 +6,8 @@ add_platform_executable( TARGET ExampleApp APP_CLASS ExampleApp APP_INCLUDE example.hpp - SRC ${SRC}) + SRC ${SRC} + SKIP_DATA OFF) target_link_libraries(ExampleApp PUBLIC Core) target_include_directories(ExampleApp PUBLIC diff --git a/platforms/sdl/CMakeLists.txt b/platforms/sdl/CMakeLists.txt index f9d95e2..863d77b 100644 --- a/platforms/sdl/CMakeLists.txt +++ b/platforms/sdl/CMakeLists.txt @@ -43,7 +43,7 @@ add_platform( ${EXTRA_LIBRARIES} ) -function(add_platform_commands target data_directory) +function(add_platform_commands target data_directory skip_data) if(ENABLE_MACOS) set(DUMMY_NAME ${target}-CopyShaders) @@ -57,7 +57,7 @@ function(add_platform_commands target data_directory) add_dependencies(${target} ${DUMMY_NAME}) endif() - if(NOT SKIP_DATA) + if(NOT skip_data) if(ENABLE_MACOS) add_custom_target(${target}_copy_assets COMMAND ${CMAKE_COMMAND} -E copy_directory ${data_directory} $/../Resources/data diff --git a/tools/assetpipeline/CMakeLists.txt b/tools/assetpipeline/CMakeLists.txt new file mode 100644 index 0000000..69299a5 --- /dev/null +++ b/tools/assetpipeline/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(AssetPipeline src/main.cpp) +target_link_libraries(AssetPipeline + PRIVATE + Log + Utility) +set_engine_properties(AssetPipeline) +set_output_dir(AssetPipeline) +add_dependencies(AssetPipeline ModelCompiler) diff --git a/tools/modelcompiler/CMakeLists.txt b/tools/modelcompiler/CMakeLists.txt index acbbbe3..988c00f 100755 --- a/tools/modelcompiler/CMakeLists.txt +++ b/tools/modelcompiler/CMakeLists.txt @@ -4,7 +4,8 @@ add_platform_executable( APP_INCLUDE modeleditor.hpp SRC src/modeleditor.cpp - include/modeleditor.hpp) + include/modeleditor.hpp + SKIP_DATA TRUE) target_link_libraries(ModelCompiler PUBLIC Core EditorCommon