Skip to content

Commit e9a3394

Browse files
authored
Merge pull request #2209 from NatLabRockies/SAM_2208
Add pre build command to Windows to remove potentially stale json files #2208
2 parents f3abcc9 + d4be59d commit e9a3394

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

api/api_autogen/CMakeLists.txt

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,21 @@ if (MSVC)
234234
)
235235
endforeach( file_i )
236236

237-
238-
add_custom_command(
239-
TARGET export_config
240-
POST_BUILD
241-
COMMAND cmd /C $<$<CONFIG:Release>:${EXPORT_RUN}>
242-
)
237+
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
238+
add_custom_command(
239+
TARGET export_config
240+
PRE_BUILD
241+
COMMAND ${CMAKE_COMMAND}
242+
ARGS -E rm -rf ${CMAKE_CURRENT_SOURCE_DIR}/library/defaults/*.*
243+
)
244+
245+
add_custom_command(
246+
TARGET export_config
247+
POST_BUILD
248+
COMMAND cmd /C $<$<CONFIG:Release>:${EXPORT_RUN}>
249+
)
250+
endif()
251+
243252
else()
244253
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
245254
add_custom_command(

0 commit comments

Comments
 (0)