summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2012-08-06 14:18:55 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2012-08-06 14:18:55 (GMT)
commitc2491932d95b853304780bffa0929128e5721d5b (patch)
tree0ecc89bfe43d3ac328c6ecc852c425d3dcea80c2 /CMakeLists.txt
parent451fd8514b148c9f03f3dc9faffb4452be003d7d (diff)
downloadhdf5-c2491932d95b853304780bffa0929128e5721d5b.zip
hdf5-c2491932d95b853304780bffa0929128e5721d5b.tar.gz
hdf5-c2491932d95b853304780bffa0929128e5721d5b.tar.bz2
[svn-r22632] Merge from trunk revision 22631
tested: local linux
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt60
1 files changed, 40 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47588f1..9bf7ee3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,7 +157,13 @@ 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)
+ SET (HDF5_INSTALL_CMAKE_DIR share/cmake)
+ ELSE (NOT WIN32)
+ SET (HDF5_INSTALL_DATA_DIR ".")
+ SET (HDF5_INSTALL_CMAKE_DIR cmake)
+ ENDIF (NOT WIN32)
ENDIF (NOT HDF5_INSTALL_DATA_DIR)
#-----------------------------------------------------------------------------
@@ -201,7 +207,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")
@@ -275,10 +281,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 ?
@@ -468,7 +474,7 @@ ENDIF (CMAKE_COMPILER_IS_GNUCXX)
#-----------------------------------------------------------------------------
# All libs/tests/examples need the main include directories
#-----------------------------------------------------------------------------
-INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR})
+INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
#-----------------------------------------------------------------------------
# Option to Enable MPI Parallel
@@ -553,7 +559,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)
@@ -593,7 +599,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)
@@ -612,7 +618,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")
@@ -816,8 +822,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_CMAKE_DIR}/${HDF5_PACKAGE}
+ FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake
COMPONENT configinstall
)
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
@@ -828,7 +834,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)
@@ -845,20 +851,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_CMAKE_DIR}/${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_CMAKE_DIR}/${HDF5_PACKAGE}
COMPONENT configinstall
)
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
@@ -869,11 +890,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_CMAKE_DIR}/${HDF5_PACKAGE}
COMPONENT configinstall
)
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
@@ -892,7 +913,7 @@ CONFIGURE_FILE (
)
INSTALL (
FILES ${HDF5_BINARY_DIR}/libhdf5.settings
- DESTINATION ${HDF5_INSTALL_LIB_DIR}
+ DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE}
COMPONENT libraries
)
@@ -970,7 +991,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")