I did this
I built libcurl like this:
cmake .. \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_LIBCURL_DOCS=OFF \
-D CMAKE_POSITION_INDEPENDENT_CODE=ON \
-D CURL_USE_OPENSSL=ON \
-D OPENSSL_INCLUDE_DIR="{includes}" \
-D OPENSSL_LIBRARIES="{libs}" \
-D OPENSSL_CRYPTO_LIBRARY="{libs}/libcrypto.a" \
-D OPENSSL_SSL_LIBRARY="{libs}/libssl.a" \
-D ZLIB_INCLUDE_DIR="{includes}" \
-D ZLIB_LIBRARY_RELEASE="{libs}/libz.a" \
-D LIBSSH2_INCLUDE_DIR="{includes}" \
-D LIBSSH2_LIBRARY="{libs}/libssh2.a" \
-D USE_NGHTTP2=ON \
-D NGHTTP2_INCLUDE_DIR="{includes}" \
-D NGHTTP2_LIBRARY="{libs}/libnghttp2.a" \
-D CMAKE_INSTALL_PREFIX="{install}" \
-D BUILD_SHARED_LIBS=OFF \
-D CMAKE_INSTALL_LIBDIR=lib \
-D USE_LIBIDN2=OFF \
-D CURL_USE_LIBPSL=OFF -D CURL_BROTLI=OFF -D CURL_ZSTD=OFF \
-D BUILD_CURL_EXE=OFF
Please excuse the weird {libs} and {includes} variables. It's from my script. But you get the idea. Insert the prefix path for where I'm staging binaries.
I tried to build my software, allowing CMake's find_package(CURL) to use the CURLConfig.cmake file to gather dependencies.
I observe the following error from the find_package(CURL) call:
CMake Error at /Users/val/.mussels/install/host-static/lib/cmake/CURL/CURLConfig.cmake:190 (get_target_property):
get_target_property() called with non-existent target "CURL::libssh2".
Call Stack (most recent call first):
CMakeLists.txt:550 (find_package)
CMake Error at /Users/val/.mussels/install/host-static/lib/cmake/CURL/CURLConfig.cmake:190 (get_target_property):
get_target_property() called with non-existent target "CURL::nghttp2".
Call Stack (most recent call first):
CMakeLists.txt:550 (find_package)
I tried adding these arguments, but it didn't help, because finding the static libs isn't the issue. Some CMake code is trying to use CURL::libssh2 and CURL::nghttp2 which aren't defined because they're statically linked into CURL::libcurl.
I expected the following
The same build worked okay when using Curl 8.17.0.
curl/libcurl version
curl 8.18.0
operating system
Darwin VALSNYDE-M-X7VX 25.3.0 Darwin Kernel Version 25.3.0: Wed Jan 28 20:48:41 PST 2026; root:xnu-12377.81.4~5/RELEASE_ARM64_T6041 arm64
Linux DESKTOP-N3L21K2 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Strangely, I only observed the issue with libssh2 on Ubuntu, but I see it with both libssh2 and libnghttp2 on macOS.
I did this
I built libcurl like this:
cmake .. \ -D CMAKE_BUILD_TYPE=Release \ -D BUILD_LIBCURL_DOCS=OFF \ -D CMAKE_POSITION_INDEPENDENT_CODE=ON \ -D CURL_USE_OPENSSL=ON \ -D OPENSSL_INCLUDE_DIR="{includes}" \ -D OPENSSL_LIBRARIES="{libs}" \ -D OPENSSL_CRYPTO_LIBRARY="{libs}/libcrypto.a" \ -D OPENSSL_SSL_LIBRARY="{libs}/libssl.a" \ -D ZLIB_INCLUDE_DIR="{includes}" \ -D ZLIB_LIBRARY_RELEASE="{libs}/libz.a" \ -D LIBSSH2_INCLUDE_DIR="{includes}" \ -D LIBSSH2_LIBRARY="{libs}/libssh2.a" \ -D USE_NGHTTP2=ON \ -D NGHTTP2_INCLUDE_DIR="{includes}" \ -D NGHTTP2_LIBRARY="{libs}/libnghttp2.a" \ -D CMAKE_INSTALL_PREFIX="{install}" \ -D BUILD_SHARED_LIBS=OFF \ -D CMAKE_INSTALL_LIBDIR=lib \ -D USE_LIBIDN2=OFF \ -D CURL_USE_LIBPSL=OFF -D CURL_BROTLI=OFF -D CURL_ZSTD=OFF \ -D BUILD_CURL_EXE=OFFPlease excuse the weird
{libs}and{includes}variables. It's from my script. But you get the idea. Insert the prefix path for where I'm staging binaries.I tried to build my software, allowing CMake's
find_package(CURL)to use the CURLConfig.cmake file to gather dependencies.I observe the following error from the
find_package(CURL)call:I tried adding these arguments, but it didn't help, because finding the static libs isn't the issue. Some CMake code is trying to use
CURL::libssh2andCURL::nghttp2which aren't defined because they're statically linked intoCURL::libcurl.I expected the following
The same build worked okay when using Curl 8.17.0.
curl/libcurl version
curl 8.18.0
operating system
Darwin VALSNYDE-M-X7VX 25.3.0 Darwin Kernel Version 25.3.0: Wed Jan 28 20:48:41 PST 2026; root:xnu-12377.81.4~5/RELEASE_ARM64_T6041 arm64
Linux DESKTOP-N3L21K2 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Strangely, I only observed the issue with libssh2 on Ubuntu, but I see it with both libssh2 and libnghttp2 on macOS.