# The trace section of CMake configurePresets has no effect?

**URL:** <https://discourse.cmake.org/t/the-trace-section-of-cmake-configurepresets-has-no-effect/15259>\
**Category:** Code\
**Created:** [October 21, 2025, 7:34pm UTC](https://discourse.cmake.org/t/the-trace-section-of-cmake-configurepresets-has-no-effect/15259 "2025-10-21T19:34:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Post date:** [October 21, 2025, 7:34pm UTC](https://discourse.cmake.org/t/the-trace-section-of-cmake-configurepresets-has-no-effect/15259/1 "2025-10-21T19:34:48Z")

</div>

I have this `CMakePresets.json`file

```json
{
  "version": 8,
  "cmakeMinimumRequired": {
    "major": 3,
    "minor": 28,
    "patch": 0
  },
  "configurePresets": [
    {
      "name": "cmake-pedantic",
      "hidden": true,
      "warnings": {
        "dev": true,
        "deprecated": true,
        "uninitialized": true,
        "unusedCli": true,
        "systemVars": false
      },
      "trace": {
        "mode": "expand",
        "source": [
            "CMakeDetermineCompilerSupport.cmake",
            "CMakeDetermineCompilerId.cmake",
            "Clang-CXX-CXXImportStd.cmake"
        ]
      },
      "errors": {
        "dev": false,
        "deprecated": false
      }
    },
    {
      "name": "dev-mode",
      "hidden": true,
      "inherits": "cmake-pedantic",
      "installDir": "${sourceDir}/stagedir",
      "cacheVariables": {
        "CMAKE_PREFIX_PATH": {
          "type": "path",
          "value": "${sourceDir}/stagedir"
        },
        "CMAKE_EXPORT_COMPILE_COMMANDS": true,
        "CMAKE_MESSAGE_LOG_LEVEL": "VERBOSE",
        "CMAKE_VERIFY_INTERFACE_HEADER_SETS": true,
        "cmake-init-modules_DEVELOPER_MODE": true
      }
    },

    # ...

    ]
}

```

Every of my used presets is inherited from `dev-mode`.

### But I see no traces?

```bash
bash-5.3$ CXX=clang++ cmake --preset dev --log-level=TRACE --fresh
Preset CMake variables:

  BUILD_MCSS_DOCS:BOOL="FALSE"

  BUILD_SHARED_LIBS:BOOL="TRUE"
  CMAKE_BUILD_TYPE="Debug"
  CMAKE_CXX_EXTENSIONS:BOOL="TRUE"
  CMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wno-undef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast"
  CMAKE_CXX_STANDARD="23"
  CMAKE_CXX_STANDARD_REQUIRED:BOOL="TRUE"
  CMAKE_EXPORT_COMPILE_COMMANDS:BOOL="TRUE"
  CMAKE_INSTALL_PREFIX:PATH="/Users/clausklein/Workspace/cpp/cxx20/cmake-init-modules/stagedir"
  CMAKE_MESSAGE_LOG_LEVEL="VERBOSE"
  CMAKE_PREFIX_PATH:STRING="/Users/clausklein/Workspace/cpp/cxx20/cmake-init-modules/stagedir"
  CMAKE_VERIFY_INTERFACE_HEADER_SETS:BOOL="TRUE"
  cmake-init-modules_DEVELOPER_MODE:BOOL="TRUE"

Preset environment variables:

  CPM_USE_LOCAL_PACKAGES="OFF"

-- CXXFLAGS=-stdlib=libc++
'brew' '--prefix' 'llvm'
-- LLVM_PATH=/usr/local/Cellar/llvm/21.1.3_1
-- The CXX compiler identification is Clang 21.1.3
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/Cellar/llvm/21.1.3_1/bin/clang++ - skipped
-- Detecting CXX compile features
CMake Warning (dev) at /Users/clausklein/.local/share/cmake-4.2/Modules/Compiler/CMakeCommonCompilerMacros.cmake:248 (cmake_language):
  CMake's support for `import std;` in C++23 and newer is experimental. It
  is meant only for experimentation and feedback to CMake developers.
Call Stack (most recent call first):
  /Users/clausklein/.local/share/cmake-4.2/Modules/CMakeDetermineCompilerSupport.cmake:113 (cmake_create_cxx_import_std)
  /Users/clausklein/.local/share/cmake-4.2/Modules/CMakeTestCXXCompiler.cmake:83 (CMAKE_DETERMINE_COMPILER_SUPPORT)
  CMakeLists.txt:5 (project)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Detecting CXX compile features - done
-- CMAKE_CXX_STDLIB_MODULES_JSON=/usr/local/Cellar/llvm/21.1.3_1/lib/c++/libc++.modules.json
-- CMAKE_CXX_COMPILER_IMPORT_STD=23;26
-- CMAKE_CXX_MODULE_STD=ON
-- ALGO_USE_MODULES=ON
-- CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES=/usr/local/Cellar/llvm/21.1.3_1/include/c++/v1;/usr/local/Cellar/llvm/21.1.3_1/lib/clang/21/include;/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include

# ...

bash-5.3$ cmake --version
cmake version 4.2.0-rc1-g4b5233e

CMake suite maintained and supported by Kitware (kitware.com/cmake).

```

---

<div class="post-metadata">

**Author:** ![LegalizeAdulthood](https://discourse.cmake.org/user_avatar/discourse.cmake.org/legalizeadulthood/32/5282_2.png) [@LegalizeAdulthood](https://discourse.cmake.org/u/LegalizeAdulthood)\
**Post date:** [October 22, 2025, 3:05pm UTC](https://discourse.cmake.org/t/the-trace-section-of-cmake-configurepresets-has-no-effect/15259/2 "2025-10-22T15:05:05Z")

</div>

Configure Presets are just a convenient way of specifying a bunch of command-line arguments to cmake at configure time. Do you see the expected trace output if you build the command-line manually and run it?

---

<div class="post-metadata">

**Author:** ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Post date:** [October 22, 2025, 3:39pm UTC](https://discourse.cmake.org/t/the-trace-section-of-cmake-configurepresets-has-no-effect/15259/3 "2025-10-22T15:39:37Z")

</div>

Yes, but I have to set all the trace parameters at command line again?

---

<div class="post-metadata">

**Author:** ![LegalizeAdulthood](https://discourse.cmake.org/user_avatar/discourse.cmake.org/legalizeadulthood/32/5282_2.png) [@LegalizeAdulthood](https://discourse.cmake.org/u/LegalizeAdulthood)\
**Post date:** [October 22, 2025, 8:35pm UTC](https://discourse.cmake.org/t/the-trace-section-of-cmake-configurepresets-has-no-effect/15259/4 "2025-10-22T20:35:55Z")

</div>

I looked at the source code for latest cmake and it seems straightforward enough that if the trace settings are set in the preset it applies them to the cmake object before operating.

---

<div class="post-metadata">

**Author:** ![LegalizeAdulthood](https://discourse.cmake.org/user_avatar/discourse.cmake.org/legalizeadulthood/32/5282_2.png) [@LegalizeAdulthood](https://discourse.cmake.org/u/LegalizeAdulthood)\
**Post date:** [October 22, 2025, 8:36pm UTC](https://discourse.cmake.org/t/the-trace-section-of-cmake-configurepresets-has-no-effect/15259/5 "2025-10-22T20:36:34Z")

</div>

Try creating the smallest repro you can on a “hello world” CMakeLists.txt

---

<div class="post-metadata">

**Author:** ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Post date:** [October 22, 2025, 9:43pm UTC](https://discourse.cmake.org/t/the-trace-section-of-cmake-configurepresets-has-no-effect/15259/6 "2025-10-22T21:43:14Z")

</div>

> <https://github.com/ClausKlein/cmake-init-modules/pull/6>
>
> Upgrade cmake and ninja with pip on CI
>     
> It is a nightmare with pipx an…d pip!
> 
> \- 16d9e8f Back to llvm-20 on OSX CI
> \- fbdcef9 Use import std if available
> \- 098b004 Use gcc-15 on macos-15 CI

---

<div class="post-metadata">

**Author:** ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Post date:** [October 25, 2025, 7:21am UTC](https://discourse.cmake.org/t/the-trace-section-of-cmake-configurepresets-has-no-effect/15259/7 "2025-10-25T07:21:43Z")

</div>

I found the problem:

**The trace section of presets is not transitive!**
