Skip to content

Commit

Permalink
Sync CMake changes from develop
Browse files Browse the repository at this point in the history
Guard test dirs with HDF5_EXTERNALLY_CONFIGURED
Add toolchain support to examples testing
  • Loading branch information
byrnHDF committed Oct 31, 2023
1 parent 71d8975 commit e2a3f85
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 35 deletions.
10 changes: 7 additions & 3 deletions CMakeInstallation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ install (
#-----------------------------------------------------------------------------
option (HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF)
if (HDF5_PACK_EXAMPLES)
if (DEFINED CMAKE_TOOLCHAIN_FILE)
get_filename_component(TOOLCHAIN ${CMAKE_TOOLCHAIN_FILE} NAME)
set(CTEST_TOOLCHAIN_FILE "\${CTEST_SOURCE_DIRECTORY}/config/toolchain/${TOOLCHAIN}")
endif ()
configure_file (
${HDF_RESOURCES_DIR}/examples/HDF5_Examples.cmake.in
${HDF5_BINARY_DIR}/HDF5_Examples.cmake @ONLY
Expand Down Expand Up @@ -295,10 +299,10 @@ endif ()
if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
set (CPACK_PACKAGE_VENDOR "HDF_Group")
set (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}")
if (CDASH_LOCAL)
set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}")
else ()
if (NOT WIN32 OR HDF5_VERS_SUBRELEASE MATCHES "^[0-9]+$")
set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION_STRING}")
else ()
set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}")
endif ()
set (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}")
Expand Down
12 changes: 2 additions & 10 deletions CTestConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,12 @@ set (CTEST_DROP_METHOD "https")
if (CTEST_DROP_SITE_INIT)
set (CTEST_DROP_SITE "${CTEST_DROP_SITE_INIT}")
else ()
if (CDASH_LOCAL)
set (CTEST_DROP_SITE "cdash-internal.hdfgroup.org")
else ()
set (CTEST_DROP_SITE "cdash.hdfgroup.org")
endif ()
set (CTEST_DROP_SITE "cdash.hdfgroup.org")
endif ()
if (CTEST_DROP_LOCATION_INIT)
set (CTEST_DROP_LOCATION "${CTEST_DROP_LOCATION_INIT}")
else ()
if (CDASH_LOCAL)
set (CTEST_DROP_LOCATION "/submit.php?project=HDF5114")
else ()
set (CTEST_DROP_LOCATION "/submit.php?project=HDF5114")
endif ()
set (CTEST_DROP_LOCATION "/submit.php?project=HDF5114")
endif ()
set (CTEST_DROP_SITE_CDASH TRUE)

Expand Down
2 changes: 1 addition & 1 deletion c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ endif ()
#-----------------------------------------------------------------------------
# Build the CPP unit tests
#-----------------------------------------------------------------------------
if (BUILD_TESTING)
if (NOT HDF5_EXTERNALLY_CONFIGURED AND BUILD_TESTING)
add_subdirectory (test)
endif ()
6 changes: 3 additions & 3 deletions config/cmake/LIBAEC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@ configure_file (${LIBAEC_SOURCE_DIR}/README.md ${LIBAEC_BINARY_DIR}/LIBAEC_READM
if (NOT LIBAEC_EXTERNALLY_CONFIGURED)
set (CPACK_PACKAGE_VENDOR "HDF_Group")
set (CPACK_PACKAGE_NAME "${LIBAEC_PACKAGE_NAME}")
if (CDASH_LOCAL)
set (CPACK_PACKAGE_VERSION "${LIBAEC_PACKAGE_VERSION}")
else ()
if (NOT WIN32 OR LIBAEC_VERS_SUBRELEASE MATCHES "^[0-9]+$")
set (CPACK_PACKAGE_VERSION "${LIBAEC_PACKAGE_VERSION_STRING}")
else ()
set (CPACK_PACKAGE_VERSION "${LIBAEC_PACKAGE_VERSION}")
endif ()
set (CPACK_PACKAGE_VERSION_MAJOR "${LIBAEC_PACKAGE_VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION_MINOR "${LIBAEC_PACKAGE_VERSION_MINOR}")
Expand Down
6 changes: 3 additions & 3 deletions config/cmake/ZLIB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ configure_file (${ZLIB_SOURCE_DIR}/README ${ZLIB_BINARY_DIR}/ZLIB_README @ONLY)
if (NOT ZLIB_EXTERNALLY_CONFIGURED)
set (CPACK_PACKAGE_VENDOR "HDF_Group")
set (CPACK_PACKAGE_NAME "${ZLIB_PACKAGE_NAME}")
if (CDASH_LOCAL)
set (CPACK_PACKAGE_VERSION "${ZLIB_PACKAGE_VERSION}")
else ()
if (NOT WIN32 OR ZLIB_VERS_SUBRELEASE MATCHES "^[0-9]+$")
set (CPACK_PACKAGE_VERSION "${ZLIB_PACKAGE_VERSION_STRING}")
else ()
set (CPACK_PACKAGE_VERSION "${ZLIB_PACKAGE_VERSION}")
endif ()
set (CPACK_PACKAGE_VERSION_MAJOR "${ZLIB_PACKAGE_VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION_MINOR "${ZLIB_PACKAGE_VERSION_MINOR}")
Expand Down
2 changes: 1 addition & 1 deletion config/cmake/cacheinit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ set (PLUGIN_USE_LOCALCONTENT ON CACHE BOOL "Use local file for PLUGIN FetchConte
set (PLUGIN_PACKAGE_NAME "pl" CACHE STRING "Name of PLUGIN package" FORCE)
set (H5PL_VERS_MAJOR "1" CACHE STRING "Major version of hdf5 package for PLUGIN package" FORCE)
set (H5PL_VERS_MINOR "14" CACHE STRING "Minor version of hdf5 package for PLUGIN package" FORCE)
set (H5PL_VERS_RELEASE "3" CACHE STRING "Release version of hdf5 package for PLUGIN package" FORCE)
set (H5PL_VERS_RELEASE "4" CACHE STRING "Release version of hdf5 package for PLUGIN package" FORCE)

#############
# bitshuffle
Expand Down
15 changes: 7 additions & 8 deletions config/cmake/examples/HDF5_Examples.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
#INSTALLDIR - HDF5 root folder
#CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo
#CTEST_SOURCE_NAME - name of source folder; HDF5Examples
#CTEST_TOOLCHAIN_FILE - name and path in source of toolchain file
if(DEFINED CTEST_SCRIPT_ARG)
# transform ctest script arguments of the form
# script.ctest,var1=value1,var2=value2
Expand Down Expand Up @@ -62,11 +63,6 @@ if(NOT DEFINED CTEST_SOURCE_NAME)
set(CTEST_SOURCE_NAME "HDF5Examples")
endif()

if(NOT DEFINED HDF_LOCAL)
set(CDASH_LOCAL "NO")
else()
set(CDASH_LOCAL "YES")
endif()
if(NOT DEFINED CTEST_SITE)
set(CTEST_SITE "local")
endif()
Expand Down Expand Up @@ -100,10 +96,13 @@ else()
endif()
### default HDF5_PLUGIN_PATH to where the filter libraries are located
set(ENV{HDF5_PLUGIN_PATH} "${INSTALLDIR}/lib/plugin")
if(${CDASH_LOCAL})
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON")
endif()
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@")
### use a toolchain file (supported everywhere) ####
if(NOT DEFINED CTEST_TOOLCHAIN_FILE)
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=@CTEST_TOOLCHAIN_FILE@")
else()
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=${CTEST_TOOLCHAIN_FILE}")
endif()

###############################################################################################################
# For any comments please contact [email protected]
Expand Down
13 changes: 13 additions & 0 deletions config/cmake/examples/HDF5_Examples_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@
### build with shared libraries
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON")

#############################################################################################
#### maximum parallel processor count for build and test ####
#set(MAX_PROC_COUNT 8)

#############################################################################################
#### alternate toolsets (Windows usually) ####
#set(CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler 17.0")

#############################################################################################
### use a toolchain file (supported everywhere) ####
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/clang.cmake")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/intel.cmake")

#############################################################################################
#### languages ####
### disable C builds
Expand Down
1 change: 0 additions & 1 deletion config/cmake/scripts/HDF5options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#############################################################################################
### use a toolchain file (supported everywhere) ####

#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/intel.cmake")

#############################################################################################
Expand Down
1 change: 1 addition & 0 deletions config/sanitizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,4 @@ file(GLOB_RECURSE CMAKE_FILES
cmake_format(TARGET_NAME ${CMAKE_FILES})
```

2 changes: 1 addition & 1 deletion fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endif ()
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if (BUILD_TESTING)
if (NOT HDF5_EXTERNALLY_CONFIGURED AND BUILD_TESTING)
add_subdirectory (test)
if (MPI_Fortran_FOUND)
add_subdirectory (testpar)
Expand Down
2 changes: 1 addition & 1 deletion hl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ if (HDF5_BUILD_EXAMPLES)
endif ()

#-- Build the Unit testing if requested
if (BUILD_TESTING AND HDF5_TEST_SERIAL)
if (HDF5_EXTERNALLY_CONFIGURED AND BUILD_TESTING AND HDF5_TEST_SERIAL)
add_subdirectory (test)
endif ()
2 changes: 1 addition & 1 deletion java/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ endif ()
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if (BUILD_TESTING)
if (NOT HDF5_EXTERNALLY_CONFIGURED AND BUILD_TESTING)
add_subdirectory (test)
endif ()

Expand Down
2 changes: 1 addition & 1 deletion tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ add_subdirectory (lib)
add_subdirectory (src)

#-- Add the tests
if (BUILD_TESTING)
if (NOT HDF5_EXTERNALLY_CONFIGURED AND BUILD_TESTING)
add_subdirectory (test)

# --------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 3.18)
project (HDF5_UTILS C)

if (BUILD_TESTING)
if (NOT HDF5_EXTERNALLY_CONFIGURED AND BUILD_TESTING)
add_subdirectory (test)
endif ()

Expand Down

0 comments on commit e2a3f85

Please sign in to comment.