Copy the pcm schema for msvc to run from build directory

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12318
This commit is contained in:
Marek Roszko 2022-09-18 10:46:48 -04:00
parent ef44e5cab5
commit 7b29b4ef55
1 changed files with 7 additions and 0 deletions

View File

@ -107,6 +107,13 @@ if( KICAD_WIN32_INSTALL_PDBS )
install(FILES $<TARGET_PDB_FILE:kicad> 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