diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/presentmon | |
Diffstat (limited to 'vcpkg/ports/presentmon')
| -rw-r--r-- | vcpkg/ports/presentmon/CMakeLists.txt | 70 | ||||
| -rw-r--r-- | vcpkg/ports/presentmon/portfile.cmake | 32 | ||||
| -rw-r--r-- | vcpkg/ports/presentmon/vcpkg.json | 17 |
3 files changed, 119 insertions, 0 deletions
diff --git a/vcpkg/ports/presentmon/CMakeLists.txt b/vcpkg/ports/presentmon/CMakeLists.txt new file mode 100644 index 0000000..427516a --- /dev/null +++ b/vcpkg/ports/presentmon/CMakeLists.txt @@ -0,0 +1,70 @@ +cmake_minimum_required(VERSION 3.11) +project(presentmon) + +option(INSTALL_HEADERS "Install presentmon headers" ON) +option(BUILD_TOOLS "Build tool PresentMon" OFF) + +set(PRESENTDATA_SRCS + PresentData/Debug.cpp + PresentData/GpuTrace.cpp + PresentData/PresentMonTraceConsumer.cpp + PresentData/PresentMonTraceSession.cpp + PresentData/TraceConsumer.cpp +) + +set(PRESENTDATA_HDRS + PresentData/Debug.hpp + PresentData/GpuTrace.hpp + PresentData/PresentMonTraceConsumer.hpp + PresentData/PresentMonTraceSession.hpp + PresentData/TraceConsumer.hpp + ${CMAKE_BINARY_DIR}/generated/version.h +) + + +file(GLOB EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/PresentData/ETW/*.h) + +file(WRITE ${CMAKE_BINARY_DIR}/generated/version.h "char const* PRESENT_MON_VERSION = \"1.7.0\";") + +add_library(PresentData STATIC ${PRESENTDATA_SRCS} ${PRESENTDATA_HDRS} ${EXTRA_INCLUDES}) + +target_include_directories(PresentData PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/PresentData> + $<INSTALL_INTERFACE:include/presentmon> +) +target_compile_definitions(PresentData PRIVATE UNICODE) + +# Install targets +install(TARGETS PresentData + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + +if (BUILD_TOOLS) + set(PresentMon_SRCS + PresentMon/CommandLine.cpp + PresentMon/Console.cpp + PresentMon/ConsumerThread.cpp + PresentMon/CsvOutput.cpp + PresentMon/MainThread.cpp + PresentMon/OutputThread.cpp + PresentMon/Privilege.cpp + PresentMon/PresentMon.hpp + ) + + add_executable(PresentMon ${PresentMon_SRCS}) + target_include_directories(PresentMon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/PresentMon ${CMAKE_BINARY_DIR}) + target_compile_definitions(PresentMon PRIVATE UNICODE) + target_link_libraries(PresentMon PRIVATE PresentData Tdh Shlwapi) + + install(TARGETS PresentMon + RUNTIME DESTINATION bin + ) +endif() + +# Install headers +if (INSTALL_HEADERS) + install(FILES ${PRESENTDATA_HDRS} DESTINATION include/presentmon) + install(FILES ${EXTRA_INCLUDES} DESTINATION include/presentmon/ETW) +endif() diff --git a/vcpkg/ports/presentmon/portfile.cmake b/vcpkg/ports/presentmon/portfile.cmake new file mode 100644 index 0000000..d9432e8 --- /dev/null +++ b/vcpkg/ports/presentmon/portfile.cmake @@ -0,0 +1,32 @@ +# The upstream doesn't export any symbols +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO GameTechDev/PresentMon + REF "v${VERSION}" + SHA512 1c606dd53a05b88a500a2deeb7099ce3cf0e9edfdf6ce8f9a1a91efecf9049bf700368066cbafc1e196f4bf8a6e43da86a2f10ad0843b582ab851e366a33eda4 + HEAD_REF main +) + +file(COPY "${CURRENT_PORT_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + tools BUILD_TOOLS +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS ${FEATURE_OPTIONS} + OPTIONS_DEBUG + -DINSTALL_HEADERS=OFF +) + +vcpkg_cmake_install() + +if("tools" IN_LIST FEATURES) + vcpkg_copy_tools(TOOL_NAMES presentmon AUTO_CLEAN) +endif() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") diff --git a/vcpkg/ports/presentmon/vcpkg.json b/vcpkg/ports/presentmon/vcpkg.json new file mode 100644 index 0000000..67b2621 --- /dev/null +++ b/vcpkg/ports/presentmon/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "presentmon", + "version-semver": "2.3.0", + "description": "PresentMon is a tool to capture and analyze ETW events related to swap chain presentation on Windows.", + "supports": "windows & !uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ], + "features": { + "tools": { + "description": "Build tool PresentMon" + } + } +} |