MantisBT - CMake
View Issue Details
0007263CMakeModulespublic2008-06-30 11:122016-06-10 14:30
F Wheeler 
Bill Hoffman 
normalfeaturealways
closedmoved 
CMake-2-6 
 
0007263: FindCURL - set required define and dependent library
I've made some improvements to FindCURL.cmake versus the CMake CVS revision 1.4. The comments in the file listed below should explain it all. Here are the two changes:

1. Set CURL_DEFINITIONS are required by the curl library. This I am very sure is the right thing to do. Might need additional extensions in the regep for Mac static libs. I'm not sure how how static libs are names on Macs.

2. Curl depends on wldap32 under Windows. I'm 85% sure this is the right thing to do. libcurl has ldap support by default and would thus need wldap32 under windows. If wldap32 is not available on absolutely every windows system out there then this part of my change might cause problems.

I may continue to make changes. Feel free to email for my latest version wheeler AT research.ge.com.

Here is the entire new file ...

# - Find curl
# Find the native CURL headers and libraries.
#
# CURL_INCLUDE_DIRS - where to find curl/curl.h, etc.
# CURL_LIBRARIES - List of libraries when using curl.
# CURL_DEFINITIONS - Defines required for programs using curl.
# CURL_FOUND - True if curl found.

# Look for the header file.
FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h)
MARK_AS_ADVANCED(CURL_INCLUDE_DIR)

# Look for the library.
FIND_LIBRARY(CURL_LIBRARY NAMES curl)
MARK_AS_ADVANCED(CURL_LIBRARY)

# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR)

IF(CURL_FOUND)
  SET(CURL_LIBRARIES ${CURL_LIBRARY})
  SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
ELSE(CURL_FOUND)
  SET(CURL_LIBRARIES)
  SET(CURL_INCLUDE_DIRS)
ENDIF(CURL_FOUND)

IF(CURL_FOUND)

  # Determine whether the CURL library is static/dynamic based on its
  # filename extension.
  SET( CURL_LIBCURL_IS_STATIC NO )
  IF( "${CURL_LIBRARY}" MATCHES "\\.(a|lib|LIB)$" )
    SET( CURL_LIBCURL_IS_STATIC YES )
  ENDIF( "${CURL_LIBRARY}" MATCHES "\\.(a|lib|LIB)$" )

  # CURL requires programs to define CURL_STATICLIB if and only if
  # the CURL library is static. Getting this wrong may result in
  # errors like: "unresolved external symbol __imp__curl_easy_perform"
  SET( CURL_DEFINITIONS "" )
  IF( CURL_LIBCURL_IS_STATIC )
    SET( CURL_DEFINITIONS "-DCURL_STATICLIB" )
  ENDIF( CURL_LIBCURL_IS_STATIC )

  # The CURL library typically depends on wldap32 under Windows.
  # (The library can also be built with out LDAP support.)
  IF( WIN32 )
    SET(CURL_LIBRARIES ${CURL_LIBRARIES} wldap32 )
  ENDIF( WIN32 )

ENDIF(CURL_FOUND)


No tags attached.
related to 0013563closed Brad King [PATCH] FindCURL: fails to find older MSVC prebuilts 
Issue History
2008-06-30 11:12F WheelerNew Issue
2008-08-19 17:18Bill HoffmanStatusnew => assigned
2008-08-19 17:18Bill HoffmanAssigned To => Bill Hoffman
2008-10-01 13:20Bill HoffmanNote Added: 0013652
2008-10-03 07:54F WheelerNote Added: 0013719
2012-10-01 13:25Brad KingRelationship addedrelated to 0013563
2016-06-10 14:27Kitware RobotNote Added: 0041435
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0013652)
Bill Hoffman   
2008-10-01 13:20   
Is this still valid? Would you be willing to be the FindCurl maintainer?
(0013719)
F Wheeler   
2008-10-03 07:54   
Yes, this is still valid. I am willing to be the FindCurl maintainer. I don't use curl much, but if we have no better options I'd be happy to deal with bugs/issues/questions related to FindCurl.

-Fred
(0041435)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

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.