Skip to content

Commit 3217528

Browse files
author
Anthony Mallet
committed
[path/py-hpp-corbaserver] Reference full path of libs in exported targets
* patch-aa: use the pkg-config <prefix>_LINK_LIBRARIES as an argument to target_link_libraries() instead of fiddling with <prefix>_LDFLAGS. This way, the exported cmake targets contain the full path to dependendant libraries instead of -L/-l flags. For some reason, the -L flags in INTERFACE_LINK_LIBRARIES is swallowed by cmake when the imported target is used. This is also more robust wrt. the linker flags ordering. This is an attempt to address issue #431 and linking with robotpkg omniORB when a system omniORB is also present. Bump PKGREVISION.
1 parent 882a177 commit 3217528

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

path/py-hpp-corbaserver/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Created: Anthony Mallet on Mon, 27 Aug 2007
33
#
44

5+
PKGREVISION= 1
56
HPP_PACKAGE= hpp-corbaserver
67
HPP_COMMENT= Corba server for Humanoid Path Planner
78

path/py-hpp-corbaserver/distinfo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
SHA1 (hpp-corbaserver-5.2.0.tar.gz) = efdcef13678e26d4de330838f827de04907d3a46
22
RMD160 (hpp-corbaserver-5.2.0.tar.gz) = 88ea0fd28b658a9eee750b891376ef90d1014b8e
33
Size (hpp-corbaserver-5.2.0.tar.gz) = 1446613 bytes
4+
SHA1 (patch-aa) = 8178b68b4c135e375368b21c72c4a38d8f99bd05
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Replace LINK_FLAG target property set from <prefix>_LDFLAGS by a proper
2+
target_link_libraries() using <prefix>_LINK_LIBRARIES for pkg-config
3+
dependencies. Otherwise, the full path of the linked library may not be
4+
preserved (-L linker flag in INTERFACE_LINK_LIBRARIES mysteriously disappear when
5+
using imported targets). Using LDFLAGS is also depend on the linker path order,
6+
so this is not robust anyway.
7+
8+
Still append <prefix>_LDFLAGS_OTHER to LINK_FLAGS, as this may contain e.g. a
9+
required linker rpath.
10+
11+
--- cmake/pkg-config.cmake~ 2024-10-08 00:19:41.000000000 +0200
12+
+++ cmake/pkg-config.cmake 2024-11-08 17:14:01.580195312 +0100
13+
@@ -992,13 +992,12 @@
14+
endif()
15+
16+
# Transform semi-colon seperated list in to space separated list.
17+
- foreach(FLAG ${${PREFIX}_LDFLAGS})
18+
+ foreach(FLAG ${${PREFIX}_LDFLAGS_OTHER})
19+
set(LDFLAGS "${LDFLAGS} ${FLAG}")
20+
endforeach()
21+
22+
# Update the flags.
23+
set_target_properties(${TARGET} PROPERTIES LINK_FLAGS${CONFIG} "${LDFLAGS}")
24+
- _filter_link_flags(${TARGET} ${IS_GENERAL} ${IS_DEBUG} "${${PREFIX}_LDFLAGS}")
25+
_filter_link_flags(${TARGET} ${IS_GENERAL} ${IS_DEBUG}
26+
"${${PREFIX}_LDFLAGS_OTHER}")
27+
endmacro(
28+
@@ -1046,12 +1046,7 @@
29+
endif()
30+
endif()
31+
32+
- # Include/libraries paths seems to be filtered on Linux, add paths again.
33+
- link_directories(${${PREFIX}_LIBRARY_DIRS})
34+
- if(DEFINED ${PREFIX}_DEBUG_FOUND)
35+
- link_directories(${${PREFIX}_DEBUG_LIBRARY_DIRS})
36+
- endif()
37+
-
38+
+ target_link_libraries(${TARGET} ${PUBLIC_KEYWORD} ${${PREFIX}_LINK_LIBRARIES})
39+
endmacro(PKG_CONFIG_USE_LLINK_DEPENDENCY)
40+
41+
macro(BUILD_PREFIX_FOR_PKG DEPENDENCY PREFIX)

0 commit comments

Comments
 (0)