summaryrefslogtreecommitdiffstats
path: root/winpr/libwinpr/sspi/CMakeLists.txt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:24:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:24:41 +0000
commita9bcc81f821d7c66f623779fa5147e728eb3c388 (patch)
tree98676963bcdd537ae5908a067a8eb110b93486a6 /winpr/libwinpr/sspi/CMakeLists.txt
parentInitial commit. (diff)
downloadfreerdp3-a9bcc81f821d7c66f623779fa5147e728eb3c388.tar.xz
freerdp3-a9bcc81f821d7c66f623779fa5147e728eb3c388.zip
Adding upstream version 3.3.0+dfsg1.upstream/3.3.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'winpr/libwinpr/sspi/CMakeLists.txt')
-rw-r--r--winpr/libwinpr/sspi/CMakeLists.txt129
1 files changed, 129 insertions, 0 deletions
diff --git a/winpr/libwinpr/sspi/CMakeLists.txt b/winpr/libwinpr/sspi/CMakeLists.txt
new file mode 100644
index 0000000..f77b38f
--- /dev/null
+++ b/winpr/libwinpr/sspi/CMakeLists.txt
@@ -0,0 +1,129 @@
+# WinPR: Windows Portable Runtime
+# libwinpr-sspi cmake build script
+#
+# Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set(MODULE_PREFIX "WINPR_SSPI")
+
+set(${MODULE_PREFIX}_NTLM_SRCS
+ NTLM/ntlm_av_pairs.c
+ NTLM/ntlm_av_pairs.h
+ NTLM/ntlm_compute.c
+ NTLM/ntlm_compute.h
+ NTLM/ntlm_message.c
+ NTLM/ntlm_message.h
+ NTLM/ntlm.c
+ NTLM/ntlm.h
+ NTLM/ntlm_export.h)
+
+set(${MODULE_PREFIX}_KERBEROS_SRCS
+ Kerberos/kerberos.c
+ Kerberos/kerberos.h)
+
+set(${MODULE_PREFIX}_NEGOTIATE_SRCS
+ Negotiate/negotiate.c
+ Negotiate/negotiate.h)
+
+set(${MODULE_PREFIX}_SCHANNEL_SRCS
+ Schannel/schannel_openssl.c
+ Schannel/schannel_openssl.h
+ Schannel/schannel.c
+ Schannel/schannel.h)
+
+set(${MODULE_PREFIX}_CREDSSP_SRCS
+ CredSSP/credssp.c
+ CredSSP/credssp.h)
+
+set(${MODULE_PREFIX}_SRCS
+ sspi_winpr.c
+ sspi_winpr.h
+ sspi_export.c
+ sspi_gss.c
+ sspi_gss.h
+ sspi.c
+ sspi.h)
+
+set(KRB5_DEFAULT OFF)
+if (NOT WIN32 AND NOT ANDROID AND NOT IOS AND NOT APPLE)
+ set(KRB5_DEFAULT ON)
+endif()
+
+option(WITH_DEBUG_SCHANNEL "Compile support for SCHANNEL debug" ${DEFAULT_DEBUG_OPTION})
+if (WITH_DEBUG_SCHANNEL)
+ winpr_definition_add("-DWITH_DEBUG_SCHANNEL")
+endif()
+
+option(WITH_KRB5 "Compile support for kerberos authentication." ${KRB5_DEFAULT})
+if (WITH_KRB5)
+ find_package(KRB5 REQUIRED)
+
+ list(APPEND ${MODULE_PREFIX}_KERBEROS_SRCS
+ Kerberos/krb5glue.h)
+
+ winpr_include_directory_add(${KRB5_INCLUDEDIR})
+ winpr_include_directory_add(${KRB5_INCLUDE_DIRS})
+ winpr_library_add_private(${KRB5_LIBRARIES})
+ winpr_library_add_private(${KRB5_LIBRARY})
+ winpr_library_add_compile_options(${KRB5_CFLAGS})
+ winpr_library_add_link_options(${KRB5_LDFLAGS})
+ winpr_library_add_link_directory(${KRB5_LIBRARY_DIRS})
+
+ winpr_definition_add("-DWITH_KRB5")
+
+ if(KRB5_FLAVOUR STREQUAL "MIT")
+ winpr_definition_add("-DWITH_KRB5_MIT")
+ list(APPEND ${MODULE_PREFIX}_KERBEROS_SRCS
+ Kerberos/krb5glue_mit.c
+ )
+ elseif(KRB5_FLAVOUR STREQUAL "Heimdal")
+ winpr_definition_add("-DWITH_KRB5_HEIMDAL")
+ list(APPEND ${MODULE_PREFIX}_KERBEROS_SRCS
+ Kerberos/krb5glue_heimdal.c
+ )
+ else()
+ message(WARNING "Kerberos version not detected")
+ endif()
+
+ include(CMakeDependentOption)
+ CMAKE_DEPENDENT_OPTION(WITH_KRB5_NO_NTLM_FALLBACK "Do not fall back to NTLM if no kerberos ticket available" OFF "WITH_KRB5" OFF)
+ if (WITH_KRB5_NO_NTLM_FALLBACK)
+ add_definitions("-DWITH_KRB5_NO_NTLM_FALLBACK")
+ endif()
+endif()
+
+winpr_module_add(${${MODULE_PREFIX}_CREDSSP_SRCS}
+ ${${MODULE_PREFIX}_NTLM_SRCS}
+ ${${MODULE_PREFIX}_KERBEROS_SRCS}
+ ${${MODULE_PREFIX}_NEGOTIATE_SRCS}
+ ${${MODULE_PREFIX}_SCHANNEL_SRCS}
+ ${${MODULE_PREFIX}_SRCS})
+
+if(OPENSSL_FOUND)
+ winpr_include_directory_add(${OPENSSL_INCLUDE_DIR})
+ winpr_library_add_private(${OPENSSL_LIBRARIES})
+endif()
+
+if(MBEDTLS_FOUND)
+ winpr_include_directory_add(${MBEDTLS_INCLUDE_DIR})
+ winpr_library_add_private(${MBEDTLS_LIBRARIES})
+endif()
+
+if(WIN32)
+ winpr_library_add_public(ws2_32)
+endif()
+
+if(BUILD_TESTING)
+ add_subdirectory(test)
+endif()