Skip to content

Commit 2b30e39

Browse files
author
Tor Didriksen
committed
Bug#35095010 CURL UPDATE TO AT LEAST 7.87.0 / 7.88.0 [noclose]
Patch for 5.7 There is only one CURL client in 5.7, and it is not affected by the upgrade. Verified by backporting CURL cmake code from trunk, and setting proper include paths for CURL headers. Change-Id: I888507e72c297c63f77ce9d90df79b08b6d38d59
1 parent 79f8bff commit 2b30e39

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

cmake/curl.cmake

+22-1
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,37 @@ MACRO(MYSQL_CHECK_CURL)
3434
ENDIF()
3535
MESSAGE(STATUS "CURL_LIBRARY = ${CURL_LIBRARY}")
3636
ELSEIF(WITH_CURL)
37+
# Explicit path given. Normalize path for the following regex replace.
38+
FILE(TO_CMAKE_PATH "${WITH_CURL}" WITH_CURL)
39+
# Pushbuild adds /lib to the CURL path
40+
STRING(REGEX REPLACE "/lib$" "" WITH_CURL "${WITH_CURL}")
41+
3742
LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
3843
FIND_LIBRARY(CURL_LIBRARY
3944
NAMES curl
40-
PATHS ${WITH_CURL}
45+
PATHS ${WITH_CURL} ${WITH_CURL}/lib
4146
NO_DEFAULT_PATH
4247
NO_CMAKE_ENVIRONMENT_PATH
4348
NO_SYSTEM_ENVIRONMENT_PATH
4449
)
4550
LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
51+
IF(NOT CURL_LIBRARY)
52+
MESSAGE(FATAL_ERROR "CURL library not found under '${WITH_CURL}'")
53+
ENDIF()
54+
55+
FIND_PATH(CURL_INCLUDE_DIR
56+
NAMES curl/curl.h
57+
PATHS ${WITH_CURL} ${WITH_CURL}/include
58+
NO_DEFAULT_PATH
59+
NO_CMAKE_ENVIRONMENT_PATH
60+
NO_SYSTEM_ENVIRONMENT_PATH
61+
)
62+
IF(NOT CURL_INCLUDE_DIR)
63+
MESSAGE(FATAL_ERROR "CURL include files not found under '${WITH_CURL}'")
64+
ENDIF()
65+
4666
MESSAGE(STATUS "CURL_LIBRARY = ${CURL_LIBRARY}")
67+
MESSAGE(STATUS "CURL_INCLUDE_DIR = ${CURL_INCLUDE_DIR}")
4768
ELSE()
4869
MESSAGE(STATUS
4970
"You need to set WITH_CURL. This"

0 commit comments

Comments
 (0)