-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake config: console_bridge_LIBRARIES should contain absolute paths. #52
Comments
Would you mind posting the text of the error you receive? It looks like you're correct that |
I don't get an error, but I have multiple versions of console_bridge available and |
rosbag_storage has |
Oh yes, sure. I patched that line to include the version number The setup is rather complicated and not fully working at the moment, thats why I left out most of the background story. I already have this issue fixed locally for me (ugly hack, so nothing worth a pull request). |
Understood, thanks for reporting the issue. If later you're willing, a pull request to fix the content of |
My solution to this looks like this: diff --git a/CMakeLists.txt b/CMakeLists.txt
index d51e954..514c63e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,7 +81,7 @@ set(PKG_LIBRARIES ${PROJECT_NAME})
set(cmake_conf_file "${PROJECT_NAME}-config.cmake")
configure_package_config_file("${cmake_conf_file}.in" "${CMAKE_BINARY_DIR}/${cmake_conf_file}"
INSTALL_DESTINATION ${CMAKE_CONFIG_INSTALL_DIR}
- PATH_VARS CMAKE_INSTALL_FULL_INCLUDEDIR
+ PATH_VARS CMAKE_INSTALL_FULL_INCLUDEDIR CMAKE_INSTALL_FULL_LIBDIR
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
set(cmake_conf_version_file "${PROJECT_NAME}-config-version.cmake")
diff --git a/console_bridge-config.cmake.in b/console_bridge-config.cmake.in
index dfaa547..e15b9ee 100644
--- a/console_bridge-config.cmake.in
+++ b/console_bridge-config.cmake.in
@@ -6,6 +6,7 @@ set(@PKG_NAME@_CONFIG_INCLUDED TRUE)
@PACKAGE_INIT@
set(@PKG_NAME@_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@")
+set(@PKG_NAME@_LIBRARY_DIRS "@PACKAGE_CMAKE_INSTALL_FULL_LIBDIR@")
include("${CMAKE_CURRENT_LIST_DIR}/@PKG_NAME@-targets.cmake")
-set(@PKG_NAME@_LIBRARIES @PKG_NAME@)
+set(@PKG_NAME@_LIBRARIES "@PACKAGE_CMAKE_INSTALL_FULL_LIBDIR@/lib@PKG_NAME@.so") I'm pretty sure this is not a nice solution, but I don't know how to do this properly in cmake. |
Even though |
I believe this was resolved by #60 |
console_bridge/console_bridge-config.cmake.in
Line 11 in 4a52e5d
I'm trying to cross-compile console_bridge with catkin_make_isolated. Compiling it works fine, but when other packages try to link against console_bridge they can't find the library as
console_bridge_LIBRARIES
is only set toconsole_bridge
.e.g. in rosbag_storage:
https://github.com/ros/ros_comm/blob/kinetic-devel/tools/rosbag_storage/CMakeLists.txt#L41
I'm no cmake expert (so correct me if I'm wrong), but according to the documentation this variable should contain absolute paths to the library:
https://cmake.org/cmake/help/v3.10/command/link_directories.html:
The text was updated successfully, but these errors were encountered: