mirror of
https://github.com/curl/curl.git
synced 2024-12-21 06:50:10 +08:00
cmake/FindGSS: bring closer to other Find modules
- add pkg-config-specific 'Found' message to the Find module. - update non-pkg-config 'Found' message to show the flavour instead of the library name. (= the first value listed after `REQUIRED_VARS`) - delete extra 'Found' message from `CMakeLists.txt`. - rename internal result variables to match with default pkg-config names, in preparation of introducing them in other Find modules: - `GSS_LINK_DIRECTORIES` -> `GSS_LIBRARY_DIRS` - `GSS_LINKER_FLAGS` -> `GSS_LDFLAGS` - `GSS_COMPILER_FLAGS` -> `GSS_CFLAGS` Ref: #14652 Closes #14651
This commit is contained in:
parent
df15d9ff26
commit
4f09967a3c
@ -25,19 +25,19 @@
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# GSS_ROOT_DIR Set this variable to the root installation of GSS
|
||||
# GSS_ROOT_DIR Set this variable to the root installation of GSS
|
||||
#
|
||||
# Result variables:
|
||||
#
|
||||
# GSS_FOUND System has the Heimdal library
|
||||
# GSS_FLAVOUR "MIT" or "Heimdal" if anything found
|
||||
# GSS_INCLUDE_DIRS The GSS include directories
|
||||
# GSS_LIBRARIES The GSS library names
|
||||
# GSS_LINK_DIRECTORIES Directories to add to linker search path
|
||||
# GSS_LINKER_FLAGS Additional linker flags
|
||||
# GSS_COMPILER_FLAGS Additional compiler flags
|
||||
# GSS_VERSION This is set to version advertised by pkg-config or read from manifest.
|
||||
# In case the library is found but no version info available it is set to "unknown"
|
||||
# GSS_FOUND System has the Heimdal library
|
||||
# GSS_FLAVOUR "MIT" or "Heimdal" if anything found
|
||||
# GSS_INCLUDE_DIRS The GSS include directories
|
||||
# GSS_LIBRARIES The GSS library names
|
||||
# GSS_LIBRARY_DIRS The GSS library directories
|
||||
# GSS_LDFLAGS Required linker flags
|
||||
# GSS_CFLAGS Required compiler flags
|
||||
# GSS_VERSION This is set to version advertised by pkg-config or read from manifest.
|
||||
# In case the library is found but no version info available it is set to "unknown"
|
||||
|
||||
set(_mit_modname "mit-krb5-gssapi")
|
||||
set(_heimdal_modname "heimdal-gssapi")
|
||||
@ -258,13 +258,14 @@ else()
|
||||
set(_GSS_VERSION ${_GSS_${_heimdal_modname}_VERSION})
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "Found GSS/${GSS_FLAVOUR} (via pkg-config): ${_GSS_INCLUDE_DIRS} (found version \"${_GSS_VERSION}\")")
|
||||
endif()
|
||||
|
||||
set(GSS_INCLUDE_DIRS ${_GSS_INCLUDE_DIRS})
|
||||
set(GSS_LIBRARIES ${_GSS_LIBRARIES})
|
||||
set(GSS_LINK_DIRECTORIES ${_GSS_LIBRARY_DIRS})
|
||||
set(GSS_LINKER_FLAGS ${_GSS_LDFLAGS})
|
||||
set(GSS_COMPILER_FLAGS ${_GSS_CFLAGS})
|
||||
set(GSS_LIBRARY_DIRS ${_GSS_LIBRARY_DIRS})
|
||||
set(GSS_LDFLAGS ${_GSS_LDFLAGS})
|
||||
set(GSS_CFLAGS ${_GSS_CFLAGS})
|
||||
set(GSS_VERSION ${_GSS_VERSION})
|
||||
|
||||
if(GSS_FLAVOUR)
|
||||
@ -299,8 +300,8 @@ endif()
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GSS
|
||||
REQUIRED_VARS
|
||||
GSS_LIBRARIES
|
||||
GSS_FLAVOUR
|
||||
GSS_LIBRARIES
|
||||
VERSION_VAR
|
||||
GSS_VERSION
|
||||
FAIL_MESSAGE
|
||||
|
@ -1114,16 +1114,13 @@ if(CURL_USE_GSSAPI)
|
||||
|
||||
set(HAVE_GSSAPI ${GSS_FOUND})
|
||||
if(GSS_FOUND)
|
||||
|
||||
message(STATUS "Found ${GSS_FLAVOUR} GSSAPI version: \"${GSS_VERSION}\"")
|
||||
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIRS})
|
||||
|
||||
string(REPLACE ";" " " GSS_COMPILER_FLAGS "${GSS_COMPILER_FLAGS}")
|
||||
string(REPLACE ";" " " GSS_LINKER_FLAGS "${GSS_LINKER_FLAGS}")
|
||||
string(REPLACE ";" " " GSS_CFLAGS "${GSS_CFLAGS}")
|
||||
string(REPLACE ";" " " GSS_LDFLAGS "${GSS_LDFLAGS}")
|
||||
|
||||
foreach(_dir IN LISTS GSS_LINK_DIRECTORIES)
|
||||
set(GSS_LINKER_FLAGS "${GSS_LINKER_FLAGS} -L\"${_dir}\"")
|
||||
foreach(_dir IN LISTS GSS_LIBRARY_DIRS)
|
||||
set(GSS_LDFLAGS "${GSS_LDFLAGS} -L\"${_dir}\"")
|
||||
endforeach()
|
||||
|
||||
check_include_file_concat("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H)
|
||||
@ -1143,7 +1140,7 @@ if(CURL_USE_GSSAPI)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED HAVE_GSS_C_NT_HOSTBASED_SERVICE)
|
||||
set(CMAKE_REQUIRED_FLAGS "${GSS_COMPILER_FLAGS} ${GSS_LINKER_FLAGS}")
|
||||
set(CMAKE_REQUIRED_FLAGS "${GSS_CFLAGS} ${GSS_LDFLAGS}")
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${GSS_LIBRARIES})
|
||||
check_symbol_exists("GSS_C_NT_HOSTBASED_SERVICE" ${_include_list} HAVE_GSS_C_NT_HOSTBASED_SERVICE)
|
||||
unset(CMAKE_REQUIRED_LIBRARIES)
|
||||
@ -1154,10 +1151,10 @@ if(CURL_USE_GSSAPI)
|
||||
endif()
|
||||
|
||||
include_directories(${GSS_INCLUDE_DIRS})
|
||||
link_directories(${GSS_LINK_DIRECTORIES})
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GSS_COMPILER_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GSS_LINKER_FLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GSS_LINKER_FLAGS}")
|
||||
link_directories(${GSS_LIBRARY_DIRS})
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GSS_CFLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GSS_LDFLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GSS_LDFLAGS}")
|
||||
list(APPEND CURL_LIBS ${GSS_LIBRARIES})
|
||||
if(GSS_FLAVOUR STREQUAL "MIT")
|
||||
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "mit-krb5-gssapi")
|
||||
|
Loading…
Reference in New Issue
Block a user