jpbarrette/curlpp

CMake fails in Windows

kamal0808 opened this issue · 1 comments

OS
Windows 10 x64

I get the following error when running the makefile.

C:\Users\kamal\Downloads\curlpp-0.8.1\curlpp-0.8.1\build>cmake -G "Visual Studio 16 2019" ../
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042.
-- The C compiler identification is MSVC 19.29.30136.0
-- The CXX compiler identification is MSVC 19.29.30136.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- curlpp version=[0.8.1]
-- curlpp version num=[000801]
-- Looking for CURL
-- Could NOT find CURL (missing: CURL_INCLUDE_DIR)
CMake Error at C:/Program Files/CMake/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find CURL (missing: CURL_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.22/Modules/FindCURL.cmake:181 (find_package_handle_standard_args)
  CMakeLists.txt:65 (find_package)


-- Configuring incomplete, errors occurred!

I checked that the curl executable is stored in C:\Program Files\Git\mingw64\bin.
Additionally, I downloaded curl from https://curl.se/download.html.
I set the curl path in PATH system environment variable.

Now the new error in build is

-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042.
-- curlpp version=[0.8.1]
-- curlpp version num=[000801]
-- Looking for CURL
-- Could NOT find CURL (missing: CURL_LIBRARY) (found version "7.79.1")
CMake Error at C:/Program Files/CMake/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find CURL (missing: CURL_LIBRARY) (found version "7.79.1")
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.22/Modules/FindCURL.cmake:181 (find_package_handle_standard_args)
  CMakeLists.txt:60 (find_package)


-- Configuring incomplete, errors occurred!

So now I know that the CURL library has been found, since it says (found version "7.79.1"), it's just that it has the wrong version. I removed the 7.79.1 version's filepath from PATH , but the error still persists.

What am I doing wrong? Any help is appreciated.

[Update]
curl command in cmd works from everywhere.

>curl -V

curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
Release-Date: 2017-11-14, security patched: 2019-11-05
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL

curl executable is not needed. What you need is libcurl, try to download it from here.

Curlpp CMake needs 2 things from curl :

  • curl include directory
  • curl library