CMake: fix MIT/Heimdal Kerberos detection
- fix syntax error in FindGSS.cmake - correct krb5 include directory. FindGSS exports "GSS_INCLUDE_DIR" variable. Closes https://github.com/curl/curl/pull/3316
This commit is contained in:
Родитель
40ac6f1e50
Коммит
a39d8f7056
|
@ -68,7 +68,7 @@ if(NOT _GSS_FOUND) #not found by pkg-config. Let's take more traditional approac
|
||||||
# should also work in an odd case when multiple directories are given
|
# should also work in an odd case when multiple directories are given
|
||||||
string(STRIP "${_GSS_CFLAGS}" _GSS_CFLAGS)
|
string(STRIP "${_GSS_CFLAGS}" _GSS_CFLAGS)
|
||||||
string(REGEX REPLACE " +-I" ";" _GSS_CFLAGS "${_GSS_CFLAGS}")
|
string(REGEX REPLACE " +-I" ";" _GSS_CFLAGS "${_GSS_CFLAGS}")
|
||||||
string(REGEX REPLACE " +-([^I][^ \\t;]*)" ";-\\1"_GSS_CFLAGS "${_GSS_CFLAGS}")
|
string(REGEX REPLACE " +-([^I][^ \\t;]*)" ";-\\1" _GSS_CFLAGS "${_GSS_CFLAGS}")
|
||||||
|
|
||||||
foreach(_flag ${_GSS_CFLAGS})
|
foreach(_flag ${_GSS_CFLAGS})
|
||||||
if(_flag MATCHES "^-I.*")
|
if(_flag MATCHES "^-I.*")
|
||||||
|
@ -91,7 +91,7 @@ if(NOT _GSS_FOUND) #not found by pkg-config. Let's take more traditional approac
|
||||||
# this script gives us libraries and link directories. Blah. We have to deal with it.
|
# this script gives us libraries and link directories. Blah. We have to deal with it.
|
||||||
string(STRIP "${_GSS_LIB_FLAGS}" _GSS_LIB_FLAGS)
|
string(STRIP "${_GSS_LIB_FLAGS}" _GSS_LIB_FLAGS)
|
||||||
string(REGEX REPLACE " +-(L|l)" ";-\\1" _GSS_LIB_FLAGS "${_GSS_LIB_FLAGS}")
|
string(REGEX REPLACE " +-(L|l)" ";-\\1" _GSS_LIB_FLAGS "${_GSS_LIB_FLAGS}")
|
||||||
string(REGEX REPLACE " +-([^Ll][^ \\t;]*)" ";-\\1"_GSS_LIB_FLAGS "${_GSS_LIB_FLAGS}")
|
string(REGEX REPLACE " +-([^Ll][^ \\t;]*)" ";-\\1" _GSS_LIB_FLAGS "${_GSS_LIB_FLAGS}")
|
||||||
|
|
||||||
foreach(_flag ${_GSS_LIB_FLAGS})
|
foreach(_flag ${_GSS_LIB_FLAGS})
|
||||||
if(_flag MATCHES "^-l.*")
|
if(_flag MATCHES "^-l.*")
|
||||||
|
|
|
@ -585,7 +585,7 @@ if(CMAKE_USE_GSSAPI)
|
||||||
|
|
||||||
message(STATUS "Found ${GSS_FLAVOUR} GSSAPI version: \"${GSS_VERSION}\"")
|
message(STATUS "Found ${GSS_FLAVOUR} GSSAPI version: \"${GSS_VERSION}\"")
|
||||||
|
|
||||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIRECTORIES})
|
list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIR})
|
||||||
check_include_file_concat("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H)
|
check_include_file_concat("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H)
|
||||||
check_include_file_concat("gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H)
|
check_include_file_concat("gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H)
|
||||||
check_include_file_concat("gssapi/gssapi_krb5.h" HAVE_GSSAPI_GSSAPI_KRB5_H)
|
check_include_file_concat("gssapi/gssapi_krb5.h" HAVE_GSSAPI_GSSAPI_KRB5_H)
|
||||||
|
@ -621,7 +621,7 @@ if(CMAKE_USE_GSSAPI)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(${GSS_INCLUDE_DIRECTORIES})
|
include_directories(${GSS_INCLUDE_DIR})
|
||||||
link_directories(${GSS_LINK_DIRECTORIES})
|
link_directories(${GSS_LINK_DIRECTORIES})
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GSS_COMPILER_FLAGS}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GSS_COMPILER_FLAGS}")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GSS_LINKER_FLAGS}")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GSS_LINKER_FLAGS}")
|
||||||
|
|
Загрузка…
Ссылка в новой задаче