# HG changeset patch # User Sebastien Jodogne # Date 1609429366 -3600 # Node ID a9a596ed988de4408ff0ae362e561024e1d47c11 # Parent 30efda56500dd32cc4fa1ace7f2c1883827e6b5b autodetection of SSL_CTX_get0_param() diff -r 30efda56500d -r a9a596ed988d OrthancFramework/Resources/CMake/DcmtkConfiguration.cmake --- a/OrthancFramework/Resources/CMake/DcmtkConfiguration.cmake Thu Dec 31 15:16:18 2020 +0100 +++ b/OrthancFramework/Resources/CMake/DcmtkConfiguration.cmake Thu Dec 31 16:42:46 2020 +0100 @@ -140,10 +140,27 @@ include_directories( ${DCMTK_SOURCES_DIR}/dcmtls/include ) - # The function "SSL_CTX_get0_param()" is available on OpenSSL - # 1.1.x that is used for static builds => TODO autodetect - set_source_files_properties(${DCMTK_SOURCES} - PROPERTIES COMPILE_DEFINITIONS "WITH_OPENSSL;HAVE_SSL_CTX_GET0_PARAM") + + if (STATIC_BUILD OR NOT USE_SYSTEM_OPENSSL) + # The function "SSL_CTX_get0_param()" is available on both + # OpenSSL 1.0.x and 1.1.x that are used for static builds + set(HAVE_SSL_CTX_GET0_PARAM ON) + else() + # The call below requires "OpenSslConfiguration.cmake" to have + # been included beforehand (which is automatically done if using + # "OrthancFrameworkConfiguration.cmake") + CHECK_LIBRARY_EXISTS(ssl "SSL_CTX_get0_param" "" HAVE_SSL_CTX_GET0_PARAM) + endif() + + if (HAVE_SSL_CTX_GET0_PARAM) + message("Have SSL_CTX_get0_param(): yes") + set_source_files_properties(${DCMTK_SOURCES} + PROPERTIES COMPILE_DEFINITIONS "WITH_OPENSSL;HAVE_SSL_CTX_GET0_PARAM") + else() + message("Have SSL_CTX_get0_param(): no") + set_source_files_properties(${DCMTK_SOURCES} + PROPERTIES COMPILE_DEFINITIONS "WITH_OPENSSL") + endif() endif() diff -r 30efda56500d -r a9a596ed988d OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake --- a/OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake Thu Dec 31 15:16:18 2020 +0100 +++ b/OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake Thu Dec 31 16:42:46 2020 +0100 @@ -494,6 +494,8 @@ message(FATAL_ERROR "DICOM module must be enabled if enabling DCMTK support") endif() + # WARNING - MUST be after "OpenSslConfiguration.cmake", otherwise + # DICOM TLS will not be corrected detected include(${CMAKE_CURRENT_LIST_DIR}/DcmtkConfiguration.cmake) add_definitions(-DORTHANC_ENABLE_DCMTK=1)