@@ -136,15 +136,18 @@ function(generateFMU modelIdentifier)
136136
137137 foreach (dep IN LISTS FMU_LINK_TARGETS)
138138 if (TARGET ${dep} )
139- add_custom_command (TARGET ${versionTarget} POST_BUILD
140- WORKING_DIRECTORY "${modelOutputDir} "
141- COMMAND ${CMAKE_COMMAND} -E echo "[generateFMU-${fmiVersion} ] Copying runtime of ${dep} to ${binaryOutputDir} "
142- COMMAND ${CMAKE_COMMAND} -E make_directory "${binaryOutputDir} "
143- # copy the target's runtime file (dll/so/dylib) into the binaries folder
144- COMMAND ${CMAKE_COMMAND} -E copy_if_different
145- $<TARGET_FILE :${dep} >
146- "${binaryOutputDir} /$<TARGET_FILE_NAME :${dep} >"
147- )
139+ get_target_property (target_type ${dep} TYPE )
140+ if (NOT "${target_type} " STREQUAL "INTERFACE_LIBRARY" )
141+ add_custom_command (TARGET ${versionTarget} POST_BUILD
142+ WORKING_DIRECTORY "${modelOutputDir} "
143+ COMMAND ${CMAKE_COMMAND} -E echo "[generateFMU-${fmiVersion} ] Copying runtime of ${dep} to ${binaryOutputDir} "
144+ COMMAND ${CMAKE_COMMAND} -E make_directory "${binaryOutputDir} "
145+ # copy the target's runtime file (dll/so/dylib) into the binaries folder
146+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
147+ $<TARGET_FILE :${dep} >
148+ "${binaryOutputDir} /$<TARGET_FILE_NAME :${dep} >"
149+ )
150+ endif ()
148151 endif ()
149152 endforeach ()
150153 endif ()
@@ -204,17 +207,17 @@ function(generateFMU modelIdentifier)
204207
205208 #write buildDescription.xml
206209 file (WRITE "${modelOutputDir} /sources/buildDescription.xml"
207- "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n "
208- "<fmiBuildDescription fmiVersion=\" 3.0\" >\n "
209- "\t <BuildConfiguration modelIdentifier=\" ${FMU4CPP_MODEL_IDENTIFIER} \" >\n "
210- "\t\t <SourceFileSet language=\" C++17\" compilerOptions= \" cxx_std_17 \" >\n "
211- ${SOURCE_SET}
212- "\t\t\t <PreprocessorDefinition name=\" FMI3\" />\n "
213- "\t\t\t <IncludeDirectory name=\" include/\" />\n "
214- "\t\t </SourceFileSet>\n "
215- "\t </BuildConfiguration>\n "
216- "</fmiBuildDescription>"
217- )
210+ "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n "
211+ "<fmiBuildDescription fmiVersion=\" 3.0\" >\n "
212+ "\t <BuildConfiguration modelIdentifier=\" ${FMU4CPP_MODEL_IDENTIFIER} \" >\n "
213+ "\t\t <SourceFileSet language=\" C++17\" >\n "
214+ ${SOURCE_SET}
215+ "\t\t\t <PreprocessorDefinition name=\" FMI3\" />\n "
216+ "\t\t\t <IncludeDirectory name=\" include/\" />\n "
217+ "\t\t </SourceFileSet>\n "
218+ "\t </BuildConfiguration>\n "
219+ "</fmiBuildDescription>"
220+ )
218221 endif ()
219222
220223 # Generate modelDescription.xml
0 commit comments