Set TRACY_VERSION_STRING directly in version.cmake.

This commit is contained in:
Bartosz Taudul 2024-03-17 13:19:06 +01:00
parent 776b08f2e0
commit 375f4526df
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 6 additions and 14 deletions

View File

@ -3,11 +3,6 @@ cmake_minimum_required(VERSION 3.10)
# Run version helper script # Run version helper script
include(cmake/version.cmake) include(cmake/version.cmake)
set(TRACY_VERSION_MAJOR ${major})
set(TRACY_VERSION_MINOR ${minor})
set(TRACY_VERSION_PATCH ${patch})
set(TRACY_VERSION_STRING "${TRACY_VERSION_MAJOR}.${TRACY_VERSION_MINOR}.${TRACY_VERSION_PATCH}")
project(Tracy LANGUAGES CXX VERSION ${TRACY_VERSION_STRING}) project(Tracy LANGUAGES CXX VERSION ${TRACY_VERSION_STRING})
if(${BUILD_SHARED_LIBS}) if(${BUILD_SHARED_LIBS})

View File

@ -11,12 +11,14 @@ string(REGEX MATCH "Major = ([0-9]+)" _ ${version})
# This works do to the above () subexpression selection. See # This works do to the above () subexpression selection. See
# https://cmake.org/cmake/help/latest/command/string.html#regex-match for more # https://cmake.org/cmake/help/latest/command/string.html#regex-match for more
# details # details
set(major ${CMAKE_MATCH_1}) set(TRACY_VERSION_MAJOR ${CMAKE_MATCH_1})
string(REGEX MATCH "Minor = ([0-9]+)" _ ${version}) string(REGEX MATCH "Minor = ([0-9]+)" _ ${version})
set(minor ${CMAKE_MATCH_1}) set(TRACY_VERSION_MINOR ${CMAKE_MATCH_1})
string(REGEX MATCH "Patch = ([0-9]+)" _ ${version}) string(REGEX MATCH "Patch = ([0-9]+)" _ ${version})
set(patch ${CMAKE_MATCH_1}) set(TRACY_VERSION_PATCH ${CMAKE_MATCH_1})
message("VERSION ${major}.${minor}.${patch}") set(TRACY_VERSION_STRING "${TRACY_VERSION_MAJOR}.${TRACY_VERSION_MINOR}.${TRACY_VERSION_PATCH}")
message("VERSION ${TRACY_VERSION_STRING}")

View File

@ -8,11 +8,6 @@ option(NO_STATISTICS "Disable calculation of statistics" OFF)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake) include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
set(TRACY_VERSION_MAJOR ${major})
set(TRACY_VERSION_MINOR ${minor})
set(TRACY_VERSION_PATCH ${patch})
set(TRACY_VERSION_STRING "${TRACY_VERSION_MAJOR}.${TRACY_VERSION_MINOR}.${TRACY_VERSION_PATCH}")
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
project( project(