1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

Meta: Remove some obsolete cmake version checks

We require CMake 3.25 nowadays.

No behavior change.
This commit is contained in:
Nico Weber 2024-01-29 14:53:00 -05:00 committed by Tim Flynn
parent 22ea2f638a
commit 17f37cbd8c
4 changed files with 11 additions and 72 deletions

View file

@ -258,30 +258,14 @@ endfunction()
function(extract_path dest_dir zip_path source_path dest_path)
if (EXISTS "${zip_path}" AND NOT EXISTS "${dest_path}")
if (CMAKE_VERSION VERSION_LESS 3.18.0)
message(STATUS "Extracting using ${UNZIP_TOOL} ${source_path} from ${zip_path}")
execute_process(COMMAND "${UNZIP_TOOL}" -q "${zip_path}" "${source_path}" -d "${dest_dir}" RESULT_VARIABLE unzip_result)
if (NOT unzip_result EQUAL 0)
message(FATAL_ERROR "Failed to unzip ${source_path} from ${zip_path} with status ${unzip_result}")
endif()
else()
message(STATUS "Extracting using cmake ${source_path}")
file(ARCHIVE_EXTRACT INPUT "${zip_path}" DESTINATION "${dest_dir}" PATTERNS "${source_path}")
endif()
message(STATUS "Extracting using cmake ${source_path}")
file(ARCHIVE_EXTRACT INPUT "${zip_path}" DESTINATION "${dest_dir}" PATTERNS "${source_path}")
endif()
endfunction()
function(extract_tar_path dest_dir tar_path source_path dest_path)
if (EXISTS "${tar_path}" AND NOT EXISTS "${dest_path}")
if (CMAKE_VERSION VERSION_LESS 3.18.0)
message(STATUS "Extracting using ${TAR_TOOL} ${source_path} from ${tar_path}")
execute_process(COMMAND "${TAR_TOOL}" -xf "${tar_path}" -C "${dest_dir}" "${source_path}" RESULT_VARIABLE untar_result)
if (NOT untar_result EQUAL 0)
message(FATAL_ERROR "Failed to untar ${source_path} from ${tar_path} with status ${untar_result}")
endif()
else()
message(STATUS "Extracting using cmake ${source_path}")
file(ARCHIVE_EXTRACT INPUT "${tar_path}" DESTINATION "${dest_dir}" PATTERNS "${source_path}")
endif()
message(STATUS "Extracting using cmake ${source_path}")
file(ARCHIVE_EXTRACT INPUT "${tar_path}" DESTINATION "${dest_dir}" PATTERNS "${source_path}")
endif()
endfunction()