Make it easier to add external DCMTK modules#144
Make it easier to add external DCMTK modules#144lassoan wants to merge 1 commit intoDCMTK:masterfrom
Conversation
Added DCMTK_EXTERNAL_MODULES CMake variable to allow adding external modules to DCMTK without having to copy files into the DCMTK source tree. DCMTK_EXTERNAL_MODULES contains a list of absolute paths, each pointing to a directory that follows the standard DCMTK module layout: it must contain a "CMakeLists.txt" at its root and an "include" subdirectory. Each module is added to the build via add_subdirectory() and its include directory is appended to DCMTK_INCLUDE_DIRS, both in the build tree and in the generated DCMTKConfig.cmake. Unlike DCMTK_MODULES, these paths are not relative to the DCMTK source tree, so the module source can reside anywhere on the filesystem.
|
I don't see a problem with this approach, also, because it leaves things within DCMTK as is and seems to be an elegant way to add extra modules, community-based or "private" within companies. However, maybe one of my DCMTK team colleagues wants to add something or has a different opinion. |
|
I like it too, and I find it useful, but I'm no CMake expert. |
|
Thanks for the reviews. The changes are very limited and have no effect if the optional @eichelberg please have a look and merge if it looks good to you. It is also fine if you suggest an alternative way to add custom modules outside of the source tree (for example, the mechanism that you use already to integrate commercial modules). |
|
Merged in commit d974b87ca, visible upstream in a few days after running through our internal build dashboard. |
|
Thank you @michaelonken for the review and merge. |
Added DCMTK_EXTERNAL_MODULES CMake variable to allow adding external modules to DCMTK without having to copy files into the DCMTK source tree.
DCMTK_EXTERNAL_MODULES contains a list of absolute paths, each pointing to a directory that follows the standard DCMTK module layout: it must contain a "CMakeLists.txt" at its root and an "include" subdirectory. Each module is added to the build via add_subdirectory() and its include directory is appended to DCMTK_INCLUDE_DIRS, both in the build tree and in the generated DCMTKConfig.cmake. Unlike DCMTK_MODULES, these paths are not relative to the DCMTK source tree, so the module source can reside anywhere on the filesystem.
This is used by DCMTKcs - repository containing community supported modules for DCMTK. Currently, the only module is dcmjp2kcs module for JPEG2000 encoding/decoding.