summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt56
1 files changed, 37 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0346ff3..4e688ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,7 +157,11 @@ IF (NOT HDF5_INSTALL_INCLUDE_DIR)
SET (HDF5_INSTALL_INCLUDE_DIR include)
ENDIF (NOT HDF5_INSTALL_INCLUDE_DIR)
IF (NOT HDF5_INSTALL_DATA_DIR)
- SET (HDF5_INSTALL_DATA_DIR share)
+ IF (NOT WIN32)
+ SET (HDF5_INSTALL_DATA_DIR share)
+ ELSE (NOT WIN32)
+ SET (HDF5_INSTALL_DATA_DIR ".")
+ ENDIF (NOT WIN32)
ENDIF (NOT HDF5_INSTALL_DATA_DIR)
#-----------------------------------------------------------------------------
@@ -201,7 +205,7 @@ ELSE (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "")
ENDIF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "")
SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_MINOR}.${H5_SOVERS_RELEASE}")
SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}")
-SET (HDF5_PACKAGE_TARNAME "hdf5")
+SET (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}")
SET (HDF5_PACKAGE_URL "http://www.hdfgroup.org")
SET (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org")
@@ -268,10 +272,10 @@ SET (H5_ENABLE_SHARED_LIB NO)
SET (H5_ENABLE_STATIC_LIB NO)
IF (BUILD_SHARED_LIBS)
SET (LIB_TYPE SHARED)
- SET (H5_BUILT_AS_DYNAMIC_LIB 1)
+ ADD_DEFINITIONS (-DH5_BUILT_AS_DYNAMIC_LIB)
SET (H5_ENABLE_SHARED_LIB YES)
ELSE (BUILD_SHARED_LIBS)
- SET (H5_BUILT_AS_STATIC_LIB 1)
+ ADD_DEFINITIONS (-DH5_BUILT_AS_STATIC_LIB)
SET (H5_ENABLE_STATIC_LIB YES)
IF (NOT WIN32)
# should this be a user setting : Everyone uses it anyway ?
@@ -556,7 +560,7 @@ OPTION (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF)
IF (HDF5_ENABLE_Z_LIB_SUPPORT)
IF (NOT H5_ZLIB_HEADER)
IF (NOT ZLIB_USE_EXTERNAL)
- FIND_PACKAGE (ZLIB)
+ FIND_PACKAGE (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT})
ENDIF (NOT ZLIB_USE_EXTERNAL)
IF (ZLIB_FOUND)
SET (H5_HAVE_FILTER_DEFLATE 1)
@@ -596,7 +600,7 @@ OPTION (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF)
IF (HDF5_ENABLE_SZIP_SUPPORT)
OPTION (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF)
IF (NOT SZIP_USE_EXTERNAL)
- FIND_PACKAGE (SZIP)
+ FIND_PACKAGE (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT})
ENDIF (NOT SZIP_USE_EXTERNAL)
IF (SZIP_FOUND)
SET (H5_HAVE_FILTER_SZIP 1)
@@ -615,7 +619,7 @@ IF (HDF5_ENABLE_SZIP_SUPPORT)
ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
ENDIF (SZIP_FOUND)
SET (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES})
- INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS})
+ INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIR})
MESSAGE (STATUS "Filter SZIP is ON")
IF (H5_HAVE_FILTER_SZIP)
SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE")
@@ -831,8 +835,8 @@ ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT)
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
INSTALL (
EXPORT ${HDF5_EXPORTED_TARGETS}
- DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/hdf5
- FILE hdf5-targets.cmake
+ DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/${HDF5_PACKAGE}
+ FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake
COMPONENT configinstall
)
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
@@ -843,7 +847,7 @@ ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
EXPORT (
TARGETS ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES}
- FILE hdf5-targets.cmake
+ FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake
)
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
@@ -860,20 +864,35 @@ SET (HDF5_VERSION_MINOR @HDF5_PACKAGE_VERSION_MINOR@)
CONFIGURE_FILE (
${HDF5_RESOURCES_DIR}/hdf5-config.cmake.build.in
- ${HDF5_BINARY_DIR}/hdf5-config.cmake @ONLY
+ ${HDF5_BINARY_DIR}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake @ONLY
)
#-----------------------------------------------------------------------------
+# Configure the FindHDF5.cmake file for the install directory
+#-----------------------------------------------------------------------------
+IF (NOT HDF5_EXTERNALLY_CONFIGURED)
+ CONFIGURE_FILE (
+ ${HDF5_RESOURCES_DIR}/FindHDF5.cmake.in
+ ${HDF5_BINARY_DIR}/CMakeFiles/FindHDF5${HDF_PACKAGE_EXT}.cmake @ONLY
+ )
+ INSTALL (
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/FindHDF5${HDF_PACKAGE_EXT}.cmake
+ DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/${HDF5_PACKAGE}
+ COMPONENT configinstall
+ )
+ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
+
+#-----------------------------------------------------------------------------
# Configure the hdf5-config.cmake file for the install directory
#-----------------------------------------------------------------------------
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
CONFIGURE_FILE (
${HDF5_RESOURCES_DIR}/hdf5-config.cmake.install.in
- ${HDF5_BINARY_DIR}/CMakeFiles/hdf5-config.cmake @ONLY
+ ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake @ONLY
)
INSTALL (
- FILES ${HDF5_BINARY_DIR}/CMakeFiles/hdf5-config.cmake
- DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/hdf5
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake
+ DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/${HDF5_PACKAGE}
COMPONENT configinstall
)
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
@@ -884,11 +903,11 @@ ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
CONFIGURE_FILE (
${HDF5_RESOURCES_DIR}/hdf5-config-version.cmake.in
- ${HDF5_BINARY_DIR}/CMakeFiles/hdf5-config-version.cmake @ONLY
+ ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake @ONLY
)
INSTALL (
- FILES ${HDF5_BINARY_DIR}/CMakeFiles/hdf5-config-version.cmake
- DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/hdf5
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF5_PACKAGE_EXT}-config-version.cmake
+ DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/${HDF5_PACKAGE}
COMPONENT configinstall
)
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
@@ -907,7 +926,7 @@ CONFIGURE_FILE (
)
INSTALL (
FILES ${HDF5_BINARY_DIR}/libhdf5.settings
- DESTINATION ${HDF5_INSTALL_LIB_DIR}
+ DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/${HDF5_PACKAGE}
COMPONENT libraries
)
@@ -984,7 +1003,6 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
SET (CPACK_NSIS_PACKAGE_NAME "HDF5 ${HDF5_PACKAGE_VERSION}")
ELSE (WIN32)
SET (CPACK_PACKAGING_INSTALL_PREFIX "/usr")
- SET (CPACK_ARCHIVE_COMPONENT_INSTALL ON)
SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
SET (CPACK_DEBIAN_PACKAGE_SECTION "Libraries")