view cmake/FindQtIFW.cmake @ 624:01e01777ff50

CMake: initial import of CMake modules, closes #720
author David Demelier <markand@malikania.fr>
date Fri, 20 Oct 2017 14:18:37 +0200
parents
children
line wrap: on
line source

# FindQtIFW
# ---------
#
# Find Qt Installer Framework, this module defines:
#
# QtIFW_CREATOR, where to find binarycreator.exe
# QtIFW_ARCHIVEGEN, where to find archivegen.exe
# QtIFW_FOUND, if the InnoSetup installation was found
#
# This module also defines the following macros:
#
# qtifw_create(
#    OUTPUT installerfile
#    CONFIG configuration file
#    PACKAGES packages directory
#    [TARGET name]
#    [SOURCES sources ...]
#    [DEPENDS dependencies ...]
#    [RESOURCES resources ...]
#    [ONLINE|OFFLINE]
#    [ARGS args ...]
# )
#
# This function adds a new custom command that generate the installer file specified by OUTPUT.
#
# The CONFIG and PACKAGES parameters are equivalent to -c and -p options respectively.
#
# You can add optional dependencies to the custom command with the DEPENDS parameter.
#
# If TARGET is specified, an additional target is created with the supplied name, the output file will be added as
# target dependency and optional sources files can be listed in the SOURCES parameter.
#
# You can specify .qrc files to be bundled with the RESOURCES parameter.
#
# The ONLINE and OFFLINE parameters are equivalent to -n and -f options respectively. They are mutually exclusive.
#
# If you need to pass additional arguments to binarycreator, you can use the ARGS parameter.
#
# qtifw_archive(
#    OUTPUT archive.7z
#    SOURCES sources ...
#    [TARGET name]
#    [DEPENDS dependencies ...]
# )
#
# This function adds a new custom command that generate .7z files using QtIFW's archivegen tool.
#
# The output file must be specified by OUTPUT, sources can be either files or directories specified by SOURCES.
#
# If TARGET is specified, an additional target is created with the supplied name, the output file will be added as
# target dependency and source files will also be listed.
#
# You can add optional dependencies to the custom command with the DEPENDS parameter.
#

find_program(
       QtIFW_CREATOR
       NAMES binarycreator
       DOC "QtIFW binarycreator executable"
)

find_program(
    QtIFW_ARCHIVEGEN
    NAMES archivegen
    DOC "QtIFW archivegen executable"
)

include(CMakeParseArguments)
include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(
       QtIFW
       FOUND_VAR QtIFW_FOUND
       REQUIRED_VARS QtIFW_CREATOR QtIFW_ARCHIVEGEN
)

if (QtIFW_FOUND)
    function (qtifw_create)
    
    endfunction ()
endif ()

mark_as_advanced(QtIFW_CREATOR)