Skip to content

Commit

Permalink
check both IMPORTED_IMPLIB_ and IMPORTED_LOCATION_ in catkin_librarie…
Browse files Browse the repository at this point in the history
…s.cmake (#980)

* Check both IMPORTED_IMPLIB_ and IMPORTED_LOCATION_

Check both locations (one for DLL imported and the other for static lib) for Windows. Otherwise, for the package exporting static lib, the lib path won't be published corrected to downstream, for example, orocos_kdl won't be exported from tf2_kdl.

* Fix wrong logic to test xyzLIB-NOTFOUND.

* separate Windows porting change from Linux logic (#35)
  • Loading branch information
kejxu authored and dirk-thomas committed Jan 26, 2019
1 parent 98f97ff commit 6438f99
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmake/catkin_libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ function(catkin_replace_imported_library_targets VAR)
get_target_property(${lib}_imported_configurations ${lib} IMPORTED_CONFIGURATIONS)
foreach(cfg ${${lib}_imported_configurations})
if(WIN32)
# check both locations (imported dll and static lib) on Windows
# otherwise, for packages exporting static lib, the lib path won't be published correctly to downstream
get_target_property(${lib}_imported_location_${cfg} ${lib} IMPORTED_IMPLIB_${cfg})
if(NOT ${lib}_imported_location_${cfg})
get_target_property(${lib}_imported_location_${cfg} ${lib} IMPORTED_LOCATION_${cfg})
endif()
else()
get_target_property(${lib}_imported_location_${cfg} ${lib} IMPORTED_LOCATION_${cfg})
endif()
Expand Down

0 comments on commit 6438f99

Please sign in to comment.