Skip to content

Commit

Permalink
COMP: Add support for optionally building DCMTK with OpenSSL enabled
Browse files Browse the repository at this point in the history
This commit introduces the option `Slicer_USE_DCMTK_WITH_OPENSSL`
initialized to `OFF` by default.

Also add display of DCMTK configuration on application startup.
  • Loading branch information
jcfr committed Dec 31, 2024
1 parent 3763eda commit 67f4532
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 2 deletions.
21 changes: 21 additions & 0 deletions Base/QTGUI/qSlicerApplication.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@
#include <vtkNew.h>
#include <vtkSMP.h> // For VTK_SMP_BACKEND

// DCMTK includes
#ifdef Slicer_BUILD_DICOM_SUPPORT
# include <dcmtk/dcmdata/dcuid.h> // For OFFIS_DCMTK_VERSION_*
#endif

#ifdef Slicer_USE_PYTHONQT

// Custom Python completer that temporarily disables logging when reading list of attributes.
Expand Down Expand Up @@ -1119,6 +1124,9 @@ void qSlicerApplication::logApplicationInformation() const
<< "CPU "
<< "VTK configuration "
<< "Qt configuration "
#ifdef Slicer_BUILD_DICOM_SUPPORT
<< "DCMTK configuration "
#endif
<< "Internationalization "
<< "Developer mode "
<< "Application path "
Expand Down Expand Up @@ -1286,6 +1294,19 @@ void qSlicerApplication::logApplicationInformation() const
surfaceFormat.majorVersion(), surfaceFormat.minorVersion(),
qPrintable(openGLProfileStr));

// DCMTK configuration
#ifdef Slicer_BUILD_DICOM_SUPPORT
qDebug("%s: version %s, %s",
qPrintable(titles.at(titleIndex++).leftJustified(titleWidth, '.')),
OFFIS_DCMTK_VERSION_STRING,
# ifdef Slicer_USE_DCMTK_WITH_OPENSSL
"with SSL"
# else
"no SSL"
# endif
);
#endif

QSettings settings;

// Internationalization
Expand Down
3 changes: 2 additions & 1 deletion CMake/SlicerCPackBundleFixup.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ function(fixup_bundle_with_plugins app)
_fixup_paths_append(libs_path "@PYTHON_LIBRARY_PATH@")
endif()
set(Slicer_USE_PYTHONQT_WITH_OPENSSL "@Slicer_USE_PYTHONQT_WITH_OPENSSL@")
if(Slicer_USE_PYTHONQT_WITH_OPENSSL)
set(Slicer_USE_DCMTK_WITH_OPENSSL "@Slicer_USE_PYTHONQT_WITH_OPENSSL@")
if(Slicer_USE_PYTHONQT_WITH_OPENSSL OR Slicer_USE_DCMTK_WITH_OPENSSL)
_fixup_paths_append(libs_path "@OPENSSL_EXPORT_LIBRARY_DIR@")
endif()
set(Slicer_BUILD_DICOM_SUPPORT "@Slicer_BUILD_DICOM_SUPPORT@")
Expand Down
1 change: 1 addition & 0 deletions CMake/vtkSlicerConfigure.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#cmakedefine Slicer_USE_NUMPY
#cmakedefine Slicer_USE_PYTHONQT
#cmakedefine Slicer_USE_PYTHONQT_WITH_OPENSSL
#cmakedefine Slicer_USE_DCMTK_WITH_OPENSSL
#cmakedefine Slicer_USE_QtTesting
#cmakedefine Slicer_USE_OPENTRACKER

Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ CMAKE_DEPENDENT_OPTION(
"Slicer_USE_PYTHONQT" OFF)
mark_as_superbuild(Slicer_USE_PYTHONQT_WITH_OPENSSL)

CMAKE_DEPENDENT_OPTION(
Slicer_USE_DCMTK_WITH_OPENSSL "Enable DCMTK SSL support" OFF
"Slicer_USE_PYTHONQT_WITH_OPENSSL" OFF)
mark_as_superbuild(Slicer_USE_DCMTK_WITH_OPENSSL)

CMAKE_DEPENDENT_OPTION(
Slicer_USE_NUMPY "Build Slicer with NumPy" ON
"Slicer_USE_PYTHONQT" OFF)
Expand Down
1 change: 1 addition & 0 deletions Docs/developer_guide/build_instructions/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Customized editions of Slicer can be generated without changing Slicer source co
- `Slicer_QTLOADABLEMODULES_DISABLED`: Built-in Qt loadable modules that will be removed from the application. List contains module names, separated by semicolon character.
- `Slicer_QTSCRIPTEDMODULES_DISABLED`: Built-in scripted loadable modules that will be removed from the application. List contains module names, separated by semicolon character.
- `Slicer_USE_PYTHONQT_WITH_OPENSSL`: enable/disable building the application with SSL support (ON/OFF)
- `Slicer_USE_DCMTK_WITH_OPENSSL`: enable/disable building DCMTK with SSL support (ON/OFF)
- `Slicer_USE_SimpleITK`: enable/disable SimpleITK support (ON/OFF)
- `Slicer_BUILD_SimpleFilters`: enable/disable building SimpleFilters. Requires SimpleITK. (ON/OFF)
- `Slicer_EXTENSION_SOURCE_DIRS`: Defines additional extensions that will be included in the application package as built-in modules. Full paths of extension source directories has to be specified, separated by semicolons.
Expand Down
2 changes: 1 addition & 1 deletion SuperBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ set(Slicer_DEPENDENCIES
)

set(CURL_ENABLE_SSL ${Slicer_USE_PYTHONQT_WITH_OPENSSL})
set(DCMTK_WITH_OPENSSL ${Slicer_USE_PYTHONQT_WITH_OPENSSL})
set(DCMTK_WITH_OPENSSL ${Slicer_USE_DCMTK_WITH_OPENSSL})

if(Slicer_USE_SimpleITK)
list(APPEND Slicer_DEPENDENCIES SimpleITK)
Expand Down

0 comments on commit 67f4532

Please sign in to comment.