Skip to content

Commit

Permalink
Add "lib" to the Windows curl search path. (#96)
Browse files Browse the repository at this point in the history
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 <prefix>/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.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette authored May 3, 2024
1 parent 3b46e58 commit 1839d58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcurl_vendor/libcurl_vendor-extras.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ find_package(CURL QUIET)
if(NOT CURL_FOUND)
if(WIN32)
# Force cmake to find the curl-config file in our local build.
set(curl_DIR "${@PROJECT_NAME@_DIR}/../../../opt/libcurl_vendor/CMake")
set(curl_DIR "${@PROJECT_NAME@_DIR}/../../../opt/libcurl_vendor/lib/CMake")
message(STATUS "Setting curl_DIR to: '${curl_DIR}'")

find_package(curl REQUIRED PATHS "${curl_DIR}" NO_MODULE NO_DEFAULT_PATH)
Expand Down

0 comments on commit 1839d58

Please sign in to comment.