gazebosim / gz-rendering

C++ library designed to provide an abstraction for different rendering engines. It offers unified APIs for creating 3D graphics applications.
https://gazebosim.org
Apache License 2.0
56 stars 51 forks source link

Fix configuration with GZ_ENABLE_RELOCATABLE_INSTALL=ON #1071

Closed traversaro closed 1 month ago

traversaro commented 1 month ago

🦟 Bug fix

Summary

When GZ_ENABLE_RELOCATABLE_INSTALL is ON, the project that uses gz_add_get_install_prefix_impl needs to call gz_find_package(DL REQUIRED) . For some reason, this was not added in https://github.com/gazebosim/gz-rendering/pull/804/files, but everything was working fine for some reason. However, I tried to ocmpile gz-rendering9 on conda-forge, and know the build is failing with:

-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
CMake Error at /home/conda/feedstock_root/build_artifacts/gz-rendering9_1727635675214/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/share/cmake/gz-cmake4/cmake4/GzRelocatableBinaries.cmake:97 (message):
  gz_add_get_install_prefix_impl called without DL_TARGET defined,

  please add gz_find_package(DL) if you want to use
  gz_add_get_install_prefix_impl.
Call Stack (most recent call first):
  src/CMakeLists.txt:18 (gz_add_get_install_prefix_impl)

-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/site-packages/conda_build/build.py", line 1785, in bundle_conda
    utils.check_call_env(
  File "/opt/conda/lib/python3.10/site-packages/conda_build/utils.py", line 404, in check_call_env
    return _func_defaulting_env_to_os_environ("call", *popenargs, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/conda_build/utils.py", line 380, in _func_defaulting_env_to_os_environ
    raise subprocess.CalledProcessError(proc.returncode, _args)
subprocess.CalledProcessError: Command '['/usr/bin/bash', '-e', '/home/conda/feedstock_root/build_artifacts/gz-rendering9_1727635675214/work/build_cxx.sh']' returned non-zero exit status 1.

See https://github.com/conda-forge/gz-rendering-feedstock/pull/30#issuecomment-2381481784 . I guess this PR should fix this problem.

Checklist

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.