forked from trdtnguyen/mysql-plnvm
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcurl.cmake
46 lines (45 loc) · 1.71 KB
/
curl.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MACRO(MYSQL_CHECK_CURL)
IF(NOT WIN32)
IF(WITH_CURL STREQUAL "system")
# FindCURL.cmake will set
# CURL_INCLUDE_DIRS - where to find curl/curl.h, etc.
# CURL_LIBRARIES - List of libraries when using curl.
# CURL_FOUND - True if curl found.
# CURL_VERSION_STRING - the version of curl found (since CMake 2.8.8)
FIND_PACKAGE(CURL)
IF(CURL_FOUND)
SET(CURL_LIBRARY ${CURL_LIBRARIES} CACHE PATH "Curl library")
ENDIF()
MESSAGE(STATUS "CURL_LIBRARY = ${CURL_LIBRARY}")
ELSEIF(WITH_CURL)
LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
FIND_LIBRARY(CURL_LIBRARY
NAMES curl
PATHS ${WITH_CURL}
NO_DEFAULT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
MESSAGE(STATUS "CURL_LIBRARY = ${CURL_LIBRARY}")
ELSE()
MESSAGE(STATUS
"You need to set WITH_CURL. This"
" variable needs to point to curl library.")
ENDIF()
ENDIF()
ENDMACRO()