2021-04-20 11:02:05 +03:00
|
|
|
#
|
2024-12-30 22:37:58 +01:00
|
|
|
# Copyright (C) 2021-2025 QuasarApp.
|
2021-04-20 11:02:05 +03:00
|
|
|
# Distributed under the MIT software license, see the accompanying
|
|
|
|
# Everyone is permitted to copy and distribute verbatim copies
|
|
|
|
# of this license document, but changing it is not allowed.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
2021-04-20 11:05:08 +03:00
|
|
|
# This is main cmake module of the QuasarApp group.
|
2021-04-20 11:02:05 +03:00
|
|
|
# All project of the QuasarApp group ust be use this module in own cmake rro directory.
|
|
|
|
# Example
|
|
|
|
# include(CMake/QuasarApp.cmake)
|
|
|
|
#
|
|
|
|
# This module do:
|
|
|
|
# * Print debug information
|
|
|
|
# * Prepare build type, By default it is Release mode
|
|
|
|
# * include ccache for project
|
|
|
|
# * Add default QussarApp definition into code
|
|
|
|
# * Initialise all default targets. See the QuasarAppCITargets module
|
|
|
|
# * Initialise all qtUtils. See the QtUtils module
|
2021-04-20 11:04:38 +03:00
|
|
|
# * Initialise all crossplatform toolchains. See the crossplatform module
|
|
|
|
|
2021-04-20 11:02:05 +03:00
|
|
|
#
|
|
|
|
# Supports Defines:
|
|
|
|
# * RELEASE_BUILD - will sets to true if the build type is release.
|
|
|
|
|
2021-04-20 11:04:38 +03:00
|
|
|
if(DEFINED QUASARAPP_CMAKE_MODULE)
|
2021-04-20 11:02:05 +03:00
|
|
|
return()
|
|
|
|
else()
|
2021-04-20 11:04:38 +03:00
|
|
|
set(QUASARAPP_CMAKE_MODULE 1)
|
2021-04-20 11:02:05 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
IF(NOT CMAKE_BUILD_TYPE)
|
|
|
|
SET(CMAKE_BUILD_TYPE Release)
|
|
|
|
ENDIF(NOT CMAKE_BUILD_TYPE)
|
|
|
|
|
2022-10-16 12:28:07 +03:00
|
|
|
if (NOT QT_QT_ROOT)
|
|
|
|
if (QT_VERSION_MAJOR)
|
|
|
|
get_filename_component(QT_QT_ROOT "${Qt${QT_VERSION_MAJOR}Core_DIR}/../../.." ABSOLUTE)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2022-10-22 20:15:13 +03:00
|
|
|
if (NOT EXISTS ${QT_QMAKE_EXECUTABLE})
|
|
|
|
message("The QT_QMAKE_EXECUTABLE variable is not set or path is wrong QT_QMAKE_EXECUTABLE=${QT_QMAKE_EXECUTABLE}")
|
|
|
|
message("Try to Initialize from qtdir")
|
|
|
|
|
2022-10-22 23:02:38 +03:00
|
|
|
find_program(QMAKE_EXECUTABLE qmake)
|
|
|
|
set(QT_QMAKE_EXECUTABLE ${QMAKE_EXECUTABLE})
|
2022-10-16 12:28:07 +03:00
|
|
|
endif()
|
|
|
|
|
2021-04-20 11:02:05 +03:00
|
|
|
## Default Defines
|
|
|
|
## End DEfault defines
|
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/ccache.cmake)
|
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/QuasarAppCITargets.cmake)
|
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/QtUtils.cmake)
|
2021-04-20 11:04:38 +03:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/crossplatform/crossplatform.cmake)
|
2021-04-20 11:02:05 +03:00
|
|
|
|
|
|
|
message(STATUS "buid type " ${CMAKE_BUILD_TYPE})
|
|
|
|
message(STATUS "Project " ${PROJECT_NAME})
|
|
|
|
message(STATUS "c compiler " ${CMAKE_C_COMPILER})
|
|
|
|
message(STATUS "cxx compiler " ${CMAKE_CXX_COMPILER})
|
|
|
|
message(STATUS "build shared " ${BUILD_SHARED_LIBS})
|
|
|
|
message(STATUS "qmake exec " ${QT_QMAKE_EXECUTABLE})
|
2022-01-22 16:52:55 +03:00
|
|
|
message(STATUS "tool chain " ${CMAKE_TOOLCHAIN_FILE})
|