From 656c2775ac6f451b1876afdd9e6f955a47e98bd2 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Mon, 11 Oct 2021 21:48:44 -0500 Subject: [PATCH] CMake: Add vtune support on Windows --- cmake/FindVtune.cmake | 22 ++++++++++++---------- cmake/SearchForStuff.cmake | 1 + 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/cmake/FindVtune.cmake b/cmake/FindVtune.cmake index e3327f2cdc..66293b3d19 100644 --- a/cmake/FindVtune.cmake +++ b/cmake/FindVtune.cmake @@ -5,18 +5,20 @@ # VTUNE_INCLUDE_DIRS include path to jitprofiling.h # VTUNE_LIBRARIES path to vtune libs -find_path(VTUNE_INCLUDE_DIRS NAMES jitprofiling.h PATHS - /opt/intel/oneapi/vtune/latest/include - /opt/intel/vtune_amplifier_xe_2018/include - /opt/intel/vtune_amplifier_xe_2017/include - /opt/intel/vtune_amplifier_xe_2016/include +set(VTUNE_PATHS + /opt/intel/oneapi/vtune/latest + /opt/intel/vtune_amplifier_xe_2018 + /opt/intel/vtune_amplifier_xe_2017 + /opt/intel/vtune_amplifier_xe_2016 + "C:\\Program Files (x86)\\Intel\\oneAPI\\vtune\\latest" ) -find_library(VTUNE_LIBRARIES NAMES libjitprofiling.a PATHS - /opt/intel/oneapi/vtune/latest/lib64 - /opt/intel/vtune_amplifier_xe_2018/lib64 - /opt/intel/vtune_amplifier_xe_2017/lib64 - /opt/intel/vtune_amplifier_xe_2016/lib64 +find_path(VTUNE_INCLUDE_DIRS NAMES jitprofiling.h PATHS ${VTUNE_PATHS} PATH_SUFFIXES include) + +find_library(VTUNE_LIBRARIES + NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}jitprofiling${CMAKE_STATIC_LIBRARY_SUFFIX} + PATHS ${VTUNE_PATHS} + PATH_SUFFIXES lib64 ) # handle the QUIETLY and REQUIRED arguments and set VTUNE_FOUND to TRUE if diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index d39696cc12..7921b6b7a1 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -14,6 +14,7 @@ if (WIN32) add_subdirectory(3rdparty/xz EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/D3D12MemAlloc EXCLUDE_FROM_ALL) set(FFMPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/3rdparty/ffmpeg/include") + find_package(Vtune) else() find_package(PCAP REQUIRED) find_package(LibLZMA REQUIRED)