diff -burN hdf-4.2.13.orig/CMakeLists.txt hdf-4.2.13/CMakeLists.txt
--- hdf-4.2.13.orig/CMakeLists.txt	2017-08-28 11:51:04.115548046 +0200
+++ hdf-4.2.13/CMakeLists.txt	2017-08-28 16:57:09.495243479 +0200
@@ -119,10 +119,10 @@
 #-----------------------------------------------------------------------------
 # Set the core names of all the libraries
 #-----------------------------------------------------------------------------
-set (HDF4_SRC_LIB_CORENAME          "hdf")
+set (HDF4_SRC_LIB_CORENAME          "hdf" CACHE STRING "Name of the HDF library")
 set (HDF4_SRC_FCSTUB_LIB_CORENAME   "hdf_fcstub")
 set (HDF4_SRC_FORTRAN_LIB_CORENAME  "hdf_fortran")
-set (HDF4_MF_LIB_CORENAME           "mfhdf")
+set (HDF4_MF_LIB_CORENAME           "mfhdf" CACHE STRING "Name of the MFHDF library")
 set (HDF4_MF_XDR_LIB_CORENAME       "xdr")
 set (HDF4_HDF_TEST_LIB_CORENAME     "hdf_test")
 set (HDF4_HDF_TEST_FCSTUB_LIB_CORENAME     "hdf_test_fcstub")
diff -burN hdf-4.2.13.orig/hdf/src/CMakeLists.txt hdf-4.2.13/hdf/src/CMakeLists.txt
--- hdf-4.2.13.orig/hdf/src/CMakeLists.txt	2017-08-28 11:51:04.123547659 +0200
+++ hdf-4.2.13/hdf/src/CMakeLists.txt	2017-08-29 11:54:50.984708306 +0200
@@ -145,6 +145,7 @@
       COMPILE_DEFINITIONS "H4_BUILT_AS_DYNAMIC_LIB"
       INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
       INTERFACE_COMPILE_DEFINITIONS H4_BUILT_AS_DYNAMIC_LIB=1
+      DEFINE_SYMBOL "hdf_shared_EXPORTS"
   )
   if (WIN32)
     set_property (TARGET ${HDF4_SRC_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "DOS_FS")
diff -burN hdf-4.2.13.orig/mfhdf/libsrc/CMakeLists.txt hdf-4.2.13/mfhdf/libsrc/CMakeLists.txt
--- hdf-4.2.13.orig/mfhdf/libsrc/CMakeLists.txt	2017-08-28 11:51:04.131547427 +0200
+++ hdf-4.2.13/mfhdf/libsrc/CMakeLists.txt	2017-08-29 14:09:23.159803355 +0200
@@ -92,6 +92,7 @@
       COMPILE_DEFINITIONS "HDF;H4_BUILT_AS_DYNAMIC_LIB"
       INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
       INTERFACE_COMPILE_DEFINITIONS H4_BUILT_AS_DYNAMIC_LIB=1
+      DEFINE_SYMBOL "mfhdf_shared_EXPORTS"
   )
   if (WIN32)
     set_property (TARGET ${HDF4_MF_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "DOS_FS;SWAP")
