From 7b29b4ef55f4d7d58f1c5c9a45a0c840452eeedb Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Sun, 18 Sep 2022 10:46:48 -0400 Subject: [PATCH] Copy the pcm schema for msvc to run from build directory Fixes https://gitlab.com/kicad/code/kicad/-/issues/12318 --- kicad/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kicad/CMakeLists.txt b/kicad/CMakeLists.txt index ec40aa6aa7..5bc2bd16bc 100644 --- a/kicad/CMakeLists.txt +++ b/kicad/CMakeLists.txt @@ -107,6 +107,13 @@ if( KICAD_WIN32_INSTALL_PDBS ) install(FILES $ DESTINATION ${KICAD_BIN}) endif() +if( MSVC ) + # Allow for MSVC to run from the build directory + add_custom_command( TARGET kicad POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/pcm/schemas" "${CMAKE_BINARY_DIR}/schemas" + ) +endif() + if( APPLE ) # "install( CODE ... )" will launch its own CMake, so no variables from # this CMake instance are accessible... use helper to transfer