Skip to content

Commit c4d1fa1

Browse files
committed
Fix broken export_config post build command with ortools dependencies on Windows
1 parent 26ccbda commit c4d1fa1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

api/api_autogen/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,19 @@ file(TO_NATIVE_PATH $ENV{SAMNTDIR}/api API_DEST)
189189
set(EXPORT_RUN "$<TARGET_FILE:export_config> --api ${API_DEST} --pysam ${PYSAM}")
190190

191191
if (MSVC)
192+
193+
file(GLOB ORTOOLS_DLLS "$ENV{ORTOOLSDIR}/bin/*.dll")
194+
foreach( file_i ${ORTOOLS_DLLS})
195+
add_custom_command(
196+
TARGET export_config
197+
POST_BUILD
198+
COMMAND ${CMAKE_COMMAND}
199+
ARGS -E copy ${file_i} "$<TARGET_FILE_DIR:export_config>"
200+
)
201+
endforeach( file_i )
202+
203+
204+
192205
add_custom_command(
193206
TARGET export_config
194207
POST_BUILD

0 commit comments

Comments
 (0)