Blame view

cmake/modules/FindcURL.cmake 1.01 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
# - Try to find the libcurl libraries
# Once done this will define
#
# cURL_FOUND - flag that indicates libcurl is installed
# cURL_INCLUDE_DIR - the libcurl include directory
# cURL_LIBRARIES - the libcurl library directory

ab9d7e65   Benjamin Renard   Fix libraries loc...
8
9
FIND_PATH(cURL_INCLUDE_DIR curl.h PATHS ${USERLOCAL_ROOT}/include/curl /usr/include/curl NO_DEFAULT_PATH)
FIND_LIBRARY(cURL_LIBRARIES NAMES curl PATHS ${USERLOCAL_ROOT}/lib /usr/lib NO_DEFAULT_PATH)
fbe3c2bb   Benjamin Renard   First commit
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

# set FOUND flag
IF(cURL_INCLUDE_DIR AND cURL_LIBRARIES)
	SET(cURL_FOUND 1)
	#remove last /curl string
	STRING(REGEX REPLACE "/curl" "" cURL_INCLUDE_DIR_SUP_LEVEL ${cURL_INCLUDE_DIR})
	SET (cURL_INCLUDE_DIR ${cURL_INCLUDE_DIR_SUP_LEVEL} ${cURL_INCLUDE_DIR} )
	if(NOT cURL_FIND_QUIETLY)
		message(STATUS "Found cURL: ${cURL_LIBRARIES}")
	endif(NOT cURL_FIND_QUIETLY)
ELSE(cURL_INCLUDE_DIR AND cURL_LIBRARIES)
	SET(cURL_FOUND 0 CACHE BOOL "Not found cURL library")
	message(STATUS "NOT Found cURL, disabling it")
ENDIF(cURL_INCLUDE_DIR AND cURL_LIBRARIES)

MARK_AS_ADVANCED(cURL_INCLUDE_DIR cURL_LIBRARIES)