Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CMake/3rdparty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ if(DCMTK_USE_FIND_PACKAGE)
if(OPENSSL_VERSION_CHECK)
message(STATUS "Info: DCMTK OPENSSL support will be enabled")
set(WITH_OPENSSL 1)
include_directories(${OPENSSL_INCLUDE_DIR})
set(OPENSSL_LIBS ${OPENSSL_LIBRARIES} ${OPENSSL_EXTRA_LIBS_STATIC})
set(OPENSSL_MODULES OpenSSL::Crypto OpenSSL::SSL)
CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL)
if(HAVE_LIBDL)
set(OPENSSL_LIBS ${OPENSSL_LIBS} dl)
set(OPENSSL_MODULES ${OPENSSL_MODULES} dl)
endif()
else()
message(STATUS "Info: DCMTK OPENSSL support will be disabled: DCMTK requires OpenSSL version 1.0.1 or newer")
Expand Down Expand Up @@ -113,8 +114,7 @@ if(DCMTK_USE_FIND_PACKAGE)
else()
message(STATUS "Info: DCMTK ZLIB support will be enabled")
set(WITH_ZLIB 1)
include_directories(${ZLIB_INCLUDE_DIRS})
set(ZLIB_LIBS ${ZLIB_LIBRARIES})
set(ZLIB_MODULES ZLIB::ZLIB)
endif()
endif()

Expand Down
13 changes: 13 additions & 0 deletions CMake/DCMTKConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,19 @@ SET_AND_CHECK(DCMTK_TARGETS "@PACKAGE_DCMTK_CMKDIR_CONFIG@/DCMTKTargets.cmake")
# Compatibility: This variable is deprecated
set(DCMTK_INCLUDE_DIR ${DCMTK_INCLUDE_DIRS})

# Depend packages
if(DCMTK_WITH_ZLIB)
if(NOT ZLIB_FOUND)
find_package(ZLIB)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, did not know about this one yet

endif()
endif()

if(DCMTK_WITH_OPENSSL)
if(NOT OPENSSL_FOUND)
find_package(OpenSSL)
endif()
endif()

if(NOT DCMTK_TARGETS_IMPORTED)
set(DCMTK_TARGETS_IMPORTED 1)
include(${DCMTK_TARGETS})
Expand Down
2 changes: 1 addition & 1 deletion dcmdata/libdcxml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ DCMTK_ADD_LIBRARY(dcmxml
xml2dcm.cc
)

DCMTK_TARGET_LINK_MODULES(dcmxml dcmdata ofstd oflog)
DCMTK_TARGET_LINK_MODULES(dcmxml dcmdata ofstd oflog ${ZLIB_MODULES})
DCMTK_TARGET_LINK_LIBRARIES(dcmxml ${ZLIB_LIBS} ${LIBXML_LIBS})
2 changes: 1 addition & 1 deletion dcmdata/libsrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ DCMTK_ADD_LIBRARY(dcmdata
vrscanl.c
)

DCMTK_TARGET_LINK_MODULES(dcmdata ofstd oflog)
DCMTK_TARGET_LINK_MODULES(dcmdata ofstd oflog ${ZLIB_MODULES})
DCMTK_TARGET_LINK_LIBRARIES(dcmdata ${ZLIB_LIBS})

# Various dictionary-related commands
Expand Down
7 changes: 6 additions & 1 deletion dcmsign/libsrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ DCMTK_ADD_LIBRARY(dcmdsig
)

DCMTK_TARGET_LINK_MODULES(dcmdsig ofstd dcmdata)
DCMTK_TARGET_LINK_LIBRARIES(dcmdsig ${OPENSSL_LIBS})

if(OPENSSL_MODULES)
DCMTK_TARGET_LINK_MODULES(dcmdsig ${OPENSSL_MODULES})
else()
DCMTK_TARGET_LINK_LIBRARIES(dcmdsig ${OPENSSL_LIBS})
endif()

if (TARGET dcmdsig)
set_property(TARGET dcmdsig PROPERTY OUTPUT_NAME "dcmdsig${DCMTK_TLS_LIBRARY_POSTFIX}")
Expand Down
6 changes: 5 additions & 1 deletion dcmtls/libsrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ DCMTK_ADD_LIBRARY(dcmtls
)

DCMTK_TARGET_LINK_MODULES(dcmtls ofstd dcmdata dcmnet)
DCMTK_TARGET_LINK_LIBRARIES(dcmtls ${OPENSSL_LIBS})
if(OPENSSL_MODULES)
DCMTK_TARGET_LINK_MODULES(dcmtls ${OPENSSL_MODULES})
else()
DCMTK_TARGET_LINK_LIBRARIES(dcmtls ${OPENSSL_LIBS})
endif()

if (TARGET dcmtls)
set_property(TARGET dcmtls PROPERTY OUTPUT_NAME "dcmtls${DCMTK_TLS_LIBRARY_POSTFIX}")
Expand Down