diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2022-11-04 15:37:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-04 15:37:17 (GMT) |
commit | 52854566ecad891ee60458777932539d3edab6e0 (patch) | |
tree | acf73fd6f48220b972e0c53ecccb18bee072dff5 /config | |
parent | 7a1885451213244da0b244338435830fc4dd6ea1 (diff) | |
download | hdf5-52854566ecad891ee60458777932539d3edab6e0.zip hdf5-52854566ecad891ee60458777932539d3edab6e0.tar.gz hdf5-52854566ecad891ee60458777932539d3edab6e0.tar.bz2 |
1.12 Merge HDFGroup#2175 Implement option for using CMake GNUInstallDirs (#2221)
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/CTestScript.cmake | 2 | ||||
-rw-r--r-- | config/cmake/HDF5PluginCache.cmake | 32 | ||||
-rw-r--r-- | config/cmake/HDF5PluginMacros.cmake | 5 | ||||
-rw-r--r-- | config/cmake/cacheinit.cmake | 11 | ||||
-rw-r--r-- | config/cmake/scripts/HDF5options.cmake | 3 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFLibMacros.cmake | 22 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFMacros.cmake | 86 |
7 files changed, 117 insertions, 44 deletions
diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake index 0ed9063..dcf2685 100644 --- a/config/cmake/CTestScript.cmake +++ b/config/cmake/CTestScript.cmake @@ -54,7 +54,7 @@ else () endif () #----------------------------------------------------------------------------- -# MAC machines need special option +# MacOS machines need special options #----------------------------------------------------------------------------- if (APPLE) # Compiler choice diff --git a/config/cmake/HDF5PluginCache.cmake b/config/cmake/HDF5PluginCache.cmake index 3b085dd..f5334bb 100644 --- a/config/cmake/HDF5PluginCache.cmake +++ b/config/cmake/HDF5PluginCache.cmake @@ -1,29 +1,31 @@ -# This is the CMakeCache file. +# CMake cache file for external HDF5 filter plugins -######################## +######################### # EXTERNAL cache entries -######################## +######################### # examples are the tests for plugins -set (H5PL_BUILD_TESTING ON CACHE BOOL "Enable h5pl testing" FORCE) -set (BUILD_EXAMPLES ON CACHE BOOL "Build h5pl Examples" FORCE) +set (H5PL_BUILD_TESTING ON CACHE BOOL "Enable H5PL testing" FORCE) +set (BUILD_EXAMPLES ON CACHE BOOL "Build H5PL Examples" FORCE) -set (HDF5_HDF5_HEADER "h5pubconf.h" CACHE STRING "Name of HDF5 header" FORCE) -set (HDF5_LINK_LIBS ${HDF5_LIBSH_TARGET} CACHE STRING "hdf5 target" FORCE) -#set (HDF5_INCLUDE_DIR $<TARGET_PROPERTY:${HDF5_LIBSH_TARGET},INCLUDE_DIRECTORIES> CACHE PATH "hdf5 include dirs" FORCE) -set (HDF5_INCLUDE_DIR "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}" CACHE PATH "hdf5 include dirs" FORCE) -set (HDF5_INCLUDE_DIRS "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}" CACHE PATH "hdf5 include dirs" FORCE) -set (HDF5_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "hdf5 build folder" FORCE) +set (HDF5_HDF5_HEADER "H5pubconf.h" CACHE STRING "Name of HDF5 header" FORCE) +set (HDF5_LINK_LIBS ${HDF5_LIBSH_TARGET} CACHE STRING "HDF5 target" FORCE) +#set (HDF5_INCLUDE_DIR $<TARGET_PROPERTY:${HDF5_LIBSH_TARGET},INCLUDE_DIRECTORIES> CACHE PATH "HDF5 include dirs" FORCE) +set (HDF5_INCLUDE_DIR "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}" CACHE PATH "HDF5 include dirs" FORCE) +set (HDF5_INCLUDE_DIRS "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}" CACHE PATH "HDF5 include dirs" FORCE) +set (HDF5_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "HDF5 build folder" FORCE) -set (HDF5_DUMP_EXECUTABLE $<TARGET_FILE:h5dump-shared> CACHE STRING "hdf5 h5dump target" FORCE) -set (HDF5_REPACK_EXECUTABLE $<TARGET_FILE:h5repack-shared> CACHE STRING "hdf5 h5repack target" FORCE) +set (HDF5_DUMP_EXECUTABLE $<TARGET_FILE:h5dump-shared> CACHE STRING "HDF5 h5dump target" FORCE) +set (HDF5_REPACK_EXECUTABLE $<TARGET_FILE:h5repack-shared> CACHE STRING "HDF5 h5repack target" FORCE) set (H5PL_ALLOW_EXTERNAL_SUPPORT "${HDF5_ALLOW_EXTERNAL_SUPPORT}" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) -set (H5PL_GIT_URL "https://github.com/HDFGroup/hdf5_plugins.git" CACHE STRING "Use plugins from HDF repository" FORCE) +set (H5PL_GIT_URL "https://github.com/HDFGroup/hdf5_plugins.git" CACHE STRING "Use plugins from HDF Group repository" FORCE) set (H5PL_GIT_BRANCH "master" CACHE STRING "" FORCE) set (H5PL_TGZ_NAME "${PLUGIN_TGZ_NAME}" CACHE STRING "Use plugins from compressed file" FORCE) set (PL_PACKAGE_NAME "${PLUGIN_PACKAGE_NAME}" CACHE STRING "Name of plugins package" FORCE) -set (H5PL_CPACK_ENABLE OFF CACHE BOOL "Enable the CPACK include and components" FORCE) +set (H5PL_CPACK_ENABLE OFF CACHE BOOL "Enable CPack include and components" FORCE) + +set (H5PL_USE_GNU_DIRS ${HDF5_USE_GNU_DIRS} CACHE BOOL "TRUE to use GNU Coding Standard install directory variables" FORCE) diff --git a/config/cmake/HDF5PluginMacros.cmake b/config/cmake/HDF5PluginMacros.cmake index dbed15c..5cb5f99 100644 --- a/config/cmake/HDF5PluginMacros.cmake +++ b/config/cmake/HDF5PluginMacros.cmake @@ -67,6 +67,11 @@ macro (EXTERNAL_PLUGIN_LIBRARY compress_type) add_dependencies (h5ex_d_zfp ${HDF5_LIBSH_TARGET}) target_include_directories (h5ex_d_zfp PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") endif () + if (ENABLE_ZSTD) + add_dependencies (h5zstd ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_zstd ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_zstd PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR}") + endif () endif () if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") message (VERBOSE "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index de6f92f..faa0533 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -181,3 +181,14 @@ set (ZFP_TGZ_NAME "zfp.tar.gz" CACHE STRING "Use ZFP from compressed file" FORCE set (ZFP_PACKAGE_NAME "zfp" CACHE STRING "Name of ZFP package" FORCE) +###### +# zstd +###### + +set (ZSTD_GIT_URL "https://github.com/facebook/zstd" CACHE STRING "Use ZSTD from repository" FORCE) +set (ZSTD_GIT_BRANCH "dev" CACHE STRING "" FORCE) + +set (ZSTD_TGZ_NAME "zstd.tar.gz" CACHE STRING "Use ZSTD from compressed file" FORCE) + +set (ZSTD_PACKAGE_NAME "zstd" CACHE STRING "Name of ZSTD package" FORCE) + diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index bab60de..e14dfba 100644 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -74,7 +74,7 @@ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRIN #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") #### package examples #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-2.0.1-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}") +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-2.0.2-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}") ############################################################################################# ### enable parallel builds @@ -96,6 +96,7 @@ endif() ############################################################################################# ### disable test program builds +#If using CTestScript.cmake file be sure to uncomment set (LOCAL_SKIP_TEST "TRUE") #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") ############################################################################################# diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 2c5a9bf..740ddae 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -24,12 +24,15 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_DEBUG_POSTFIX:STRING=${CMAKE_DEBUG_POSTFIX} -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} + -DHDF_USE_GNU_DIRS:STRING=${HDF5_USE_GNU_DIRS} + -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) @@ -43,12 +46,15 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_DEBUG_POSTFIX:STRING=${CMAKE_DEBUG_POSTFIX} -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} + -DHDF_USE_GNU_DIRS:STRING=${HDF5_USE_GNU_DIRS} + -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) @@ -93,6 +99,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_DEBUG_POSTFIX:STRING=${CMAKE_DEBUG_POSTFIX} -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} @@ -100,6 +107,8 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} + -DHDF_USE_GNU_DIRS:STRING=${HDF5_USE_GNU_DIRS} + -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) @@ -113,6 +122,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_DEBUG_POSTFIX:STRING=${CMAKE_DEBUG_POSTFIX} -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} @@ -120,6 +130,8 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} + -DHDF_USE_GNU_DIRS:STRING=${HDF5_USE_GNU_DIRS} + -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) @@ -184,12 +196,15 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_DEBUG_POSTFIX:STRING=${CMAKE_DEBUG_POSTFIX} -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} + -DHDF_USE_GNU_DIRS:STRING=${HDF5_USE_GNU_DIRS} + -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) @@ -203,19 +218,24 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_DEBUG_POSTFIX:STRING=${CMAKE_DEBUG_POSTFIX} -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} + -DHDF_USE_GNU_DIRS:STRING=${HDF5_USE_GNU_DIRS} + -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) endif () externalproject_get_property (HDF5_ZLIB BINARY_DIR SOURCE_DIR) - set (ZLIB_LIB_NAME "z") + if (NOT ZLIB_LIB_NAME) + set (ZLIB_LIB_NAME "z") + endif () ##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target zlib-static add_library(${HDF_PACKAGE_NAMESPACE}zlib-static STATIC IMPORTED) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 6f517bd..863b7ba 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -12,30 +12,30 @@ #------------------------------------------------------------------------------- macro (SET_HDF_BUILD_TYPE) - get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) - if(_isMultiConfig) - set(HDF_CFG_NAME ${CMAKE_BUILD_TYPE}) - set(HDF_BUILD_TYPE ${CMAKE_CFG_INTDIR}) - set(HDF_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) - else() - set(HDF_CFG_BUILD_TYPE ".") - if(CMAKE_BUILD_TYPE) - set(HDF_CFG_NAME ${CMAKE_BUILD_TYPE}) - set(HDF_BUILD_TYPE ${CMAKE_BUILD_TYPE}) - else() - set(HDF_CFG_NAME "Release") - set(HDF_BUILD_TYPE "Release") - endif() - endif() - if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + get_property (_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if (_isMultiConfig) + set (HDF_CFG_NAME ${CMAKE_BUILD_TYPE}) + set (HDF_BUILD_TYPE ${CMAKE_CFG_INTDIR}) + set (HDF_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) + else () + set (HDF_CFG_BUILD_TYPE ".") + if (CMAKE_BUILD_TYPE) + set (HDF_CFG_NAME ${CMAKE_BUILD_TYPE}) + set (HDF_BUILD_TYPE ${CMAKE_BUILD_TYPE}) + else () + set (HDF_CFG_NAME "Release") + set (HDF_BUILD_TYPE "Release") + endif () + endif () + if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") message (VERBOSE "Setting build type to 'RelWithDebInfo' as none was specified.") endif() - set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) + set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" + set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") - endif() + endif () endmacro () #------------------------------------------------------------------------------- @@ -45,7 +45,7 @@ endmacro () #------------------------------------------------------------------------------- macro (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) - #set(source_group_path "Source/AIM/${NAME}") + #set (source_group_path "Source/AIM/${NAME}") string (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) @@ -321,6 +321,36 @@ macro (HDFTEST_COPY_FILE src dest target) endmacro () macro (HDF_DIR_PATHS package_prefix) + option (HDF5_USE_GNU_DIRS "TRUE to use GNU Coding Standard install directory variables, FALSE to use historical settings" FALSE) + if (HDF5_USE_GNU_DIRS) + include(GNUInstallDirs) + if (NOT ${package_prefix}_INSTALL_BIN_DIR) + set (${package_prefix}_INSTALL_BIN_DIR ${CMAKE_INSTALL_BINDIR}) + endif () + if (NOT ${package_prefix}_INSTALL_LIB_DIR) + set (${package_prefix}_INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR}) + endif () + if (NOT ${package_prefix}_INSTALL_JAR_DIR) + set (${package_prefix}_INSTALL_JAR_DIR ${CMAKE_INSTALL_LIBDIR}) + endif () + if (NOT ${package_prefix}_INSTALL_INCLUDE_DIR) + set (${package_prefix}_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}) + endif () + if (NOT ${package_prefix}_INSTALL_MODULE_DIR) + set (${package_prefix}_INSTALL_MODULE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/mod) + endif () + if (NOT ${package_prefix}_INSTALL_DATA_DIR) + set (${package_prefix}_INSTALL_DATA_DIR ${CMAKE_INSTALL_DATADIR}) + endif () + if (NOT ${package_prefix}_INSTALL_CMAKE_DIR) + set (${package_prefix}_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake) + endif () + if (NOT ${package_prefix}_INSTALL_DOC_DIR) + set (${package_prefix}_INSTALL_DOC_DIR ${CMAKE_INSTALL_DOCDIR}) + endif () + message(STATUS "GNU: ${${package_prefix}_INSTALL_DOC_DIR}") + endif () + if (APPLE) option (${package_prefix}_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE) endif () @@ -365,6 +395,10 @@ macro (HDF_DIR_PATHS package_prefix) if (NOT ${package_prefix}_INSTALL_CMAKE_DIR) set (${package_prefix}_INSTALL_CMAKE_DIR cmake) endif () + if (NOT ${package_prefix}_INSTALL_DOC_DIR) + set (${package_prefix}_INSTALL_DOC_DIR ${${package_prefix}_INSTALL_DATA_DIR}) + endif () + message(STATUS "Final: ${${package_prefix}_INSTALL_DOC_DIR}") # Always use full RPATH, i.e. don't skip the full RPATH for the build tree set (CMAKE_SKIP_BUILD_RPATH FALSE) @@ -391,12 +425,12 @@ macro (HDF_DIR_PATHS package_prefix) endif () #set the default debug suffix for all library targets - if(NOT CMAKE_DEBUG_POSTFIX) - if (WIN32) - set (CMAKE_DEBUG_POSTFIX "_D") - else () - set (CMAKE_DEBUG_POSTFIX "_debug") - endif () + if(NOT CMAKE_DEBUG_POSTFIX) + if (WIN32) + set (CMAKE_DEBUG_POSTFIX "_D") + else () + set (CMAKE_DEBUG_POSTFIX "_debug") + endif () endif () SET_HDF_BUILD_TYPE() |