#
# 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")
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)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GSS
REQUIRED_VARS
- GSS_LIBRARIES
GSS_FLAVOUR
+ GSS_LIBRARIES
VERSION_VAR
GSS_VERSION
FAIL_MESSAGE
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)
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)
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")