mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-05 08:55:59 +08:00
Officially we do not build for 32 bit anymore. Hence, the build may break without notice. Hence removing the build support for now
44 lines
1.5 KiB
CMake
44 lines
1.5 KiB
CMake
# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors
|
|
# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
|
|
|
|
macro(get_version_number)
|
|
if(WIN32)
|
|
set(PYTHON_EXEC python)
|
|
else()
|
|
set(PYTHON_EXEC python3)
|
|
endif()
|
|
|
|
execute_process(COMMAND ${PYTHON_EXEC} scripts/utils.py --version
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
OUTPUT_VARIABLE SWIFT_VERSION
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
string(REPLACE "." ";" SWIFT_SUBVERSIONS ${SWIFT_VERSION})
|
|
list(GET SWIFT_SUBVERSIONS 0 SWIFT_VERSION_MAJOR)
|
|
list(GET SWIFT_SUBVERSIONS 1 SWIFT_VERSION_MINOR)
|
|
list(GET SWIFT_SUBVERSIONS 2 SWIFT_VERSION_REVISION)
|
|
|
|
# Git revision
|
|
execute_process(COMMAND git rev-parse --short HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE git_sha)
|
|
string(STRIP ${git_sha} git_sha)
|
|
set(swift_git_head ${git_sha})
|
|
endmacro()
|
|
|
|
macro(load_vatsim_key)
|
|
# Dummy data
|
|
set(SWIFT_VATSIM_ID "0")
|
|
set(SWIFT_VATSIM_KEY "00000000000000000000000000000000")
|
|
|
|
if(VATSIM_KEY_JSON)
|
|
file(READ ${PROJECT_SOURCE_DIR}/${VATSIM_KEY_JSON} KEY_FILE)
|
|
string(JSON SWIFT_VATSIM_ID GET ${KEY_FILE} vatsim id)
|
|
string(JSON SWIFT_VATSIM_KEY GET ${KEY_FILE} vatsim key)
|
|
endif()
|
|
endmacro()
|
|
|
|
macro(force_asserts TARGET)
|
|
if(SWIFT_FORCE_ASSERTS)
|
|
target_compile_definitions(${TARGET} PRIVATE QT_FORCE_ASSERTS)
|
|
endif()
|
|
endmacro()
|