From 4377940558683bd887eb2abd81039cf44da55ba9 Mon Sep 17 00:00:00 2001 From: "Taylor, Raymond" Date: Tue, 22 Sep 2026 11:45:22 -0700 Subject: [PATCH 1/6] update args projects ids to match cmake-generated ones --- IntelPresentMon/AppCef/AppCef.args.json | 2 +- IntelPresentMon/AppCef/CefNano.args.json | 2 +- IntelPresentMon/KernelProcess/KernelProcess.args.json | 2 +- .../PMInstallerExtension/PMInstallerExtension.args.json | 2 +- IntelPresentMon/PresentMonService/PresentMonService.args.json | 2 +- IntelPresentMon/SampleClient/SampleClient.args.json | 2 +- PresentMon/PresentMon.args.json | 2 +- PresentMonService.args.json | 2 +- Tests/PresentMonTests.args.json | 2 +- Tools/ETLTrimmer/ETLTrimmer.args.json | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/IntelPresentMon/AppCef/AppCef.args.json b/IntelPresentMon/AppCef/AppCef.args.json index 811de24a8..5a8a59282 100644 --- a/IntelPresentMon/AppCef/AppCef.args.json +++ b/IntelPresentMon/AppCef/AppCef.args.json @@ -1,6 +1,6 @@ { "FileVersion": 2, - "Id": "3c80b001-e165-4e0e-a92d-5767cf4fb1f8", + "Id": "19647573-e7eb-3fb4-abe9-bf08564b413b", "Items": [ { "Id": "1dc49fdb-5f81-4e67-b00d-73fd9b974d2c", diff --git a/IntelPresentMon/AppCef/CefNano.args.json b/IntelPresentMon/AppCef/CefNano.args.json index b802078ee..ee9cb554b 100644 --- a/IntelPresentMon/AppCef/CefNano.args.json +++ b/IntelPresentMon/AppCef/CefNano.args.json @@ -1,6 +1,6 @@ { "FileVersion": 2, - "Id": "3c80b001-e165-4e0e-a92d-5767cf4fb1f8", + "Id": "19647573-e7eb-3fb4-abe9-bf08564b413b", "Items": [ { "Id": "68df55d8-bc72-4454-b591-f82e6968f905", diff --git a/IntelPresentMon/KernelProcess/KernelProcess.args.json b/IntelPresentMon/KernelProcess/KernelProcess.args.json index 05cfe9d05..6845dafe8 100644 --- a/IntelPresentMon/KernelProcess/KernelProcess.args.json +++ b/IntelPresentMon/KernelProcess/KernelProcess.args.json @@ -1,6 +1,6 @@ { "FileVersion": 2, - "Id": "8524c555-b172-46ef-be42-7b7b7bb102e4", + "Id": "8c0e1bd8-b73e-3984-9efe-97ab72e66965", "Items": [ { "Id": "05c87f08-36f8-4173-995d-dea7a6601ccc", diff --git a/IntelPresentMon/PMInstallerExtension/PMInstallerExtension.args.json b/IntelPresentMon/PMInstallerExtension/PMInstallerExtension.args.json index 473e2a590..1624699ac 100644 --- a/IntelPresentMon/PMInstallerExtension/PMInstallerExtension.args.json +++ b/IntelPresentMon/PMInstallerExtension/PMInstallerExtension.args.json @@ -1,6 +1,6 @@ { "FileVersion": 2, - "Id": "9e3c74bb-12bb-40ac-86bf-818d20140cba", + "Id": "b829469b-624b-3a7f-a2a9-063768b6bf81", "Items": [ { "Id": "ccd5d4f9-221a-4bdc-9546-04755edfb952", diff --git a/IntelPresentMon/PresentMonService/PresentMonService.args.json b/IntelPresentMon/PresentMonService/PresentMonService.args.json index 4323cd864..3a204374f 100644 --- a/IntelPresentMon/PresentMonService/PresentMonService.args.json +++ b/IntelPresentMon/PresentMonService/PresentMonService.args.json @@ -1,6 +1,6 @@ { "FileVersion": 2, - "Id": "3a848e5b-a376-4a22-bbac-e9b3c01bd385", + "Id": "ef4330bd-ec4d-3bc0-b96b-58fa1582404d", "Items": [ { "Id": "c0207ae5-487c-4379-8ccb-e99281ade16e", diff --git a/IntelPresentMon/SampleClient/SampleClient.args.json b/IntelPresentMon/SampleClient/SampleClient.args.json index 978823012..dbced0239 100644 --- a/IntelPresentMon/SampleClient/SampleClient.args.json +++ b/IntelPresentMon/SampleClient/SampleClient.args.json @@ -1,6 +1,6 @@ { "FileVersion": 2, - "Id": "79fe382a-c29c-4c32-a028-b8d1abdf51b0", + "Id": "533b4126-92bb-3643-a791-13454b368dc1", "Items": [ { "Id": "2cf4c62a-0c43-4a7f-a686-8dc38ffc3868", diff --git a/PresentMon/PresentMon.args.json b/PresentMon/PresentMon.args.json index 4497ccf1e..07e4292ef 100644 --- a/PresentMon/PresentMon.args.json +++ b/PresentMon/PresentMon.args.json @@ -1,6 +1,6 @@ { "FileVersion": 2, - "Id": "4eb9794b-1f12-48ce-adc1-917e9810f29e", + "Id": "ee26d35d-37b9-3efd-a573-3cf0433f8b4f", "Items": [ { "Id": "87896970-fc2f-44e1-8336-e0ed41901412", diff --git a/PresentMonService.args.json b/PresentMonService.args.json index 22344f276..3305bddd4 100644 --- a/PresentMonService.args.json +++ b/PresentMonService.args.json @@ -1,6 +1,6 @@ { "FileVersion": 2, - "Id": "3a848e5b-a376-4a22-bbac-e9b3c01bd385", + "Id": "ef4330bd-ec4d-3bc0-b96b-58fa1582404d", "Items": [ { "Id": "c0207ae5-487c-4379-8ccb-e99281ade16e", diff --git a/Tests/PresentMonTests.args.json b/Tests/PresentMonTests.args.json index a09eda0a6..4590f18cc 100644 --- a/Tests/PresentMonTests.args.json +++ b/Tests/PresentMonTests.args.json @@ -1,6 +1,6 @@ { "FileVersion": 2, - "Id": "0f60dfd9-208e-443e-8d01-43c902b458a6", + "Id": "651f1569-8dd5-3714-802d-da1858be8ba5", "Items": [ { "Id": "0a297b29-b817-4fec-899b-b608a7e51bc4", diff --git a/Tools/ETLTrimmer/ETLTrimmer.args.json b/Tools/ETLTrimmer/ETLTrimmer.args.json index 8c065533a..d1463d166 100644 --- a/Tools/ETLTrimmer/ETLTrimmer.args.json +++ b/Tools/ETLTrimmer/ETLTrimmer.args.json @@ -1,6 +1,6 @@ { "FileVersion": 2, - "Id": "f9bd47f5-4aa3-4ba3-91f2-2ac7b270299c", + "Id": "c0bcccb39-2630-30ac-bb26-880b8a120193", "Items": [ { "Id": "0f02ddbd-6110-43dd-982a-900bffd8549c", From 2ea304c5988f066ba9fe1a1477c5f3da40510a17 Mon Sep 17 00:00:00 2001 From: "Taylor, Raymond" Date: Tue, 22 Sep 2026 11:59:17 -0700 Subject: [PATCH 2/6] update cmake with option to junction cli args json files --- CMakeLists.txt | 3 + IntelPresentMon/AppCef/AppCef.args.json | 34 ------ IntelPresentMon/AppCef/CefNano.args.json | 100 ---------------- .../PMInstallerExtension.args.json | 18 --- ....args.json => PresentMonConsole.args.json} | 0 Tests/PresentMonTests.args.json | 34 ------ cmake/PresentMonCommandLineArguments.cmake | 111 ++++++++++++++++++ cmake/PresentMonOptions.cmake | 5 + 8 files changed, 119 insertions(+), 186 deletions(-) delete mode 100644 IntelPresentMon/AppCef/AppCef.args.json delete mode 100644 IntelPresentMon/AppCef/CefNano.args.json delete mode 100644 IntelPresentMon/PMInstallerExtension/PMInstallerExtension.args.json rename PresentMon/{PresentMon.args.json => PresentMonConsole.args.json} (100%) delete mode 100644 Tests/PresentMonTests.args.json create mode 100644 cmake/PresentMonCommandLineArguments.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 755676e93..6316b4180 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,7 @@ include(PresentMonShaders) include(PresentMonUiPayload) include(PresentMonAuxTestData) include(PresentMonCTest) +include(PresentMonCommandLineArguments) pmon_configure_options() pmon_configure_output_directories() @@ -172,6 +173,8 @@ pmon_add_win32_component_signing_targets() include(PresentMonPackaging) pmon_register_packaging_targets() +pmon_register_command_line_args_symlinks() + message(STATUS "") message(STATUS "PresentMon configuration") message(STATUS " Version: ${PMON_VERSION}") diff --git a/IntelPresentMon/AppCef/AppCef.args.json b/IntelPresentMon/AppCef/AppCef.args.json deleted file mode 100644 index 5a8a59282..000000000 --- a/IntelPresentMon/AppCef/AppCef.args.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "FileVersion": 2, - "Id": "19647573-e7eb-3fb4-abe9-bf08564b413b", - "Items": [ - { - "Id": "1dc49fdb-5f81-4e67-b00d-73fd9b974d2c", - "Command": "--p2c-allow-tearing" - }, - { - "Id": "070d8dbb-d8f5-454d-ae83-baf060dcd1a5", - "Command": "--p2c-no-net-fail" - }, - { - "Id": "f8cae6d1-4f95-472b-945d-8f51fdeb0aee", - "Command": "--p2c-log-black" - }, - { - "Id": "4f37c40f-bf0a-4f65-a732-26f5ebdd215b", - "Command": "--p2c-files-working" - }, - { - "Id": "85807b6c-301d-4b9b-9f63-28ec30c95fb1", - "Command": "--p2c-verbose" - }, - { - "Id": "892e9566-9271-49a0-8eea-4c1750a4c3bb", - "Command": "--p2c-url \"http://localhost:8080/\"" - }, - { - "Id": "84d92b33-37d5-43e8-b7ed-fe8bf667b0fd", - "Command": "--p2c-url \"https://google.com\"" - } - ] -} \ No newline at end of file diff --git a/IntelPresentMon/AppCef/CefNano.args.json b/IntelPresentMon/AppCef/CefNano.args.json deleted file mode 100644 index ee9cb554b..000000000 --- a/IntelPresentMon/AppCef/CefNano.args.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "FileVersion": 2, - "Id": "19647573-e7eb-3fb4-abe9-bf08564b413b", - "Items": [ - { - "Id": "68df55d8-bc72-4454-b591-f82e6968f905", - "Command": "standalone-svc", - "Items": [ - { - "Id": "26627e74-25b8-48b2-8801-e4a4ff273b75", - "Command": "--p2c-control-pipe \"\\\\.\\pipe\\eff\"" - }, - { - "Id": "fa923157-5981-494d-b492-569bc67f6af4", - "Command": "--p2c-shm-name pm_my_intro" - } - ] - }, - { - "Id": "04791b9f-ca9c-4ced-a572-c50f972877a3", - "Command": "--p2c-files-working" - }, - { - "Id": "f2f9d663-3ac6-4f2a-b62c-6defb750e639", - "Command": "--p2c-log-level debug" - }, - { - "Id": "8244ec79-0c35-4e62-b3b0-36b5efffa371", - "Command": "--p2c-log-level verbose" - }, - { - "Id": "8634f48b-7ed1-45af-8b73-5973c7b4b3c7", - "Command": "--p2c-log-svc-pipe-enable" - }, - { - "Id": "b0fec119-97eb-46b4-bdd7-e1eb8b857c45", - "Command": "--p2c-middleware-dll-path .\\PresentMonAPI2.dll" - }, - { - "Id": "0fb8cd38-1cf3-417f-a81c-894f60801ce8", - "Command": "--p2c-log-middleware-copy" - }, - { - "Id": "bc2faf34-6d97-458c-8ff1-67f3102617da", - "Command": "--p2c-enable-ui-dev-options" - }, - { - "Id": "3cfde9b7-02ee-4be8-b351-ea76191989a7", - "Command": "--p2c-enable-timestamp-column" - }, - { - "Id": "613c6ffc-013b-41c6-84db-eb54d1a0c3df", - "Command": "--p2c-url \"http://localhost:5173\"" - }, - { - "Id": "ba03a214-d200-4c5b-802b-52b2e44baadf", - "Command": "--p2c-enable-diagnostic" - }, - { - "Id": "f7483465-0c24-4c48-b3ac-e27310feb3a1", - "Command": "--p2c-log-allow-list \"b stak.txt\"" - }, - { - "Id": "72b2a6c6-ef95-4c88-89db-e3e601ecb3e0", - "Command": "--p2c-log-deny-list \"b stak.txt\"" - }, - { - "Id": "b8037124-662e-4823-9248-a2242ea02142", - "Command": "--p2c-log-folder C:\\scratch" - }, - { - "Id": "94236dab-b7fa-4401-a163-f7ceee4e8fe1", - "Command": "--p2c-log-trace-level warning" - }, - { - "Id": "00da8547-bd17-45b6-84a7-8d4e51ba4b62", - "Command": "--p2c-allow-tearing" - }, - { - "Id": "97d3977e-2f1d-49f0-8956-03fbf7ac96ea", - "Command": "--p2c-disable-alpha" - }, - { - "Id": "fc633c46-6b09-43e6-9c02-3e4817ef382e", - "Command": "--p2c-debug-wait-render" - }, - { - "Id": "f556bf27-cb7e-4a17-a7cb-3c0400aeb7d1", - "Command": "--p2c-debug-wait-client" - }, - { - "Id": "92d25458-0b38-4e99-a582-49f0c90979c2", - "Command": "--help" - }, - { - "Id": "55e7fd71-7671-4a27-9bc8-6c8ed651597f", - "Command": "--remote-allow-origins=http://127.0.0.1:9009" - } - ] -} \ No newline at end of file diff --git a/IntelPresentMon/PMInstallerExtension/PMInstallerExtension.args.json b/IntelPresentMon/PMInstallerExtension/PMInstallerExtension.args.json deleted file mode 100644 index 1624699ac..000000000 --- a/IntelPresentMon/PMInstallerExtension/PMInstallerExtension.args.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "FileVersion": 2, - "Id": "b829469b-624b-3a7f-a2a9-063768b6bf81", - "Items": [ - { - "Id": "ccd5d4f9-221a-4bdc-9546-04755edfb952", - "Command": "Debug", - "ProjectConfig": "Debug", - "ProjectPlatform": "Any CPU", - "Items": [ - { - "Id": "66a30189-7267-494c-b97a-04152dcc0971", - "Command": "--help" - } - ] - } - ] -} \ No newline at end of file diff --git a/PresentMon/PresentMon.args.json b/PresentMon/PresentMonConsole.args.json similarity index 100% rename from PresentMon/PresentMon.args.json rename to PresentMon/PresentMonConsole.args.json diff --git a/Tests/PresentMonTests.args.json b/Tests/PresentMonTests.args.json deleted file mode 100644 index 4590f18cc..000000000 --- a/Tests/PresentMonTests.args.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "FileVersion": 2, - "Id": "651f1569-8dd5-3714-802d-da1858be8ba5", - "Items": [ - { - "Id": "0a297b29-b817-4fec-899b-b608a7e51bc4", - "Command": "Debug|x64", - "ProjectConfig": "Debug", - "ProjectPlatform": "x64", - "Items": [ - { - "Id": "a6fb5569-0d64-4e0d-85eb-2409faee14cc", - "Command": "WindowsLocalDebugger", - "Items": [ - { - "Id": "24c8b220-ee14-4795-bc47-8e8202db9798", - "Command": "--help --debug_verbose_trace --track_gpu_video --qpc_time --output_file vvv.csv --etl_file \"C:\\Users\\Chili\\Desktop\\cpp\\ipm-relay\\Tests\\Gold\\test_case_4.etl\" --stop_existing_session --no_console_stats" - } - ] - }, - { - "Id": "461dab48-e20b-4a91-b9a4-601f6847153f", - "Command": "WindowsRemoteDebugger", - "Items": [ - { - "Id": "96c9e57a-c06b-46ab-bc78-89c193c23249", - "Command": "--help --debug_verbose_trace --track_gpu_video --qpc_time --output_file vvv.csv --etl_file \"C:\\Users\\Chili\\Desktop\\cpp\\ipm-relay\\Tests\\Gold\\test_case_4.etl\" --stop_existing_session --no_console_stats" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/cmake/PresentMonCommandLineArguments.cmake b/cmake/PresentMonCommandLineArguments.cmake new file mode 100644 index 000000000..34ccace06 --- /dev/null +++ b/cmake/PresentMonCommandLineArguments.cmake @@ -0,0 +1,111 @@ +include_guard(GLOBAL) + +function(_pmon_command_line_args_is_build_binary_dir out_var) + cmake_path(SET _pmon_expected_build_dir "${CMAKE_SOURCE_DIR}/build" NORMALIZE) + cmake_path(SET _pmon_actual_binary_dir "${CMAKE_BINARY_DIR}" NORMALIZE) + if(_pmon_actual_binary_dir STREQUAL _pmon_expected_build_dir) + set("${out_var}" TRUE PARENT_SCOPE) + else() + set("${out_var}" FALSE PARENT_SCOPE) + endif() +endfunction() + +function(_pmon_command_line_args_apply) + set(_pmon_mappings + "IntelPresentMon/KernelProcess|KernelProcess|IntelPresentMon/KernelProcess/KernelProcess.args.json" + "IntelPresentMon/PresentMonService|PresentMonService|IntelPresentMon/PresentMonService/PresentMonService.args.json" + "PresentMon|PresentMonConsole|PresentMon/PresentMonConsole.args.json" + "IntelPresentMon/SampleClient|SampleClient|IntelPresentMon/SampleClient/SampleClient.args.json" + "Tools/ETLTrimmer|ETLTrimmer|Tools/ETLTrimmer/ETLTrimmer.args.json" + ) + + set(_pmon_linked 0) + + foreach(_pmon_mapping IN LISTS _pmon_mappings) + string(REPLACE "|" ";" _pmon_fields "${_pmon_mapping}") + list(GET _pmon_fields 0 _pmon_subdir) + list(GET _pmon_fields 1 _pmon_target) + list(GET _pmon_fields 2 _pmon_source_rel) + + set(_pmon_vcxproj "${CMAKE_BINARY_DIR}/${_pmon_subdir}/${_pmon_target}.vcxproj") + if(NOT EXISTS "${_pmon_vcxproj}") + continue() + endif() + + set(_pmon_source "${CMAKE_SOURCE_DIR}/${_pmon_source_rel}") + if(NOT EXISTS "${_pmon_source}") + message( + WARNING + "Command line args symlink: missing source preset ${_pmon_source_rel}." + ) + continue() + endif() + + set(_pmon_link "${CMAKE_BINARY_DIR}/${_pmon_subdir}/${_pmon_target}.args.json") + if(EXISTS "${_pmon_link}") + file(REMOVE "${_pmon_link}") + endif() + + file(CREATE_LINK "${_pmon_source}" "${_pmon_link}" SYMBOLIC RESULT _pmon_link_result) + if(_pmon_link_result) + message( + WARNING + "Command line args symlink: could not link\n" + " ${_pmon_link}\n" + " -> ${_pmon_source}\n" + " (${_pmon_link_result}). Enable Windows Developer Mode or run from an elevated shell." + ) + continue() + endif() + + math(EXPR _pmon_linked "${_pmon_linked} + 1") + endforeach() + + if(_pmon_linked GREATER 0) + message(STATUS "Linked ${_pmon_linked} Command Line Arguments preset(s) under ${CMAKE_BINARY_DIR}.") + endif() +endfunction() + +function(pmon_register_command_line_args_symlinks) + if(NOT CMAKE_GENERATOR MATCHES "Visual Studio") + return() + endif() + + _pmon_command_line_args_is_build_binary_dir(_pmon_is_build_dir) + if(NOT _pmon_is_build_dir) + if(PMON_LINK_COMMAND_LINE_ARGS) + message( + STATUS + "PMON_LINK_COMMAND_LINE_ARGS is ON but the binary directory is not " + "${CMAKE_SOURCE_DIR}/build; skipping command line args symlinks." + ) + endif() + return() + endif() + + add_custom_target( + pmon_link_command_line_args + COMMAND + ${CMAKE_COMMAND} + -DCMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} + -DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR} + -DPMON_COMMAND_LINE_ARGS_APPLY=1 + -P ${CMAKE_CURRENT_LIST_DIR}/PresentMonCommandLineArguments.cmake + USES_TERMINAL + VERBATIM + ) + set_target_properties( + pmon_link_command_line_args + PROPERTIES + EXCLUDE_FROM_DEFAULT_BUILD TRUE + FOLDER "Build" + ) + + if(PMON_LINK_COMMAND_LINE_ARGS) + _pmon_command_line_args_apply() + endif() +endfunction() + +if(PMON_COMMAND_LINE_ARGS_APPLY) + _pmon_command_line_args_apply() +endif() diff --git a/cmake/PresentMonOptions.cmake b/cmake/PresentMonOptions.cmake index a5cef1b56..a8bc030b4 100644 --- a/cmake/PresentMonOptions.cmake +++ b/cmake/PresentMonOptions.cmake @@ -96,6 +96,11 @@ function(pmon_configure_options) "Register CTest entry for the Tests/Full gold CSV suite" OFF ) + option( + PMON_LINK_COMMAND_LINE_ARGS + "Symlink source-tree *.args.json presets beside generated Visual Studio projects in -B build" + OFF + ) cmake_dependent_option( PMON_BUILD_PRESENTMON_TESTS From f24c1127a28d1c0904262e8bc50ccdb3388cf19c Mon Sep 17 00:00:00 2001 From: "Taylor, Raymond" Date: Tue, 22 Sep 2026 12:00:31 -0700 Subject: [PATCH 3/6] add cli args cmake capability documentation --- BUILDING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BUILDING.md b/BUILDING.md index f3cd047da..03af2924f 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -644,6 +644,11 @@ as the startup project, and use these arguments: Use `\Debug` as the working directory. With `--svc-as-child`, the UI starts `PresentMonService.exe` from the same directory. +For the Visual Studio Command Line Arguments extension with `-B build`, configure +with `-DPMON_LINK_COMMAND_LINE_ARGS=ON` to symlink source-tree `*.args.json` +presets next to generated projects, or run +`cmake --build build --target pmon_link_command_line_args` later. + Realtime ETW workflows normally require membership in `Performance Log Users`. Sign out and back in after adding the user to that group. Debug uses `uiAccess=false`. Release `PresentMon.exe` uses `uiAccess=true` and normally From 7685ec52dc122674cf4bcf51a4a23c527616149e Mon Sep 17 00:00:00 2001 From: "Taylor, Raymond" Date: Wed, 23 Sep 2026 15:59:11 -0700 Subject: [PATCH 4/6] Fix command line args linking and ETLTrimmer preset GUID. Correct the ETLTrimmer args.json Id, link presets when CMake targets exist before vcxproj generation, and invoke the manual link script from the module directory. --- Tools/ETLTrimmer/ETLTrimmer.args.json | 2 +- cmake/PresentMonCommandLineArguments.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tools/ETLTrimmer/ETLTrimmer.args.json b/Tools/ETLTrimmer/ETLTrimmer.args.json index d1463d166..18ab32b70 100644 --- a/Tools/ETLTrimmer/ETLTrimmer.args.json +++ b/Tools/ETLTrimmer/ETLTrimmer.args.json @@ -1,6 +1,6 @@ { "FileVersion": 2, - "Id": "c0bcccb39-2630-30ac-bb26-880b8a120193", + "Id": "c0bccb39-2630-30ac-bb26-880b8a120193", "Items": [ { "Id": "0f02ddbd-6110-43dd-982a-900bffd8549c", diff --git a/cmake/PresentMonCommandLineArguments.cmake b/cmake/PresentMonCommandLineArguments.cmake index 34ccace06..203828d1c 100644 --- a/cmake/PresentMonCommandLineArguments.cmake +++ b/cmake/PresentMonCommandLineArguments.cmake @@ -28,7 +28,7 @@ function(_pmon_command_line_args_apply) list(GET _pmon_fields 2 _pmon_source_rel) set(_pmon_vcxproj "${CMAKE_BINARY_DIR}/${_pmon_subdir}/${_pmon_target}.vcxproj") - if(NOT EXISTS "${_pmon_vcxproj}") + if(NOT TARGET "${_pmon_target}" AND NOT EXISTS "${_pmon_vcxproj}") continue() endif() @@ -90,7 +90,7 @@ function(pmon_register_command_line_args_symlinks) -DCMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} -DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR} -DPMON_COMMAND_LINE_ARGS_APPLY=1 - -P ${CMAKE_CURRENT_LIST_DIR}/PresentMonCommandLineArguments.cmake + -P ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/PresentMonCommandLineArguments.cmake USES_TERMINAL VERBATIM ) From d71788c1f1f9a5e057c613be40333709ea211bfa Mon Sep 17 00:00:00 2001 From: "Taylor, Raymond" Date: Wed, 23 Sep 2026 16:55:23 -0700 Subject: [PATCH 5/6] Single path only for args symlings --- BUILDING.md | 7 ++++--- cmake/PresentMonCommandLineArguments.cmake | 11 +++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 03af2924f..432859a10 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -645,9 +645,10 @@ Use `\Debug` as the working directory. With `--svc-as-child`, the UI starts `PresentMonService.exe` from the same directory. For the Visual Studio Command Line Arguments extension with `-B build`, configure -with `-DPMON_LINK_COMMAND_LINE_ARGS=ON` to symlink source-tree `*.args.json` -presets next to generated projects, or run -`cmake --build build --target pmon_link_command_line_args` later. +or re-configure with `-DPMON_LINK_COMMAND_LINE_ARGS=ON` to symlink source-tree +`*.args.json` presets next to generated projects. The +`pmon_link_command_line_args` build target runs the same configure step with that +option enabled (for example after editing presets). Realtime ETW workflows normally require membership in `Performance Log Users`. Sign out and back in after adding the user to that group. Debug uses diff --git a/cmake/PresentMonCommandLineArguments.cmake b/cmake/PresentMonCommandLineArguments.cmake index 203828d1c..94434b62f 100644 --- a/cmake/PresentMonCommandLineArguments.cmake +++ b/cmake/PresentMonCommandLineArguments.cmake @@ -87,10 +87,9 @@ function(pmon_register_command_line_args_symlinks) pmon_link_command_line_args COMMAND ${CMAKE_COMMAND} - -DCMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} - -DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR} - -DPMON_COMMAND_LINE_ARGS_APPLY=1 - -P ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/PresentMonCommandLineArguments.cmake + -S "${CMAKE_SOURCE_DIR}" + -B "${CMAKE_BINARY_DIR}" + -DPMON_LINK_COMMAND_LINE_ARGS=ON USES_TERMINAL VERBATIM ) @@ -105,7 +104,3 @@ function(pmon_register_command_line_args_symlinks) _pmon_command_line_args_apply() endif() endfunction() - -if(PMON_COMMAND_LINE_ARGS_APPLY) - _pmon_command_line_args_apply() -endif() From d94ec3e21463bca55db2d44b288fceee3e56096c Mon Sep 17 00:00:00 2001 From: "Taylor, Raymond" Date: Thu, 24 Sep 2026 05:28:59 -0700 Subject: [PATCH 6/6] Fix cmake_path NORMALIZE syntax for CLI args build-dir check. Place NORMALIZE before the input path so -B build detection matches PresentMonVisualStudio conventions. --- cmake/PresentMonCommandLineArguments.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/PresentMonCommandLineArguments.cmake b/cmake/PresentMonCommandLineArguments.cmake index 94434b62f..5d3558c5c 100644 --- a/cmake/PresentMonCommandLineArguments.cmake +++ b/cmake/PresentMonCommandLineArguments.cmake @@ -1,8 +1,8 @@ include_guard(GLOBAL) function(_pmon_command_line_args_is_build_binary_dir out_var) - cmake_path(SET _pmon_expected_build_dir "${CMAKE_SOURCE_DIR}/build" NORMALIZE) - cmake_path(SET _pmon_actual_binary_dir "${CMAKE_BINARY_DIR}" NORMALIZE) + cmake_path(SET _pmon_expected_build_dir NORMALIZE "${CMAKE_SOURCE_DIR}/build") + cmake_path(SET _pmon_actual_binary_dir NORMALIZE "${CMAKE_BINARY_DIR}") if(_pmon_actual_binary_dir STREQUAL _pmon_expected_build_dir) set("${out_var}" TRUE PARENT_SCOPE) else()