QuasarAppLib/CMakeLists.txt

66 lines
1.6 KiB
CMake
Raw Normal View History

2019-08-29 16:28:09 +03:00
#
2024-12-30 22:39:49 +01:00
# Copyright (C) 2018-2025 QuasarApp.
2019-08-29 16:28:09 +03:00
# Distributed under the lgplv3 software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
2020-04-19 13:02:27 +03:00
if(DEFINED QUASARAPP_LIBRARY)
return()
else()
2020-04-19 17:48:14 +03:00
set(QUASARAPP_LIBRARY 1)
2020-04-19 13:02:27 +03:00
add_definitions(-DQUASARAPP_LIBRARY)
endif()
2020-09-21 20:20:09 +03:00
project(QuasarApp)
2020-04-19 17:48:14 +03:00
if(TARGET ${PROJECT_NAME})
2020-04-19 17:51:26 +03:00
message("The ${PROJECT_NAME} arledy included in main Project")
2020-04-19 17:48:14 +03:00
return()
endif()
2020-04-19 13:02:27 +03:00
2019-08-29 16:28:09 +03:00
cmake_minimum_required(VERSION 3.1)
2019-08-31 18:59:16 +03:00
2021-04-20 11:50:46 +03:00
include(CMake/QuasarApp.cmake)
2019-08-31 18:59:16 +03:00
include(CMake/Version.cmake)
2019-08-29 16:28:09 +03:00
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2021-04-01 16:36:44 +03:00
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
2022-11-03 22:56:21 +03:00
option(BUILD_SHARED_LIBS "Enable or disable shared libraryes" OFF)
2021-04-01 16:36:44 +03:00
2021-06-04 13:37:34 +03:00
if (NOT QT_VERSION_MAJOR)
2021-06-04 13:23:50 +03:00
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
endif()
2021-04-01 16:36:44 +03:00
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
2019-08-29 16:28:09 +03:00
option(QA_ALLOW_NOT_SUPPORTED_OPTIONS "Enable for allow any command line options" ON)
2023-11-05 11:24:09 +01:00
option(QA_DISABLE_LOG "Disabled all logs (force sets verbose to 0)" OFF)
2023-11-05 11:24:09 +01:00
if (QA_DISABLE_LOG)
add_definitions(-DQA_DISABLE_LOG)
endif()
if (QA_ALLOW_NOT_SUPPORTED_OPTIONS)
add_definitions(-DQA_ALLOW_NOT_SUPPORTED_OPTIONS)
endif()
2019-08-29 16:28:09 +03:00
file(GLOB SOURCE_CPP
2022-01-18 23:55:45 +03:00
"*.cpp" "*.h"
2019-08-29 16:28:09 +03:00
)
2024-06-24 13:23:40 +02:00
add_library(${PROJECT_NAME} ${SOURCE_CPP})
2022-08-13 20:34:30 +03:00
target_link_libraries(${PROJECT_NAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core)
2019-08-31 18:59:16 +03:00
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
2019-08-29 16:28:09 +03:00
2024-06-24 13:23:40 +02:00
setVersion(1 5 4)
2021-02-20 12:29:16 +03:00
initAll()
2022-01-19 00:03:39 +03:00
make_directory("${CMAKE_CURRENT_SOURCE_DIR}/Distro")
2021-02-20 12:29:16 +03:00
addDoc(${PROJECT_NAME}Docs ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)