ros / resource_retriever

Package used to retrieve resources of different kinds, e.g. http://, file://, the ROS specific package://, etc.
8 stars 42 forks source link

Add "lib" to the Windows curl search path. #96

Closed clalancette closed 4 months ago

clalancette commented 4 months ago

In CMake 3.3, a commit made it so that the find_package module in CMake had a compatibility mode where it would automatically search for packages in a /lib subdirectory. In CMake 3.6, this compatibility mode was reverted for all platforms except Windows.

That means that since CMake 3.3, we haven't actually been using the path as specified in curl_DIR, but we have instead been inadvertently relying on that fallback behavior.

In CMake 3.28, that compatibilty mode was also removed for Windows, meaning that we are now failing to find_package(curl) in downstream packages (like resource_retriever).

Fix this by adding in the "lib" directory that always should have been there. I'll note that this only affects our Windows builds, because this code is in a if(WIN32) block.


The commit to CMake that caused this is https://github.com/Kitware/CMake/commit/0a81110b842fd7b00cdacc55c270458ddaa2eb73

I'll note that this one is kind of hard to test; just running CI on this won't show us succeeding before and after. I will say that in local testing, where I've upgraded my CMake to 3.29.2 on Windows, this fixes the issue for me. And of course I'll run CI on it just to make sure there are no ill effects on earlier CMake versions.

clalancette commented 4 months ago

By the way: huge thanks to @azeey for realizing what the actual problem here is; I'm just making the pull requests.

clalancette commented 4 months ago

CI:

clalancette commented 4 months ago

@Mergifyio backport jazzy iron humble

mergify[bot] commented 4 months ago

backport jazzy iron humble

✅ Backports have been created

* [#97 Add "lib" to the Windows curl search path. (backport #96)](https://github.com/ros/resource_retriever/pull/97) has been created for branch `jazzy` * [#98 Add "lib" to the Windows curl search path. (backport #96)](https://github.com/ros/resource_retriever/pull/98) has been created for branch `iron` * [#99 Add "lib" to the Windows curl search path. (backport #96)](https://github.com/ros/resource_retriever/pull/99) has been created for branch `humble`