diff --git a/api/api_autogen/CMakeLists.txt b/api/api_autogen/CMakeLists.txt index 628e168fd..6c2f3260c 100644 --- a/api/api_autogen/CMakeLists.txt +++ b/api/api_autogen/CMakeLists.txt @@ -234,12 +234,21 @@ if (MSVC) ) endforeach( file_i ) - - add_custom_command( - TARGET export_config - POST_BUILD - COMMAND cmd /C $<$:${EXPORT_RUN}> - ) + if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + add_custom_command( + TARGET export_config + PRE_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E rm -rf ${CMAKE_CURRENT_SOURCE_DIR}/library/defaults/*.* + ) + + add_custom_command( + TARGET export_config + POST_BUILD + COMMAND cmd /C $<$:${EXPORT_RUN}> + ) + endif() + else() if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") add_custom_command(