Warning, /frameworks/extra-cmake-modules/find-modules/Find7z.cmake is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2019, 2021 Friedrich W. H. Kossebau <kossebau@kde.org>
0002 #
0003 # SPDX-License-Identifier: BSD-3-Clause
0004 
0005 #[=======================================================================[.rst:
0006 Find7z
0007 ------
0008 
0009 Try to find 7z.
0010 
0011 If the 7z executable is not in your PATH, you can provide
0012 an alternative name or full path location with the ``7z_EXECUTABLE``
0013 variable.
0014 
0015 This will define the following variables:
0016 
0017 ``7z_FOUND``
0018     TRUE if 7z is available
0019 
0020 ``7z_EXECUTABLE``
0021     Path to 7z executable
0022 
0023 If ``7z_FOUND`` is TRUE, it will also define the following imported
0024 target:
0025 
0026 ``7z::7z``
0027     Path to 7z executable
0028 
0029 .. note::
0030     Only works on Windows.
0031 
0032 Deprecated: since 5.113, use  :find-module:`Find7Zip`.
0033 
0034 Since 5.85.0.
0035 #]=======================================================================]
0036 
0037 find_program(7z_EXECUTABLE NAMES 7z.exe 7za.exe)
0038 
0039 include(FindPackageHandleStandardArgs)
0040 find_package_handle_standard_args(7z
0041     FOUND_VAR
0042         7z_FOUND
0043     REQUIRED_VARS
0044         7z_EXECUTABLE
0045 )
0046 mark_as_advanced(7z_EXECUTABLE)
0047 
0048 if(NOT TARGET 7z::7z AND 7z_FOUND)
0049     add_executable(7z::7z IMPORTED)
0050     set_target_properties(7z::7z PROPERTIES
0051         IMPORTED_LOCATION "${7z_EXECUTABLE}"
0052     )
0053 endif()
0054 
0055 include(FeatureSummary)
0056 set_package_properties(7z PROPERTIES
0057     URL "https://www.7-zip.org/"
0058     DESCRIPTION "Data (de)compression program"
0059 )