CQtDeployer/CMakeLists.txt

96 lines
2.9 KiB
CMake
Raw Permalink Normal View History

2020-06-30 12:51:15 +03:00
#
2023-12-31 09:24:12 +01:00
# Copyright (C) 2020-2024 QuasarApp.
2022-08-08 22:46:51 +03:00
# Distributed under the GPLv3 software license, see the accompanying
2020-06-30 12:51:15 +03:00
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
2022-08-08 22:46:51 +03:00
cmake_minimum_required(VERSION 3.18)
project(CQtDeployer LANGUAGES CXX)
if(TARGET ${PROJECT_NAME})
message("The ${PROJECT_NAME} already included in main Project")
2022-08-08 22:46:51 +03:00
return()
endif()
2020-06-30 12:51:15 +03:00
2022-08-08 22:46:51 +03:00
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
2020-07-09 18:32:50 +03:00
2022-08-08 22:46:51 +03:00
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2022-08-13 21:37:08 +03:00
if (IOS)
2022-10-23 13:36:32 +03:00
option(BUILD_SHARED_LIBS "This option forece build ${PROJECT_NAME} as a shared project with separated libraries as" OFF)
2023-05-29 09:46:26 +02:00
else()
2022-10-23 13:36:32 +03:00
option(BUILD_SHARED_LIBS "This option forece build ${PROJECT_NAME} as a shared project with separated libraries as" ON)
2022-08-08 22:46:51 +03:00
endif()
2022-10-23 13:36:32 +03:00
2022-08-08 22:46:51 +03:00
if (NOT QT_VERSION_MAJOR)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Test QUIET)
2023-05-29 09:46:26 +02:00
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Test QUIET)
2022-08-08 22:46:51 +03:00
endif()
2022-08-09 00:03:17 +03:00
include(submodules/QuasarAppLib/CMake/QuasarApp.cmake)
2022-08-08 22:46:51 +03:00
updateGitVars()
2022-08-14 02:23:52 +03:00
string(TIMESTAMP TODAY "%Y-%m-%d")
set(CQT_DEPLOYER_VERSION_SHORT_PREFIX "1.6")
set(CQT_DEPLOYER_VERSION "${CQT_DEPLOYER_VERSION_SHORT_PREFIX}.${GIT_COMMIT_COUNT}.${GIT_COMMIT_HASH}")
2024-02-20 23:59:16 +01:00
set(QIFW_VERSION "4.7") # rebuild for the 4.7.0
2022-08-08 22:46:51 +03:00
2023-05-29 09:46:26 +02:00
option(CQT_DEPLOYER_TESTS "This option disables or enables tests of the ${PROJECT_NAME} project" ${Qt${QT_VERSION_MAJOR}Test_FOUND})
2022-08-09 00:03:17 +03:00
option(CQT_DEPLOYER_TOOL "This option disables or enables example app of the ${PROJECT_NAME} project" ON)
2020-06-30 12:51:15 +03:00
2022-08-08 22:46:51 +03:00
if (ANDROID OR IOS OR NOT QT_VERSION_MAJOR OR QA_WASM32)
message(WARNING "CQtDeployer is not available for wasm, android and ios platforms")
initAll()
return()
2022-08-08 22:46:51 +03:00
endif()
if (${QT_VERSION_MAJOR} LESS 6)
message(WARNING "CQtDeployer tests is not available for qt5. Please build cqtdeployer with qt6")
set(CQT_DEPLOYER_TESTS OFF CACHE BOOL "This option force disabled for ANDROID IOS QA_WASM32 and Not Qt projects" FORCE)
endif()
2022-08-08 22:46:51 +03:00
make_directory(Distro)
2020-06-30 12:51:15 +03:00
initAll()
2022-08-09 00:03:17 +03:00
add_subdirectory(submodules/QuasarAppLib)
2022-08-13 20:34:51 +03:00
add_subdirectory(src/QtELFReader)
2022-10-22 17:24:05 +03:00
# disable command line tool of pe-parse
2022-08-13 20:34:51 +03:00
option(BUILD_COMMAND_LINE_TOOLS "Build Command Line Tools" OFF)
add_subdirectory(submodules/pe-parse)
add_subdirectory(submodules/zip)
2022-08-27 22:30:55 +03:00
add_subdirectory(src/Deploy)
2022-08-09 00:03:17 +03:00
if (DEFINED CQT_DEPLOYER_TOOL)
add_subdirectory(src/CQtDeployer)
2022-10-22 17:34:46 +03:00
else()
message("The ${PROJECT_NAME} console tool is disabled.")
2022-08-08 22:46:51 +03:00
endif()
2022-08-09 00:03:17 +03:00
if (CQT_DEPLOYER_TESTS)
2024-12-21 22:34:42 +01:00
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS WebEngineQuick)
2022-08-20 13:16:49 +03:00
add_subdirectory(testcases)
2022-08-08 22:46:51 +03:00
add_subdirectory(tests)
else()
message("The ${PROJECT_NAME} tests is disabled.")
endif()
2022-10-18 20:07:05 +03:00
configure_file_in("" "${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf")
2022-08-08 22:46:51 +03:00
2020-10-22 09:38:00 +03:00
addDoc(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)
2022-10-23 13:36:32 +03:00
install(TARGETS CQtDeployer
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})