diff --git a/CMake/dcmtkMacros.cmake b/CMake/dcmtkMacros.cmake
index 5b76b09..df729e1 100644
--- a/CMake/dcmtkMacros.cmake
+++ b/CMake/dcmtkMacros.cmake
@@ -45,3 +45,26 @@ MACRO(DCMTK_SETUP_LIBRARY LIBRARY)
         SET_TARGET_PROPERTIES(${LIBRARY} PROPERTIES COMPILE_DEFINITIONS "${LIBRARY}_EXPORTS")
     ENDIF(BUILD_SHARED_LIBS)
 ENDMACRO(DCMTK_SETUP_LIBRARY)
+
+#
+# Setup a convenience library
+#
+# DCMTK_SETUP_LIBRARY - macro which adds the needed setup for a library
+# LIBRARY - name of the library that we are called for
+# extra arguments - source files to link into the library
+#
+MACRO(DCMTK_ADD_CONVENIENCE_LIBRARY LIBRARY)
+    ADD_LIBRARY(${LIBRARY} STATIC ${ARGN})
+    DCMTK_SETUP_LIBRARY(${LIBRARY})
+    # When building statically, convenience libraries get installed normally.
+    # When building dynamically, these libs don't need to be installed, because
+    # they already were linked into all libs that need them. Users don't need to
+    # interact with these libraries at all.
+    IF(NOT BUILD_SHARED_LIBS)
+        INSTALL(TARGETS ${LIBRARY}
+                COMPONENT lib
+                RUNTIME DESTINATION ${DCMTK_INSTALL_BINDIR}
+                LIBRARY DESTINATION ${DCMTK_INSTALL_LIBDIR}
+                ARCHIVE DESTINATION ${DCMTK_INSTALL_LIBDIR})
+    ENDIF(NOT BUILD_SHARED_LIBS)
+ENDMACRO(DCMTK_SETUP_LIBRARY)
diff --git a/dcmjpeg/libijg12/CMakeLists.txt b/dcmjpeg/libijg12/CMakeLists.txt
index 08b3278..6a1b043 100644
--- a/dcmjpeg/libijg12/CMakeLists.txt
+++ b/dcmjpeg/libijg12/CMakeLists.txt
@@ -1,10 +1,2 @@
 # create library from source files
-ADD_LIBRARY(ijg12 jaricom jcapimin jcapistd jcarith jccoefct jccolor jcdctmgr jcdiffct jchuff jcinit jclhuff jclossls jclossy jcmainct jcmarker jcmaster jcodec jcomapi jcparam jcphuff jcpred jcprepct jcsample jcscale jcshuff jctrans jdapimin jdapistd jdarith jdatadst jdatasrc jdcoefct jdcolor jddctmgr jddiffct jdhuff jdinput jdlhuff jdlossls jdlossy jdmainct jdmarker jdmaster jdmerge jdphuff jdpostct jdpred jdsample jdscale jdshuff jdtrans jerror jfdctflt jfdctfst jfdctint jidctflt jidctfst jidctint jidctred jmemmgr jmemnobs jquant1 jquant2 jutils)
-DCMTK_SETUP_LIBRARY(ijg12)
-
-# declare installation files
-INSTALL(TARGETS ijg12
-        COMPONENT lib
-        RUNTIME DESTINATION ${DCMTK_INSTALL_BINDIR}
-        LIBRARY DESTINATION ${DCMTK_INSTALL_LIBDIR}
-        ARCHIVE DESTINATION ${DCMTK_INSTALL_LIBDIR})
+DCMTK_ADD_CONVENIENCE_LIBRARY(ijg12 jaricom jcapimin jcapistd jcarith jccoefct jccolor jcdctmgr jcdiffct jchuff jcinit jclhuff jclossls jclossy jcmainct jcmarker jcmaster jcodec jcomapi jcparam jcphuff jcpred jcprepct jcsample jcscale jcshuff jctrans jdapimin jdapistd jdarith jdatadst jdatasrc jdcoefct jdcolor jddctmgr jddiffct jdhuff jdinput jdlhuff jdlossls jdlossy jdmainct jdmarker jdmaster jdmerge jdphuff jdpostct jdpred jdsample jdscale jdshuff jdtrans jerror jfdctflt jfdctfst jfdctint jidctflt jidctfst jidctint jidctred jmemmgr jmemnobs jquant1 jquant2 jutils)
diff --git a/dcmjpeg/libijg12/jmorecfg12.h b/dcmjpeg/libijg12/jmorecfg12.h
index 00873e7..e8293f8 100644
--- a/dcmjpeg/libijg12/jmorecfg12.h
+++ b/dcmjpeg/libijg12/jmorecfg12.h
@@ -11,15 +11,6 @@
  */
 
 
-#include "dcmtk/ofstd/ofexport.h" /* for DCMTK_DECL_EXPORT */
-
-#ifdef ijg12_EXPORTS
-#define DCMTK_IJG12_EXPORT DCMTK_DECL_EXPORT
-#else
-#define DCMTK_IJG12_EXPORT DCMTK_DECL_IMPORT
-#endif
-
-
 /*
  * Define BITS_IN_JSAMPLE as either
  *   8   for 8-bit sample values (the usual setting)
@@ -227,7 +218,7 @@ typedef unsigned int JDIMENSION;
 /* a function referenced thru EXTERNs: */
 #define GLOBAL(type)		type
 /* a reference to a GLOBAL function: */
-#define EXTERN(type)		extern DCMTK_IJG12_EXPORT type
+#define EXTERN(type)		extern type
 
 
 /* This macro is used to declare a "method", that is, a function pointer.
diff --git a/dcmjpeg/libijg16/CMakeLists.txt b/dcmjpeg/libijg16/CMakeLists.txt
index a87534a..be78960 100644
--- a/dcmjpeg/libijg16/CMakeLists.txt
+++ b/dcmjpeg/libijg16/CMakeLists.txt
@@ -1,10 +1,2 @@
 # create library from source files
-ADD_LIBRARY(ijg16 jaricom jcapimin jcapistd jcarith jccoefct jccolor jcdctmgr jcdiffct jchuff jcinit jclhuff jclossls jclossy jcmainct jcmarker jcmaster jcodec jcomapi jcparam jcphuff jcpred jcprepct jcsample jcscale jcshuff jctrans jdapimin jdapistd jdarith jdatadst jdatasrc jdcoefct jdcolor jddctmgr jddiffct jdhuff jdinput jdlhuff jdlossls jdlossy jdmainct jdmarker jdmaster jdmerge jdphuff jdpostct jdpred jdsample jdscale jdshuff jdtrans jerror jfdctflt jfdctfst jfdctint jidctflt jidctfst jidctint jidctred jmemmgr jmemnobs jquant1 jquant2 jutils)
-DCMTK_SETUP_LIBRARY(ijg16)
-
-# declare installation files
-INSTALL(TARGETS ijg16
-        COMPONENT lib
-        RUNTIME DESTINATION ${DCMTK_INSTALL_BINDIR}
-        LIBRARY DESTINATION ${DCMTK_INSTALL_LIBDIR}
-        ARCHIVE DESTINATION ${DCMTK_INSTALL_LIBDIR})
+DCMTK_ADD_CONVENIENCE_LIBRARY(ijg16 jaricom jcapimin jcapistd jcarith jccoefct jccolor jcdctmgr jcdiffct jchuff jcinit jclhuff jclossls jclossy jcmainct jcmarker jcmaster jcodec jcomapi jcparam jcphuff jcpred jcprepct jcsample jcscale jcshuff jctrans jdapimin jdapistd jdarith jdatadst jdatasrc jdcoefct jdcolor jddctmgr jddiffct jdhuff jdinput jdlhuff jdlossls jdlossy jdmainct jdmarker jdmaster jdmerge jdphuff jdpostct jdpred jdsample jdscale jdshuff jdtrans jerror jfdctflt jfdctfst jfdctint jidctflt jidctfst jidctint jidctred jmemmgr jmemnobs jquant1 jquant2 jutils)
diff --git a/dcmjpeg/libijg16/jmorecfg16.h b/dcmjpeg/libijg16/jmorecfg16.h
index bde2157..275912b 100644
--- a/dcmjpeg/libijg16/jmorecfg16.h
+++ b/dcmjpeg/libijg16/jmorecfg16.h
@@ -11,15 +11,6 @@
  */
 
 
-#include "dcmtk/ofstd/ofexport.h" /* for DCMTK_DECL_EXPORT */
-
-#ifdef ijg16_EXPORTS
-#define DCMTK_IJG16_EXPORT DCMTK_DECL_EXPORT
-#else
-#define DCMTK_IJG16_EXPORT DCMTK_DECL_IMPORT
-#endif
-
-
 /*
  * Define BITS_IN_JSAMPLE as either
  *   8   for 8-bit sample values (the usual setting)
@@ -227,7 +218,7 @@ typedef unsigned int JDIMENSION;
 /* a function referenced thru EXTERNs: */
 #define GLOBAL(type)		type
 /* a reference to a GLOBAL function: */
-#define EXTERN(type)		extern DCMTK_IJG16_EXPORT type
+#define EXTERN(type)		extern type
 
 
 /* This macro is used to declare a "method", that is, a function pointer.
diff --git a/dcmjpeg/libijg8/CMakeLists.txt b/dcmjpeg/libijg8/CMakeLists.txt
index 917584f..d578de8 100644
--- a/dcmjpeg/libijg8/CMakeLists.txt
+++ b/dcmjpeg/libijg8/CMakeLists.txt
@@ -1,10 +1,2 @@
 # create library from source files
-ADD_LIBRARY(ijg8 jaricom jcapimin jcapistd jcarith jccoefct jccolor jcdctmgr jcdiffct jchuff jcinit jclhuff jclossls jclossy jcmainct jcmarker jcmaster jcodec jcomapi jcparam jcphuff jcpred jcprepct jcsample jcscale jcshuff jctrans jdapimin jdapistd jdarith jdatadst jdatasrc jdcoefct jdcolor jddctmgr jddiffct jdhuff jdinput jdlhuff jdlossls jdlossy jdmainct jdmarker jdmaster jdmerge jdphuff jdpostct jdpred jdsample jdscale jdshuff jdtrans jerror jfdctflt jfdctfst jfdctint jidctflt jidctfst jidctint jidctred jmemmgr jmemnobs jquant1 jquant2 jutils)
-DCMTK_SETUP_LIBRARY(ijg8)
-
-# declare installation files
-INSTALL(TARGETS ijg8
-        COMPONENT lib
-        RUNTIME DESTINATION ${DCMTK_INSTALL_BINDIR}
-        LIBRARY DESTINATION ${DCMTK_INSTALL_LIBDIR}
-        ARCHIVE DESTINATION ${DCMTK_INSTALL_LIBDIR})
+DCMTK_ADD_CONVENIENCE_LIBRARY(ijg8 jaricom jcapimin jcapistd jcarith jccoefct jccolor jcdctmgr jcdiffct jchuff jcinit jclhuff jclossls jclossy jcmainct jcmarker jcmaster jcodec jcomapi jcparam jcphuff jcpred jcprepct jcsample jcscale jcshuff jctrans jdapimin jdapistd jdarith jdatadst jdatasrc jdcoefct jdcolor jddctmgr jddiffct jdhuff jdinput jdlhuff jdlossls jdlossy jdmainct jdmarker jdmaster jdmerge jdphuff jdpostct jdpred jdsample jdscale jdshuff jdtrans jerror jfdctflt jfdctfst jfdctint jidctflt jidctfst jidctint jidctred jmemmgr jmemnobs jquant1 jquant2 jutils)
diff --git a/dcmjpeg/libijg8/jmorecfg8.h b/dcmjpeg/libijg8/jmorecfg8.h
index 26970db..eeaf441 100644
--- a/dcmjpeg/libijg8/jmorecfg8.h
+++ b/dcmjpeg/libijg8/jmorecfg8.h
@@ -11,15 +11,6 @@
  */
 
 
-#include "dcmtk/ofstd/ofexport.h" /* for DCMTK_DECL_EXPORT */
-
-#ifdef ijg8_EXPORTS
-#define DCMTK_IJG8_EXPORT DCMTK_DECL_EXPORT
-#else
-#define DCMTK_IJG8_EXPORT DCMTK_DECL_IMPORT
-#endif
-
-
 /*
  * Define BITS_IN_JSAMPLE as either
  *   8   for 8-bit sample values (the usual setting)
@@ -227,7 +218,7 @@ typedef unsigned int JDIMENSION;
 /* a function referenced thru EXTERNs: */
 #define GLOBAL(type)		type
 /* a reference to a GLOBAL function: */
-#define EXTERN(type)		extern DCMTK_IJG8_EXPORT type
+#define EXTERN(type)		extern type
 
 
 /* This macro is used to declare a "method", that is, a function pointer.
diff --git a/dcmjpls/libcharls/CMakeLists.txt b/dcmjpls/libcharls/CMakeLists.txt
index 7d97ca2..8f2e359 100644
--- a/dcmjpls/libcharls/CMakeLists.txt
+++ b/dcmjpls/libcharls/CMakeLists.txt
@@ -2,12 +2,4 @@
 INCLUDE_DIRECTORIES(${dcmjpls_SOURCE_DIR}/libcharls ${ofstd_SOURCE_DIR}/include)
 
 # create library from source files
-ADD_LIBRARY(charls header intrface jpegls)
-DCMTK_SETUP_LIBRARY(charls)
-
-# declare installation files
-INSTALL(TARGETS charls
-        COMPONENT lib
-        RUNTIME DESTINATION ${DCMTK_INSTALL_BINDIR}
-        LIBRARY DESTINATION ${DCMTK_INSTALL_LIBDIR}
-        ARCHIVE DESTINATION ${DCMTK_INSTALL_LIBDIR})
+DCMTK_ADD_CONVENIENCE_LIBRARY(charls header intrface jpegls)
diff --git a/dcmjpls/libcharls/intrface.h b/dcmjpls/libcharls/intrface.h
index 1a7bd4b..99e58c2 100644
--- a/dcmjpls/libcharls/intrface.h
+++ b/dcmjpls/libcharls/intrface.h
@@ -8,17 +8,9 @@
 
 #include "pubtypes.h"
 #include "dcmtk/ofstd/ofstd.h"    /* for size_t */
-#include "dcmtk/ofstd/ofdefine.h" /* for DCMTK_DECL_EXPORT */
-
-
-#ifdef charls_EXPORTS
-#define DCMTK_CHARLS_EXPORT DCMTK_DECL_EXPORT
-#else
-#define DCMTK_CHARLS_EXPORT DCMTK_DECL_IMPORT
-#endif
 
 #ifndef CHARLS_IMEXPORT
-#define CHARLS_IMEXPORT(returntype) DCMTK_CHARLS_EXPORT returntype
+#define CHARLS_IMEXPORT(returntype) returntype
 #endif
 
 
