SimpleQmlNotify/CMakeLists.txt

63 lines
2.2 KiB
CMake
Raw Normal View History

2020-03-30 15:47:10 +03:00
#
2023-12-31 10:03:40 +01:00
# Copyright (C) 2018-2024 QuasarApp.
2023-03-29 12:57:55 +02:00
# Distributed under the GPLv3 software license, see the accompanying
2020-03-30 15:47:10 +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.5)
project(QmlNotyfyService LANGUAGES CXX)
2021-04-20 18:26:18 +03:00
include(CMake/QuasarApp.cmake)
2020-03-30 15:47:10 +03:00
include(CMake/Version.cmake)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2021-04-15 16:54:42 +03:00
add_definitions(-DQMLNOTYFYSERICE_LIBRARY)
2020-04-06 00:26:12 +03:00
2023-06-11 19:00:41 +02:00
if (NOT QML_IMPORT_PATH MATCHES "${CMAKE_CURRENT_SOURCE_DIR}")
set(QML_IMPORT_PATH ${QML_IMPORT_PATH} "${CMAKE_CURRENT_SOURCE_DIR}" CACHE STRING "" FORCE)
endif()
2020-04-06 00:26:12 +03:00
2021-06-04 13:38:20 +03:00
if (NOT QT_VERSION_MAJOR)
2021-06-04 13:24:27 +03:00
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Quick QuickControls2 REQUIRED)
endif()
2021-05-31 12:19:23 +03:00
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Quick QuickControls2 REQUIRED)
2020-03-30 15:47:10 +03:00
2022-01-18 23:57:35 +03:00
file(GLOB SOURCE_CPP "*.cpp" "*.h" "*.qrc")
2020-03-30 15:47:10 +03:00
2021-05-05 16:12:50 +03:00
add_library(${PROJECT_NAME} ${SOURCE_CPP})
2021-05-31 12:19:23 +03:00
target_link_libraries(${PROJECT_NAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::QuickControls2)
2020-03-30 15:47:10 +03:00
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
2021-05-05 16:12:50 +03:00
set(LANGS ${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/en.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/ru.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/uk.ts
2021-05-05 16:12:50 +03:00
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/ja.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/tr.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/zh.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/de.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/fr.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/es.ts
${CMAKE_CURRENT_SOURCE_DIR}/qmlNotify_languages/pl.ts)
2021-05-05 16:12:50 +03:00
prepareQM( ${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR} "${LANGS}")
2021-11-23 21:49:27 +03:00
updateGitVars()
setVersion(1 0 ${GIT_COMMIT_COUNT})
set(QML_NOTIFY_VERSION 1.0.${GIT_COMMIT_COUNT}.${GIT_COMMIT_HASH})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/notifyservice_global.h.in ${CMAKE_CURRENT_SOURCE_DIR}/notifyservice_global.h @ONLY)
2021-04-15 16:07:41 +03:00
initAll()
addDoc("QmlNotyfyService" ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)