summaryrefslogtreecommitdiffstats
path: root/config/cmake
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2022-10-25 15:50:43 (GMT)
committerGitHub <noreply@github.com>2022-10-25 15:50:43 (GMT)
commitea902f9acefec5303cb3e3527d4472e97956a122 (patch)
tree80be2bb4a7e373a81d8bde511e361d3cd8bfcdca /config/cmake
parentf98c93ab193bd7258f165de8c61a1809087975ee (diff)
downloadhdf5-ea902f9acefec5303cb3e3527d4472e97956a122.zip
hdf5-ea902f9acefec5303cb3e3527d4472e97956a122.tar.gz
hdf5-ea902f9acefec5303cb3e3527d4472e97956a122.tar.bz2
Implement option for using CMake GNUInstallDirs (#2175)
* Implement option for using CMake GNUInstallDirs * Add release notes
Diffstat (limited to 'config/cmake')
-rw-r--r--config/cmake/HDF5PluginCache.cmake2
-rw-r--r--config/cmake/HDF5PluginMacros.cmake5
-rw-r--r--config/cmake/HDFLibMacros.cmake12
-rw-r--r--config/cmake/HDFMacros.cmake74
-rw-r--r--config/cmake/cacheinit.cmake11
-rw-r--r--config/cmake/scripts/CTestScript.cmake2
-rw-r--r--config/cmake/scripts/HDF5options.cmake1
7 files changed, 86 insertions, 21 deletions
diff --git a/config/cmake/HDF5PluginCache.cmake b/config/cmake/HDF5PluginCache.cmake
index 6b4846f..e676919 100644
--- a/config/cmake/HDF5PluginCache.cmake
+++ b/config/cmake/HDF5PluginCache.cmake
@@ -27,3 +27,5 @@ set (H5PL_TGZ_NAME "${PLUGIN_TGZ_NAME}" CACHE STRING "Use plugins from compresse
set (PL_PACKAGE_NAME "${PLUGIN_PACKAGE_NAME}" CACHE STRING "Name of plugins package" 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 ba1f56f..a180d5d 100644
--- a/config/cmake/HDF5PluginMacros.cmake
+++ b/config/cmake/HDF5PluginMacros.cmake
@@ -65,6 +65,11 @@ macro (EXTERNAL_PLUGIN_LIBRARY compress_type)
add_dependencies (h5ex_d_zfp ${HDF5_LIBSH_TARGET})
target_include_directories (h5ex_d_zfp PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${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 ()
message (VERBOSE "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}")
set (PLUGIN_BINARY_DIR "${plugin_BINARY_DIR}")
diff --git a/config/cmake/HDFLibMacros.cmake b/config/cmake/HDFLibMacros.cmake
index bbb5758..51e16c1 100644
--- a/config/cmake/HDFLibMacros.cmake
+++ b/config/cmake/HDFLibMacros.cmake
@@ -31,6 +31,8 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-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}
)
@@ -51,6 +53,8 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-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}
)
@@ -107,6 +111,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}
)
@@ -132,6 +138,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}
)
@@ -208,6 +216,8 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-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}
)
@@ -228,6 +238,8 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-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}
)
diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake
index f91c537..1af513b 100644
--- a/config/cmake/HDFMacros.cmake
+++ b/config/cmake/HDFMacros.cmake
@@ -12,28 +12,28 @@
#-------------------------------------------------------------------------------
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)
message (VERBOSE "Setting build type to 'RelWithDebInfo' as none was specified.")
- 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" "Developer")
- endif()
+ endif ()
endmacro ()
#-------------------------------------------------------------------------------
@@ -43,7 +43,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)
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/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake
index f1dd662..76bab18 100644
--- a/config/cmake/scripts/CTestScript.cmake
+++ b/config/cmake/scripts/CTestScript.cmake
@@ -51,7 +51,7 @@ endif ()
set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
# Launchers work only with Makefile and Ninja generators.
-if(NOT "${CTEST_CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+if(NOT "${CTEST_CMAKE_GENERATOR}" MATCHES "Make|Ninja" OR LOCAL_SKIP_TEST)
set(CTEST_USE_LAUNCHERS 0)
set(ENV{CTEST_USE_LAUNCHERS_DEFAULT} 0)
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=OFF")
diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake
index bab60de..7a5d327 100644
--- a/config/cmake/scripts/HDF5options.cmake
+++ b/config/cmake/scripts/HDF5options.cmake
@@ -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")
#############################################################################################