CMAKE_USE_SYSTEM_CURL is ON but a curl is not found

痞子三分冷 提交于 2021-02-10 13:26:32

问题


I was trying to install cmake with the system-curl, with ./bootstrap --system-curl, as seen here. Doing that, I got:

    -- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR) 
CMake Error at CMakeLists.txt:413 (message):
  CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!
Call Stack (most recent call first):
  CMakeLists.txt:682 (CMAKE_BUILD_UTILITIES)


-- Configuring incomplete, errors occurred!
See also "/root/temp/cmake-3.14.5/CMakeFiles/CMakeOutput.log".
See also "/root/temp/cmake-3.14.5/CMakeFiles/CMakeError.log".
---------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake

回答1:


For me running ./bootstrap --no-system-curl led to errors when running cmake on open-cv, because the https protocol could not be found. So I needed to get ./bootstrap --system-curl running.

The solution is to install curl dev dependencies. These are needed by cmake, not just curl.

I ran:

sudo apt-get install curl
sudo apt-get install libssl-dev libcurl4-openssl-dev



回答2:


Alternatively, you can also just use cmake-provided curl library by running ./bootstrap --no-system-curl instead.




回答3:


For the reference, I solved looking at this issue on Github. In particular, I downloaded the curl source code from https://curl.haxx.se/download.html and compiled curl with:

/CurlExtractFolder$ ./configure --with--ssl
/CurlExtractFolder$ make
/CurlExtractFolder$ sudo make install


来源:https://stackoverflow.com/questions/56941778/cmake-use-system-curl-is-on-but-a-curl-is-not-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!