Skip to content

Ability to extract Tracy version from installed package #1271

Closed

Description

@codelimit

Hi!
It would be nice to have the ability to extract tracy version during build time for user project with prebuilt Tracy static library.
In other words, it is hard to detect a Tracy version after installation.

For example, I prebuilt Tracy as a static library with usual cmake flow: cmake generate, cmake build, cmake install.
It would be great if TracyConfig.cmake exports its version, so I could do the following:

find_package(Tracy REQUIRED CONFIG)
message(STATUS "Using Tracy version: ${TRACY_VERSION_STRING}")

Other way is that I parse TracyVersion.hpp myself and generate version string, but it is not included in installed package. It would be nice to add TracyVersion.hpp to common_includes variable in root CMakeLists.txt.

Best regards.

Activity

  1. wolfpld commented on Feb 6, 2026

    @wolfpld
    Owner

    cmake/version.cmake

  2. codelimit commented on Feb 6, 2026

    @codelimit
    Author

    I understand that it exists in src dir, but there is no such file in installed package.
    Consider I have a project, where I prebuild thirdparty libs. Usually I do this in the following way:

    cmake -G "Visual Studio 17 2022" -A x64 -B .build -DTRACY_STATIC=ON
    cmake --build .build --config=RelWithDebInfo
    cmake --install .build --prefix=/abs/path/to/my/project/thirdparty_libs

    Resulting output after install is:

    thirdparty:
    ├───include
    │   └───tracy
    │       ├───client
    │       │       TracyArmCpuTable.hpp
    │       │       TracyCallstack.h
    │       │       TracyCallstack.hpp
    │       │       TracyCpuid.hpp
    │       │       TracyDebug.hpp
    │       │       TracyDxt1.hpp
    │       │       TracyFastVector.hpp
    │       │       TracyKCore.hpp
    │       │       TracyLock.hpp
    │       │       TracyProfiler.hpp
    │       │       TracyRingBuffer.hpp
    │       │       TracyScoped.hpp
    │       │       TracyStringHelpers.hpp
    │       │       TracySysPower.hpp
    │       │       TracySysTime.hpp
    │       │       TracySysTrace.hpp
    │       │       TracyThread.hpp
    │       │       tracy_concurrentqueue.h
    │       │       tracy_rpmalloc.hpp
    │       │       tracy_SPSCQueue.h
    │       │
    │       ├───common
    │       │       TracyAlign.hpp
    │       │       TracyAlloc.hpp
    │       │       TracyApi.h
    │       │       TracyColor.hpp
    │       │       TracyForceInline.hpp
    │       │       TracyMutex.hpp
    │       │       TracyProtocol.hpp
    │       │       TracyQueue.hpp
    │       │       TracySocket.hpp
    │       │       TracyStackFrames.hpp
    │       │       TracySystem.hpp
    │       │       TracyWinFamily.hpp
    │       │       TracyYield.hpp
    │       │       tracy_lz4.hpp
    │       │       tracy_lz4hc.hpp
    │       │
    │       └───tracy
    │               Tracy.hpp
    │               TracyC.h
    │               TracyCUDA.hpp
    │               TracyD3D11.hpp
    │               TracyD3D12.hpp
    │               TracyLua.hpp
    │               TracyMetal.hmm
    │               TracyOpenCL.hpp
    │               TracyOpenGL.hpp
    │               TracyVulkan.hpp
    │
    └───lib
        │   TracyClient.lib
        │
        └───cmake
            └───Tracy
                    TracyConfig.cmake
                    TracyTargets-release.cmake
                    TracyTargets.cmake
    

    Then, in my proj CMakeLists.txt I do:

    list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/thirdparty/lib/cmake/Tracy")
    find_package(Tracy REQUIRED CONFIG)
    message(STATUS "Using Tracy version: ${TRACY_VERSION_STRING}")

    It would be great if version.cmake will be automatically copied during install step, so it is not necessary any manual copying.

  3. wolfpld commented on Aug 19, 2026

    @wolfpld
    Owner

    Fixed in e3cde05.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions