aboutsummaryrefslogtreecommitdiff
path: root/CMake/curl-config.cmake
diff options
context:
space:
mode:
authorRuslan Baratov <ruslan_baratov@yahoo.com>2018-07-17 09:36:59 +0300
committerDaniel Stenberg <daniel@haxx.se>2018-07-17 11:54:07 +0200
commitd1207c07d0cc3c7870e50865052bb59850917ec9 (patch)
tree368eff237870038b10ba601eaddcf4c89b97ad03 /CMake/curl-config.cmake
parenta82372e0fb3aa3ce9ab27687c4d4a738a6ec9064 (diff)
CMake: Update scripts to use consistent style
Closes #2727 Reviewed-by: Sergei Nikulov
Diffstat (limited to 'CMake/curl-config.cmake')
-rw-r--r--CMake/curl-config.cmake80
1 files changed, 40 insertions, 40 deletions
diff --git a/CMake/curl-config.cmake b/CMake/curl-config.cmake
index 119332cdd..10045c6b7 100644
--- a/CMake/curl-config.cmake
+++ b/CMake/curl-config.cmake
@@ -2,58 +2,58 @@
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
if(NOT CURL_FIND_COMPONENTS)
- set(CURL_FIND_COMPONENTS curl libcurl)
- if(CURL_FIND_REQUIRED)
- set(CURL_FIND_REQUIRED_curl TRUE)
- set(CURL_FIND_REQUIRED_libcurl TRUE)
- endif()
+ set(CURL_FIND_COMPONENTS curl libcurl)
+ if(CURL_FIND_REQUIRED)
+ set(CURL_FIND_REQUIRED_curl TRUE)
+ set(CURL_FIND_REQUIRED_libcurl TRUE)
+ endif()
endif()
set(_curl_missing_components)
foreach(_comp ${CURL_FIND_COMPONENTS})
- if(EXISTS "${_DIR}/${_comp}-target.cmake")
- include("${_DIR}/${_comp}-target.cmake")
- set(CURL_${_comp}_FOUND TRUE)
- else()
- set(CURL_${_comp}_FOUND FALSE)
- if(CURL_FIND_REQUIRED_${_comp})
- set(CURL_FOUND FALSE)
- list(APPEND _curl_missing_components ${_comp})
- endif()
+ if(EXISTS "${_DIR}/${_comp}-target.cmake")
+ include("${_DIR}/${_comp}-target.cmake")
+ set(CURL_${_comp}_FOUND TRUE)
+ else()
+ set(CURL_${_comp}_FOUND FALSE)
+ if(CURL_FIND_REQUIRED_${_comp})
+ set(CURL_FOUND FALSE)
+ list(APPEND _curl_missing_components ${_comp})
endif()
+ endif()
endforeach()
if(_curl_missing_components)
- set(CURL_NOT_FOUND_MESSAGE "Following required components not found: " ${_curl_missing_components})
+ set(CURL_NOT_FOUND_MESSAGE "Following required components not found: " ${_curl_missing_components})
else()
- if(TARGET CURL::libcurl)
- string(TOUPPER "${CMAKE_BUILD_TYPE}" _curl_current_config)
- if(NOT _curl_current_config)
- set(_curl_current_config "NOCONFIG")
- endif()
- get_target_property(_curl_configurations CURL::libcurl IMPORTED_CONFIGURATIONS)
+ if(TARGET CURL::libcurl)
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" _curl_current_config)
+ if(NOT _curl_current_config)
+ set(_curl_current_config "NOCONFIG")
+ endif()
+ get_target_property(_curl_configurations CURL::libcurl IMPORTED_CONFIGURATIONS)
+ list(FIND _curl_configurations "${_curl_current_config}" _i)
+ if(_i LESS 0)
+ set(_curl_config "RELEASE")
+ list(FIND _curl_configurations "${_curl_current_config}" _i)
+ if(_i LESS 0)
+ set(_curl_config "NOCONFIG")
list(FIND _curl_configurations "${_curl_current_config}" _i)
- if(_i LESS 0)
- set(_curl_config "RELEASE")
- list(FIND _curl_configurations "${_curl_current_config}" _i)
- if(_i LESS 0)
- set(_curl_config "NOCONFIG")
- list(FIND _curl_configurations "${_curl_current_config}" _i)
- endif()
- endif()
-
- if(_i LESS 0)
- set(_curl_current_config "") # let CMake pick config at random
- else()
- set(_curl_current_config "_${_curl_current_config}")
- endif()
+ endif()
+ endif()
- get_target_property(CURL_INCLUDE_DIRS CURL::libcurl INTERFACE_INCLUDE_DIRECTORIES)
- get_target_property(CURL_LIBRARIES CURL::libcurl "LOCATION${_curl_current_config}")
- set(_curl_current_config)
- set(_curl_configurations)
- set(_i)
+ if(_i LESS 0)
+ set(_curl_current_config "") # let CMake pick config at random
+ else()
+ set(_curl_current_config "_${_curl_current_config}")
endif()
+
+ get_target_property(CURL_INCLUDE_DIRS CURL::libcurl INTERFACE_INCLUDE_DIRECTORIES)
+ get_target_property(CURL_LIBRARIES CURL::libcurl "LOCATION${_curl_current_config}")
+ set(_curl_current_config)
+ set(_curl_configurations)
+ set(_i)
+ endif()
endif()
unset(_curl_missing_components)