<div dir="ltr"><div>The CMakeExpandedImportedTargets module used only the deprecated IMPORTED_LINK_INTERFACE_LIBRARIES property to resolve transitive dependencies.</div><div>Since the current `install(EXPORT ...)` command generates target files that populate INTERFACE_LINK_LIBRARIES instead, the expand module was not working correctly with the imported libraries generated by `install(EXPORT ...)`.</div><div><br></div><div>I considered this a bugfix so I based the commit onto the release branch.</div><div><br></div><div>Please review and apply if it's ok.</div><div>Tamas</div><div><br></div><div><br></div><div>From f2df88ec4180595a3fcc4c6be9b2d38e46162cc3 Mon Sep 17 00:00:00 2001</div><div>From: Tamas Kenez <<a href="mailto:tamas.kenez@gmail.com">tamas.kenez@gmail.com</a>></div><div>Date: Wed, 15 Jul 2015 17:47:50 +0200</div><div>Subject: [PATCH] CMakeExpandImportedTargets: use INTERFACE_LINK_LIBRARIES if</div><div> non-empty</div><div><br></div><div>The deprecated IMPORTED_LINK_INTERFACE_LIBRARIES should be</div><div>overridden by INTERFACE_LINK_LIBRARIES if it's non-empty.</div><div><br></div><div>Unlike IMPORTED_LINK_INTERFACE_LIBRARIES, INTERFACE_LINK_LIBRARIES</div><div>usually contains config-related generator expressions which must</div><div>be resolved according to the selected configuration.</div><div>---</div><div> Modules/CMakeExpandImportedTargets.cmake | 22 +++++++++++++++++++++-</div><div> 1 file changed, 21 insertions(+), 1 deletion(-)</div><div><br></div><div>diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake</div><div>index 8ac3364..b110e51 100644</div><div>--- a/Modules/CMakeExpandImportedTargets.cmake</div><div>+++ b/Modules/CMakeExpandImportedTargets.cmake</div><div>@@ -102,7 +102,27 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )</div><div>             list(GET _importedConfigs ${_configIndexToUse} _importedConfigToUse)</div><div> </div><div>             get_target_property(_importedLocation "${_CURRENT_LIB}" IMPORTED_LOCATION_${_importedConfigToUse})</div><div>-            get_target_property(_linkInterfaceLibs "${_CURRENT_LIB}" IMPORTED_LINK_INTERFACE_LIBRARIES_${_importedConfigToUse} )</div><div>+            get_target_property(_linkInterfaceLibs "${_CURRENT_LIB}" INTERFACE_LINK_LIBRARIES)</div><div>+            if(_linkInterfaceLibs)</div><div>+               # resolve $<CONFIG:...> generator expressions</div><div>+               string(REGEX REPLACE "\\$<CONFIG:${_importedConfigToUse}>" "1"</div><div>+                  _linkInterfaceLibs "${_linkInterfaceLibs}")</div><div>+               string(REGEX REPLACE "\\$<CONFIG:[^>]*>" "0"</div><div>+                  _linkInterfaceLibs "${_linkInterfaceLibs}")</div><div>+               # resolve $<NOT:(0|1)></div><div>+               string(REGEX REPLACE "\\$<NOT:0>" "1"</div><div>+                  _linkInterfaceLibs "${_linkInterfaceLibs}")</div><div>+               string(REGEX REPLACE "\\$<NOT:1>" "0"</div><div>+                  _linkInterfaceLibs "${_linkInterfaceLibs}")</div><div>+               # resolve $<(0|1):...></div><div>+               # empty items will be ignored by `foreach` later</div><div>+               string(REGEX REPLACE "\\$<0:[^>]*>" ""</div><div>+                  _linkInterfaceLibs "${_linkInterfaceLibs}")</div><div>+               string(REGEX REPLACE "\\$<1:([^>]*)>" "\\1"</div><div>+                  _linkInterfaceLibs "${_linkInterfaceLibs}")</div><div>+            else()</div><div>+               get_target_property(_linkInterfaceLibs "${_CURRENT_LIB}" IMPORTED_LINK_INTERFACE_LIBRARIES_${_importedConfigToUse} )</div><div>+            endif()</div><div> </div><div>             list(APPEND _CCSR_NEW_REQ_LIBS  "${_importedLocation}")</div><div> #            message(STATUS "Appending lib ${_CURRENT_LIB} as ${_importedLocation}")</div><div>-- </div><div>1.9.4.msysgit.2</div><div> </div></div>