summaryrefslogtreecommitdiffstats
path: root/CMakeInstallation.cmake
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2023-08-18 21:01:15 (GMT)
committerGitHub <noreply@github.com>2023-08-18 21:01:15 (GMT)
commitffde055be2995ea62ee5ccbcb9c3a838b1fed229 (patch)
treeb1803c5327da01f286cb217437cb48801ad5c21c /CMakeInstallation.cmake
parent81830c1dedf6a1fb606232a3bb369cbdef65508d (diff)
downloadhdf5-ffde055be2995ea62ee5ccbcb9c3a838b1fed229.zip
hdf5-ffde055be2995ea62ee5ccbcb9c3a838b1fed229.tar.gz
hdf5-ffde055be2995ea62ee5ccbcb9c3a838b1fed229.tar.bz2
Update presets, examples uncompress, szip cache (#3391)
Diffstat (limited to 'CMakeInstallation.cmake')
-rw-r--r--CMakeInstallation.cmake40
1 files changed, 22 insertions, 18 deletions
diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake
index cc7d219..c7b6a1f 100644
--- a/CMakeInstallation.cmake
+++ b/CMakeInstallation.cmake
@@ -154,13 +154,20 @@ if (HDF5_PACK_EXAMPLES)
option (EXAMPLES_USE_RELEASE_NAME "Use the released examples artifact name" OFF)
option (EXAMPLES_DOWNLOAD "Download to use released examples files" OFF)
if (EXAMPLES_DOWNLOAD)
+ if (EXAMPLES_USE_RELEASE_NAME)
+ set (EXAMPLES_NAME ${EXAMPLES_TGZ_ORIGNAME})
+ else ()
+ set (EXAMPLES_NAME ${HDF5_EXAMPLES_COMPRESSED})
+ endif ()
if (NOT EXAMPLES_USE_LOCALCONTENT)
- set (EXAMPLES_URL ${EXAMPLES_TGZ_ORIGPATH}/${EXAMPLES_TGZ_ORIGNAME})
+ set (EXAMPLES_URL ${EXAMPLES_TGZ_ORIGPATH}/${EXAMPLES_NAME})
+ file (DOWNLOAD ${EXAMPLES_URL} ${HDF5_BINARY_DIR}/${HDF5_EXAMPLES_COMPRESSED} STATUS EX_DL)
+ message (STATUS "Examples file is ${EXAMPLES_URL} STATUS=${EX_DL}")
else ()
- set (EXAMPLES_URL ${TGZPATH}/${EXAMPLES_TGZ_ORIGNAME})
+ set (EXAMPLES_URL ${TGZPATH}/${EXAMPLES_NAME})
+ file (COPY_FILE ${EXAMPLES_URL} ${HDF5_BINARY_DIR}/${HDF5_EXAMPLES_COMPRESSED} RESULT EX_DL)
+ message (STATUS "Examples file is ${EXAMPLES_URL} RESULT=${EX_DL}")
endif ()
- message (VERBOSE "Examples file is ${EXAMPLES_URL}")
- file (DOWNLOAD ${EXAMPLES_URL} ${HDF5_BINARY_DIR}/${HDF5_EXAMPLES_COMPRESSED})
if (EXISTS "${HDF5_BINARY_DIR}/${HDF5_EXAMPLES_COMPRESSED}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xzf ${HDF5_EXAMPLES_COMPRESSED}
@@ -168,7 +175,6 @@ if (HDF5_PACK_EXAMPLES)
COMMAND_ECHO STDOUT
)
endif ()
- set (EXAMPLES_USE_RELEASE_NAME ON CACHE BOOL "" FORCE)
else ()
if (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}")
execute_process(
@@ -178,20 +184,18 @@ if (HDF5_PACK_EXAMPLES)
)
endif ()
endif ()
- if (EXAMPLES_USE_RELEASE_NAME)
- get_filename_component (EX_LAST_EXT ${HDF5_EXAMPLES_COMPRESSED} LAST_EXT)
- if (${EX_LAST_EXT} STREQUAL ".zip")
- get_filename_component (EX_DIR_NAME ${HDF5_EXAMPLES_COMPRESSED} NAME_WLE)
- else ()
- get_filename_component (EX_DIR_NAME ${HDF5_EXAMPLES_COMPRESSED} NAME_WLE)
- get_filename_component (EX_DIR_NAME ${EX_DIR_NAME} NAME_WLE)
- endif ()
- execute_process(
- COMMAND ${CMAKE_COMMAND} -E rename ${EX_DIR_NAME} HDF5Examples
- WORKING_DIRECTORY ${HDF5_BINARY_DIR}
- COMMAND_ECHO STDOUT
- )
+ get_filename_component (EX_LAST_EXT ${HDF5_EXAMPLES_COMPRESSED} LAST_EXT)
+ if (${EX_LAST_EXT} STREQUAL ".zip")
+ get_filename_component (EX_DIR_NAME ${HDF5_EXAMPLES_COMPRESSED} NAME_WLE)
+ else ()
+ get_filename_component (EX_DIR_NAME ${HDF5_EXAMPLES_COMPRESSED} NAME_WLE)
+ get_filename_component (EX_DIR_NAME ${EX_DIR_NAME} NAME_WLE)
endif ()
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E rename ${EX_DIR_NAME} HDF5Examples
+ WORKING_DIRECTORY ${HDF5_BINARY_DIR}
+ COMMAND_ECHO STDOUT
+ )
install (
DIRECTORY ${HDF5_BINARY_DIR}/HDF5Examples
DESTINATION ${HDF5_INSTALL_DATA_DIR}