endif()
endmacro()
-# Convert the passed paths to libpath linker options and add them to CMAKE_REQUIRED_LINK_OPTIONS.
+# Convert the passed paths to libpath linker options and add them to CMAKE_REQUIRED_*.
macro(curl_required_libpaths _libpaths_arg)
- set(_libpaths "${_libpaths_arg}")
- foreach(_libpath IN LISTS _libpaths)
- list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "${CMAKE_LIBRARY_PATH_FLAG}${_libpath}")
- endforeach()
+ if(CMAKE_VERSION VERSION_LESS 3.31)
+ set(_libpaths "${_libpaths_arg}")
+ foreach(_libpath IN LISTS _libpaths)
+ list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "${CMAKE_LIBRARY_PATH_FLAG}${_libpath}")
+ endforeach()
+ else()
+ list(APPEND CMAKE_REQUIRED_LINK_DIRECTORIES "${_libpaths_arg}")
+ endif()
endmacro()