You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zenoh-cpp cannot be compiled because the cmake file zenohcConfig.cmake throws an error when using CMake 3.16. The reason is that "zenohc::static" and "zenohhc::lib" are not globally visible. In CMake 3.18+ this problem is solved, but not in CMake 3.16 which is the default option in Ubuntu 20.04.
Why is this zenoh-cpp compilation error a zenoh-c problem? Because the file that causes it (zenohcConfig.cmake) is generated when compiling zenoh-c.
git clone https://github.com/eclipse-zenoh/zenoh-cpp.git && \
cd zenoh-cpp && mkdir -p build && cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX=/home/username/local
Error:
add_library cannot create ALIAS target"zenohc::static" because target"__zenohc_static" is imported but not globally visible.
Call Stack (most recent call first):
CMakeLists.txt:42 (find_package)
CMake Error at /home/username/local/lib/cmake/zenohc/zenohcConfig.cmake:46 (add_library):
add_library cannot create ALIAS target"zenohc::lib" because target"__zenohc_lib" is imported but not globally visible.
Call Stack (most recent call first):
CMakeLists.txt:42 (find_package)
System info
Ubuntu 20.04
CMake 3.16.3
The text was updated successfully, but these errors were encountered:
It's a problem with CMake 3.16. It can be solved by editing PackageConfig.cmake.in.
Lines 17 and 21 have the functions add_library(__zenohc_static STATIC IMPORTED) and add_library(__zenohc_lib STATIC IMPORTED). Adding GLOBAL to those functions solves the problem.
I will try to change the generation of those files in zenoh-c and upload them as a pull request.
Describe the bug
Zenoh-cpp cannot be compiled because the cmake file
zenohcConfig.cmake
throws an error when using CMake 3.16. The reason is that "zenohc::static" and "zenohhc::lib" are not globally visible. In CMake 3.18+ this problem is solved, but not in CMake 3.16 which is the default option in Ubuntu 20.04.Why is this zenoh-cpp compilation error a zenoh-c problem? Because the file that causes it (zenohcConfig.cmake) is generated when compiling zenoh-c.
More details can be found in eclipse-zenoh/zenoh-cpp#7
To reproduce
System info
The text was updated successfully, but these errors were encountered: