gazebosim / gz-cmake

A set of CMake modules that are used by the C++-based Gazebo projects.
https://gazebosim.org/libs/cmake
Apache License 2.0
27 stars 31 forks source link

Change FindGzAssimp to use find_package #291

Closed luca-della-vedova closed 2 years ago

luca-della-vedova commented 2 years ago

🦟 Bug fix

Summary

The previous implementation of FindGzAssimp had issues on Windows, specifically on Windows it seems that it is necessary to use find_package instead of pkg-config, i.e. vcpkg prints the following:

The package assimp provides CMake targets:

    find_package(assimp CONFIG REQUIRED)
    target_link_libraries(main PRIVATE assimp::assimp)

but using find_package sets global variables that break downstream users that reimplement their own version of FindAssimp such as dartsim.

For these reasons the implementation now uses find_package but clears the cache from the assimp variables and only uses the GzAssimp namespaced variables. Downstream behavior is now unchanged.

Tested with the gz-common PR to make sure CI is :heavy_check_mark:

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.

chapulina commented 2 years ago

Merging without the Windows CI to clear up the build farm. Windows CI on this repo shouldn't be catching any issues with this PR anyway.

chapulina commented 2 years ago

Nightlies: