diff options
author | Friedrich W. H. Kossebau <kossebau@kde.org> | 2021-07-12 01:29:11 +0200 |
---|---|---|
committer | Friedrich W. H. Kossebau <kossebau@kde.org> | 2021-07-15 11:16:10 +0000 |
commit | a4af02255a5b9bd0200517796af3f1d36a51df79 (patch) | |
tree | 1468e82e8c6ef3f36e854ed532148dd3e048a11b | |
parent | 8ac2f4f798012203d770049eb4a4374a3c5390ed (diff) | |
download | extra-cmake-modules-a4af02255a5b9bd0200517796af3f1d36a51df79.tar.gz extra-cmake-modules-a4af02255a5b9bd0200517796af3f1d36a51df79.tar.bz2 |
Add Find7z & Findgzip
-rw-r--r-- | docs/find-module/Find7z.rst | 1 | ||||
-rw-r--r-- | docs/find-module/Findgzip.rst | 1 | ||||
-rw-r--r-- | find-modules/Find7z.cmake | 54 | ||||
-rw-r--r-- | find-modules/Findgzip.cmake | 54 |
4 files changed, 110 insertions, 0 deletions
diff --git a/docs/find-module/Find7z.rst b/docs/find-module/Find7z.rst new file mode 100644 index 00000000..a383a61c --- /dev/null +++ b/docs/find-module/Find7z.rst @@ -0,0 +1 @@ +.. ecm-module:: ../../find-modules/Find7z.cmake diff --git a/docs/find-module/Findgzip.rst b/docs/find-module/Findgzip.rst new file mode 100644 index 00000000..aad0c01f --- /dev/null +++ b/docs/find-module/Findgzip.rst @@ -0,0 +1 @@ +.. ecm-module:: ../../find-modules/Findgzip.cmake diff --git a/find-modules/Find7z.cmake b/find-modules/Find7z.cmake new file mode 100644 index 00000000..eaa544d5 --- /dev/null +++ b/find-modules/Find7z.cmake @@ -0,0 +1,54 @@ +# SPDX-FileCopyrightText: 2019, 2021 Friedrich W. H. Kossebau <kossebau@kde.org> +# +# SPDX-License-Identifier: BSD-3-Clause + +#[=======================================================================[.rst: +Find7z +------ + +Try to find 7z. + +If the 7z executable is not in your PATH, you can provide +an alternative name or full path location with the ``7z_EXECUTABLE`` +variable. + +This will define the following variables: + +``7z_FOUND`` + TRUE if 7z is available + +``7z_EXECUTABLE`` + Path to 7z executable + +If ``7z_FOUND`` is TRUE, it will also define the following imported +target: + +``7z::7z`` + Path to 7z executable + +Since 5.85.0. +#]=======================================================================] + +find_program(7z_EXECUTABLE NAMES 7z.exe 7za.exe) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(7z + FOUND_VAR + 7z_FOUND + REQUIRED_VARS + 7z_EXECUTABLE +) +mark_as_advanced(7z_EXECUTABLE) + +if(NOT TARGET 7z::7z AND 7z_FOUND) + add_executable(7z::7z IMPORTED) + set_target_properties(7z::7z PROPERTIES + IMPORTED_LOCATION "${7z_EXECUTABLE}" + ) +endif() + +include(FeatureSummary) +set_package_properties(7z PROPERTIES + URL "https://www.7-zip.org/" + DESCRIPTION "Data (de)compression program" +) diff --git a/find-modules/Findgzip.cmake b/find-modules/Findgzip.cmake new file mode 100644 index 00000000..095c3522 --- /dev/null +++ b/find-modules/Findgzip.cmake @@ -0,0 +1,54 @@ +# SPDX-FileCopyrightText: 2019, 2021 Friedrich W. H. Kossebau <kossebau@kde.org> +# +# SPDX-License-Identifier: BSD-3-Clause + +#[=======================================================================[.rst: +Findgzip +-------- + +Try to find gzip. + +If the gzip executable is not in your PATH, you can provide +an alternative name or full path location with the ``gzip_EXECUTABLE`` +variable. + +This will define the following variables: + +``gzip_FOUND`` + TRUE if gzip is available + +``gzip_EXECUTABLE`` + Path to gzip executable + +If ``gzip_FOUND`` is TRUE, it will also define the following imported +target: + +``gzip::gzip`` + Path to gzip executable + +Since 5.85.0. +#]=======================================================================] + +find_program(gzip_EXECUTABLE NAMES gzip) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(gzip + FOUND_VAR + gzip_FOUND + REQUIRED_VARS + gzip_EXECUTABLE +) +mark_as_advanced(gzip_EXECUTABLE) + +if(NOT TARGET gzip::gzip AND gzip_FOUND) + add_executable(gzip::gzip IMPORTED) + set_target_properties(gzip::gzip PROPERTIES + IMPORTED_LOCATION "${gzip_EXECUTABLE}" + ) +endif() + +include(FeatureSummary) +set_package_properties(gzip PROPERTIES + URL "https://www.gnu.org/software/gzip" + DESCRIPTION "Data compression program for the gzip format" +) |