# - `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"
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE
)
- message(STATUS "FindGSS CFLAGS: ${_GSS_CFLAGS}")
+ message(STATUS "FindGSS krb5-config --cflags: ${_GSS_CFLAGS}")
if(NOT _gss_configure_failed) # 0 means success
# Should also work in an odd case when multiple directories are given
string(STRIP "${_GSS_CFLAGS}" _GSS_CFLAGS)
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE
)
- message(STATUS "FindGSS LDFLAGS: ${_gss_lib_flags}")
+ message(STATUS "FindGSS krb5-config --libs: ${_gss_lib_flags}")
if(NOT _gss_configure_failed) # 0 means success
# This script gives us libraries and link directories. Blah. We have to deal with it.
elseif(_flag MATCHES "^-L.*")
string(REGEX REPLACE "^-L" "" _val "${_flag}")
list(APPEND _GSS_LIBRARY_DIRS "${_val}")
- else()
- list(APPEND _GSS_LDFLAGS "${_flag}")
endif()
endforeach()
endif()
message(STATUS "Found GSS/${GSS_FLAVOUR} (via pkg-config): ${_GSS_INCLUDE_DIRS} (found version \"${_GSS_VERSION}\")")
endif()
+string(REPLACE ";" " " _GSS_CFLAGS "${_GSS_CFLAGS}")
+
set(GSS_INCLUDE_DIRS ${_GSS_INCLUDE_DIRS})
set(GSS_LIBRARIES ${_GSS_LIBRARIES})
set(GSS_LIBRARY_DIRS ${_GSS_LIBRARY_DIRS})
-set(GSS_LDFLAGS ${_GSS_LDFLAGS})
set(GSS_CFLAGS ${_GSS_CFLAGS})
set(GSS_VERSION ${_GSS_VERSION})
_GSS_CFLAGS
_GSS_FOUND
_GSS_INCLUDE_DIRS
- _GSS_LDFLAGS
_GSS_LIBRARIES
_GSS_LIBRARY_DIRS
_GSS_MODULE_NAME
set(HAVE_GSSAPI ${GSS_FOUND})
if(GSS_FOUND)
- cmake_push_check_state()
- list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIRS})
-
- string(REPLACE ";" " " GSS_CFLAGS "${GSS_CFLAGS}")
- string(REPLACE ";" " " GSS_LDFLAGS "${GSS_LDFLAGS}")
-
- foreach(_dir IN LISTS GSS_LIBRARY_DIRS)
- set(GSS_LDFLAGS "${GSS_LDFLAGS} -L\"${_dir}\"")
- endforeach()
+ if(GSS_FLAVOUR STREQUAL "GNU")
+ set(HAVE_GSSGNU 1)
+ else()
+ cmake_push_check_state()
+ list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIRS})
- if(NOT GSS_FLAVOUR STREQUAL "GNU")
set(_include_list "")
check_include_file("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H)
if(HAVE_GSSAPI_GSSAPI_H)
endif()
if(NOT DEFINED HAVE_GSS_C_NT_HOSTBASED_SERVICE)
- set(CMAKE_REQUIRED_FLAGS "${GSS_CFLAGS} ${GSS_LDFLAGS}")
+ set(CMAKE_REQUIRED_FLAGS ${GSS_CFLAGS})
set(CMAKE_REQUIRED_LIBRARIES ${GSS_LIBRARIES})
+ curl_required_libpaths("${GSS_LIBRARY_DIRS}")
check_symbol_exists("GSS_C_NT_HOSTBASED_SERVICE" "${_include_list}" HAVE_GSS_C_NT_HOSTBASED_SERVICE)
endif()
if(NOT HAVE_GSS_C_NT_HOSTBASED_SERVICE)
endif()
endif()
unset(_include_list)
+ cmake_pop_check_state()
endif()
- cmake_pop_check_state()
- include_directories(SYSTEM ${GSS_INCLUDE_DIRS})
- 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})
+ list(APPEND CURL_LIBDIRS ${GSS_LIBRARY_DIRS})
if(GSS_FLAVOUR STREQUAL "GNU")
- set(HAVE_GSSGNU 1)
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "gss")
elseif(GSS_FLAVOUR STREQUAL "MIT")
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "mit-krb5-gssapi")
else() # Heimdal
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "heimdal-gssapi")
endif()
+ include_directories(SYSTEM ${GSS_INCLUDE_DIRS})
+ link_directories(${GSS_LIBRARY_DIRS})
+ if(GSS_CFLAGS)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GSS_CFLAGS}")
+ endif()
else()
message(WARNING "GSSAPI has been requested, but no supporting libraries found. Skipping.")
endif()