From 11faefdbfd3c4c11d46ce726a85ef0d50275d951 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Thu, 16 Nov 2023 13:43:19 +0100 Subject: [PATCH] Add godot build copy as custom cmake step --- ScreenPlayWallpaper/Godot/GDExtention/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ScreenPlayWallpaper/Godot/GDExtention/CMakeLists.txt b/ScreenPlayWallpaper/Godot/GDExtention/CMakeLists.txt index 60ea81de..b09722ae 100644 --- a/ScreenPlayWallpaper/Godot/GDExtention/CMakeLists.txt +++ b/ScreenPlayWallpaper/Godot/GDExtention/CMakeLists.txt @@ -32,8 +32,16 @@ project(ScreenPlayGodotWallpaper LANGUAGES CXX) # Create our library add_library(${PROJECT_NAME} SHARED) +# Runs after compilation +# Enable executing python scripts +find_package(Python COMPONENTS Interpreter) + +add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/Tools" + COMMAND "${Python_EXECUTABLE}" "build_godot.py" "--build_path" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" + COMMENT "Running post-build step" +) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) # LIB_ARCH is the architecture being built. It is set to the build system's architecture. For macOS, we build a universal library (both # arm64 and x86_64).