1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Added cmake versioning and removed hardcoded share dir path

This commit is contained in:
Christian Prather
2023-07-11 13:54:22 -06:00
parent 6c6ec00251
commit a49af31188
2 changed files with 36 additions and 4 deletions
+22
View File
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.10)
message("Parsing public/common/TracyVersion.hpp file")
file(READ "public/common/TracyVersion.hpp" version)
# Note: This looks for a specific pattern in TracyVersion.hpp, if it changes
# this needs updating.
string(REGEX MATCH "Major = ([0-9]+)" _ ${version})
# This works do to the above () subexpression selection. See
# https://cmake.org/cmake/help/latest/command/string.html#regex-match for more
# details
set(major ${CMAKE_MATCH_1})
string(REGEX MATCH "Minor = ([0-9]+)" _ ${version})
set(minor ${CMAKE_MATCH_1})
string(REGEX MATCH "Patch = ([0-9]+)" _ ${version})
set(patch ${CMAKE_MATCH_1})
message("VERSION ${major}.${minor}.${patch}")