View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015926CMakeCMakepublic2016-01-19 08:522016-06-10 14:21
ReporterLars Kühne 
Assigned ToNils Gladitz 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
Platformx86_64OSCentOSOS Version7
Product VersionCMake 3.4.1 
Target VersionFixed in Version 
Summary0015926: FindCURL.cmake exposed variables are empty
DescriptionThe FindCURL.cmake module exposes variables CURL_INCLUDE_DIRS and CURL_LIBRARIES, among others. These variables are empty, even though CURL_FOUND is true. Internally, the FindCURL.cmake script uses CURL_INCLUDE_DIR and CURL_LIBRARY variables. These are set correctly to the found locations on my system. Using these instead of the variables documented in the reference and at the beginning of the script works.
Steps To Reproducefind_package(CURL REQUIRED)

message(CURL_FOUND) # true on my system

message(${CURL_INCLUDE_DIRS}) # this fails
message(${CURL_LIBRARIES}) # this too

message(${CURL_INCLUDE_DIR}) # this works
message(${CURL_LIBRARY}) # this too
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0040256)
Nils Gladitz (developer)
2016-01-19 09:08

When I try your test case on my Ubuntu system I get the following output (CMake 3.4.1):

  CURL_FOUND
  /usr/include
  /usr/lib/x86_64-linux-gnu/libcurl.so
  /usr/include
  /usr/lib/x86_64-linux-gnu/libcurl.so

Your first message() call outputs the string "CURL_FOUND" not the content
of the CURL_FOUND variable; beyond that the output looks as expected.

I can't tell where it might be failing for you but perhaps the FindCURL.cmake relevant output from cmake in --trace mode would help narrow it down.
(0040257)
Lars Kühne (reporter)
2016-01-19 09:31

I should have written ${CURL_FOUND}. It was a typo, but its value is "true".

Shame on me: the problem is not in FindCURL.cmake, but more likely in this https://github.com/watchedit/CMakeModules/blob/master/FindJansson.cmake [^]
script I used in my project too. When executing this script BEFORE I call find_package(CURL), the mentioned variables are empty. When calling find_package(CURL) first, everything is set as expected. I'm not a CMake expert, so I don't understand why. Reversing the order of the calls in this case worked for me.

Thanks for your help, and sorry for the noise. Issue can be closed.
(0041286)
Kitware Robot (administrator)
2016-06-10 14:21

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2016-01-19 08:52 Lars Kühne New Issue
2016-01-19 09:08 Nils Gladitz Note Added: 0040256
2016-01-19 09:31 Lars Kühne Note Added: 0040257
2016-01-19 09:38 Nils Gladitz Status new => resolved
2016-01-19 09:38 Nils Gladitz Resolution open => no change required
2016-01-19 09:38 Nils Gladitz Assigned To => Nils Gladitz
2016-06-10 14:21 Kitware Robot Note Added: 0041286
2016-06-10 14:21 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team