DoctorPill/CMakeLists.txt

78 lines
2.0 KiB
CMake
Raw Permalink Normal View History

2022-01-13 21:51:56 +03:00
#
2023-12-31 10:02:22 +01:00
# Copyright (C) 2020-2024 QuasarApp.
2022-01-14 19:55:51 +03:00
# Distributed under the GPLv3 software license, see the accompanying
2022-01-13 21:51:56 +03:00
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
cmake_minimum_required(VERSION 3.14)
2022-01-13 22:01:31 +03:00
project(DoctorPill LANGUAGES CXX)
2022-01-13 21:51:56 +03:00
if(TARGET ${PROJECT_NAME})
message("The ${PROJECT_NAME} arledy included in main Project")
return()
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (NOT QT_VERSION_MAJOR)
2022-01-16 14:13:00 +03:00
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
2022-01-13 21:51:56 +03:00
endif()
2022-01-16 14:13:00 +03:00
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
2022-01-13 21:51:56 +03:00
include(submodules/CMake/QuasarApp.cmake)
updateGitVars()
2022-01-17 18:59:54 +03:00
set(DOCTOR_PILL_VERSION "0.${GIT_COMMIT_COUNT}.${GIT_COMMIT_HASH}")
2022-01-13 21:51:56 +03:00
2022-01-17 18:49:39 +03:00
option(DOCTOR_PILL_GUI "Enable gui qml model for build" ON)
2022-01-16 14:13:00 +03:00
option(DOCTOR_PILL_TESTS "Enable tests of this library" ON)
option(DOCTOR_PILL_EXAMPLE "Enable example app of this library" ON)
2022-01-14 19:55:51 +03:00
2022-01-18 16:21:05 +03:00
SET(TARGET_DIR "${CMAKE_SOURCE_DIR}/Distro")
file(MAKE_DIRECTORY ${TARGET_DIR})
2022-01-16 14:13:00 +03:00
if (DEFINED TARGET_PLATFORM_TOOLCHAIN)
if (${TARGET_PLATFORM_TOOLCHAIN} STREQUAL "wasm32")
2022-01-18 17:25:02 +03:00
message("This library depend of the qt concurent library, but The concurent is not available in qt wasm")
initAll()
return()
2022-01-13 21:51:56 +03:00
endif()
endif()
2022-01-16 14:13:00 +03:00
if (ANDROID OR IOS)
set(DOCTOR_PILL_TESTS OFF)
set(DOCTOR_PILL_EXAMPLE OFF)
message("Disable DOCTOR_PILL_TESTS and DOCTOR_PILL_EXAMPLE for mobile paltforms because ios and android not support tests and an example.")
2022-01-13 21:51:56 +03:00
endif()
initAll()
2022-01-23 20:09:18 +03:00
add_subdirectory(src/Core)
2022-01-19 22:22:54 +03:00
if (NOT DOCTOR_PILL_GUI)
2022-01-17 18:49:39 +03:00
set(DOCTOR_PILL_EXAMPLE OFF)
2022-01-23 20:09:18 +03:00
else()
add_subdirectory(src/GUI)
2022-01-17 18:49:39 +03:00
endif()
if (DOCTOR_PILL_EXAMPLE)
2022-01-13 21:51:56 +03:00
add_subdirectory(src/Example)
endif()
2022-01-14 19:55:51 +03:00
if (DOCTOR_PILL_TESTS)
2022-01-13 21:51:56 +03:00
add_subdirectory(tests)
else()
message("The ${PROJECT_NAME} tests is disabled.")
endif()
addDoc(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)