Mercurial > hg > orthanc
comparison OrthancFramework/Resources/CMake/DcmtkConfiguration.cmake @ 4428:a9a596ed988d
autodetection of SSL_CTX_get0_param()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 31 Dec 2020 16:42:46 +0100 |
parents | 30efda56500d |
children | 48ff722fad1f |
comparison
equal
deleted
inserted
replaced
4427:30efda56500d | 4428:a9a596ed988d |
---|---|
138 # because of "PROPERTIES COMPILE_DEFINITIONS" | 138 # because of "PROPERTIES COMPILE_DEFINITIONS" |
139 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmtls/libsrc DCMTK_SOURCES) | 139 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmtls/libsrc DCMTK_SOURCES) |
140 include_directories( | 140 include_directories( |
141 ${DCMTK_SOURCES_DIR}/dcmtls/include | 141 ${DCMTK_SOURCES_DIR}/dcmtls/include |
142 ) | 142 ) |
143 # The function "SSL_CTX_get0_param()" is available on OpenSSL | 143 |
144 # 1.1.x that is used for static builds => TODO autodetect | 144 if (STATIC_BUILD OR NOT USE_SYSTEM_OPENSSL) |
145 set_source_files_properties(${DCMTK_SOURCES} | 145 # The function "SSL_CTX_get0_param()" is available on both |
146 PROPERTIES COMPILE_DEFINITIONS "WITH_OPENSSL;HAVE_SSL_CTX_GET0_PARAM") | 146 # OpenSSL 1.0.x and 1.1.x that are used for static builds |
147 set(HAVE_SSL_CTX_GET0_PARAM ON) | |
148 else() | |
149 # The call below requires "OpenSslConfiguration.cmake" to have | |
150 # been included beforehand (which is automatically done if using | |
151 # "OrthancFrameworkConfiguration.cmake") | |
152 CHECK_LIBRARY_EXISTS(ssl "SSL_CTX_get0_param" "" HAVE_SSL_CTX_GET0_PARAM) | |
153 endif() | |
154 | |
155 if (HAVE_SSL_CTX_GET0_PARAM) | |
156 message("Have SSL_CTX_get0_param(): yes") | |
157 set_source_files_properties(${DCMTK_SOURCES} | |
158 PROPERTIES COMPILE_DEFINITIONS "WITH_OPENSSL;HAVE_SSL_CTX_GET0_PARAM") | |
159 else() | |
160 message("Have SSL_CTX_get0_param(): no") | |
161 set_source_files_properties(${DCMTK_SOURCES} | |
162 PROPERTIES COMPILE_DEFINITIONS "WITH_OPENSSL") | |
163 endif() | |
147 endif() | 164 endif() |
148 | 165 |
149 | 166 |
150 # This fixes crashes related to the destruction of the DCMTK OFLogger | 167 # This fixes crashes related to the destruction of the DCMTK OFLogger |
151 # http://support.dcmtk.org/docs-snapshot/file_macros.html | 168 # http://support.dcmtk.org/docs-snapshot/file_macros.html |