CQtDeployer/CMakeLists.txt

87 lines
2.6 KiB
CMake
Raw Normal View History

2020-06-30 12:51:15 +03:00
#
2022-08-08 22:46:51 +03:00
# Copyright (C) 2020-2022 QuasarApp.
# 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} arledy included in main Project")
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
set(BUILD_SHARED_LIBS ON)
2022-08-08 22:46:51 +03:00
2022-08-13 21:37:08 +03:00
if (IOS)
set(BUILD_SHARED_LIBS OFF)
2022-08-08 22:46:51 +03:00
endif()
if (NOT QT_VERSION_MAJOR)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Test QUIET)
endif()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Test QUIET)
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}")
set(QIFW_VERSION "4.4")
2022-08-08 22:46:51 +03:00
2022-08-09 00:03:17 +03:00
option(CQT_DEPLOYER_TESTS "This option disables or enables tests of the ${PROJECT_NAME} project" ON)
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 availabel for wasm, android and ios platforms")
initAll()
return()
2022-08-08 22:46:51 +03:00
endif()
if (NOT QT_VERSION_MAJOR)
2022-08-09 00:03:17 +03:00
set(CQT_DEPLOYER_TOOL OFF CACHE BOOL "This option force disbled for Not Qt projects" FORCE)
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 disbled 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)
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-08-08 22:46:51 +03:00
endif()
2022-08-09 00:03:17 +03:00
if (CQT_DEPLOYER_TESTS)
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-08-08 22:46:51 +03:00
addDeployFromCustomFile("CQtDeployer" "${CMAKE_CURRENT_SOURCE_DIR}/Deploy/CQtDeployer.json")