4
0
mirror of https://github.com/QuasarApp/CMakeProject.git synced 2025-04-27 14:14:32 +00:00
CMakeProject/CMakeLists.txt

65 lines
1.7 KiB
CMake
Raw Normal View History

#
2023-12-31 09:47:56 +01:00
# Copyright (C) 2020-2024 QuasarApp.
# Distributed under the GPLv3 software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
2023-08-29 22:34:08 +02:00
cmake_minimum_required(VERSION 3.19)
2021-09-09 20:20:10 +03:00
project(RENAME_ME LANGUAGES CXX)
if(TARGET ${PROJECT_NAME})
message("The ${PROJECT_NAME} arledy included in main Project")
return()
endif()
2021-04-04 21:02:58 +03:00
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
2023-08-29 22:34:08 +02:00
set(CMAKE_CXX_STANDARD 20)
2021-04-04 21:02:58 +03:00
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2020-12-17 18:18:35 +03:00
2022-01-06 15:08:19 +03:00
if (ANDROID OR IOS)
2021-09-09 20:33:11 +03:00
set(BUILD_SHARED_LIBS ON)
endif()
2023-08-29 22:34:08 +02:00
find_package(Qt6 COMPONENTS Core REQUIRED)
find_package(Qt6 COMPONENTS Test QUIET)
2021-05-25 15:31:49 +03:00
include(submodules/CMake/QuasarApp.cmake)
2021-04-04 22:57:18 +03:00
2022-01-06 15:08:19 +03:00
updateGitVars()
set(RENAME_ME_VERSION "0.${GIT_COMMIT_COUNT}.${GIT_COMMIT_HASH}")
set(RENAME_ME_PACKAGE_ID "quasarapp.core.RENAME_ME")
2022-06-05 13:28:35 +03:00
option(RENAME_ME_TESTS "This option disables or enables tests of the ${PROJECT_NAME} project" ON)
option(RENAME_ME_EXAMPLE "This option disables or enables example app of the ${PROJECT_NAME} project" ON)
2020-09-05 13:30:56 +03:00
2023-08-29 22:34:08 +02:00
if (ANDROID OR IOS OR QA_WASM32)
2022-06-05 13:28:35 +03:00
set(RENAME_ME_TESTS OFF CACHE BOOL "This option force disbled for ANDROID IOS QA_WASM32 and Not Qt projects" FORCE)
endif()
2021-05-25 15:31:49 +03:00
2022-01-18 12:28:03 +03:00
make_directory(Distro)
2021-09-09 19:32:03 +03:00
initAll()
if (RENAME_ME_TESTS)
add_subdirectory(src/testcore)
endif()
2023-08-29 22:34:08 +02:00
add_subdirectory(src/RENAME_ME)
2021-05-25 15:31:49 +03:00
if (DEFINED RENAME_ME_EXAMPLE)
2023-08-29 22:34:08 +02:00
add_subdirectory(src/example)
2021-05-25 15:31:49 +03:00
endif()
2021-04-04 22:57:18 +03:00
if (RENAME_ME_TESTS)
add_subdirectory(tests)
else()
message("The ${PROJECT_NAME} tests is disabled.")
endif()
2023-03-26 21:08:15 +02:00
configure_file_in(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)
addDoc(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)