File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,15 +137,18 @@ function(generateFMU modelIdentifier)
137137
138138 foreach (dep IN LISTS FMU_LINK_TARGETS)
139139 if (TARGET ${dep} )
140- add_custom_command (TARGET ${versionTarget} POST_BUILD
141- WORKING_DIRECTORY "${modelOutputDir} "
142- COMMAND ${CMAKE_COMMAND } -E echo "[generateFMU-${fmiVersion} ] Copying runtime of ${dep} to ${binaryOutputDir} "
143- COMMAND ${CMAKE_COMMAND } -E make_directory "${binaryOutputDir} "
144- # copy the target's runtime file (dll/so/dylib) into the binaries folder
145- COMMAND ${CMAKE_COMMAND } -E copy_if_different
146- $<TARGET_FILE :${dep} >
147- "${binaryOutputDir} /$<TARGET_FILE_NAME :${dep} >"
148- )
140+ get_target_property (target_type ${dep} TYPE)
141+ if (NOT "${target_type} " STREQUAL "INTERFACE_LIBRARY" )
142+ add_custom_command (TARGET ${versionTarget} POST_BUILD
143+ WORKING_DIRECTORY "${modelOutputDir} "
144+ COMMAND ${CMAKE_COMMAND } -E echo "[generateFMU-${fmiVersion} ] Copying runtime of ${dep} to ${binaryOutputDir} "
145+ COMMAND ${CMAKE_COMMAND } -E make_directory "${binaryOutputDir} "
146+ # copy the target's runtime file (dll/so/dylib) into the binaries folder
147+ COMMAND ${CMAKE_COMMAND } -E copy_if_different
148+ $<TARGET_FILE :${dep} >
149+ "${binaryOutputDir} /$<TARGET_FILE_NAME :${dep} >"
150+ )
151+ endif ()
149152 endif ()
150153 endforeach ()
151154 endif ()
You can’t perform that action at this time.
0 commit comments