[x265] [PATCH] Enabling support for vtune 2015 & 2016

pradeep at multicorewareinc.com pradeep at multicorewareinc.com
Thu Oct 8 06:31:04 CEST 2015


# HG changeset patch
# User Pradeep Ramachandran <pradeep at multicorewareinc.com>
# Date 1444278641 -19800
#      Thu Oct 08 10:00:41 2015 +0530
# Node ID 76bcae1864fbda7ed829cec9e106bd6478caa3c7
# Parent  f8b8ebdc54578e6735216d8b9abce5ba80c05bd8
Enabling support for vtune 2015 & 2016

diff -r f8b8ebdc5457 -r 76bcae1864fb source/CMakeLists.txt
--- a/source/CMakeLists.txt	Mon Sep 28 14:34:41 2015 +0530
+++ b/source/CMakeLists.txt	Thu Oct 08 10:00:41 2015 +0530
@@ -383,16 +383,26 @@
 
 option(ENABLE_VTUNE "Enable Vtune profiling instrumentation" OFF)
 if(ENABLE_VTUNE)
-    add_definitions(-DENABLE_VTUNE)
-    include_directories($ENV{VTUNE_AMPLIFIER_XE_2015_DIR}/include)
-    list(APPEND PLATFORM_LIBS vtune)
-    link_directories($ENV{VTUNE_AMPLIFIER_XE_2015_DIR}/lib64)
-    if(WIN32)
-        list(APPEND PLATFORM_LIBS libittnotify.lib)
+    if(NOT("$ENV{VTUNE_AMPLIFIER_XE_2016_DIR}" STREQUAL ""))
+        set(VTUNE_DIR $ENV{VTUNE_AMPLIFIER_XE_2016_DIR})
+    elseif(NOT("$ENV{VTUNE_AMPLIFIER_XE_2015_DIR}" STREQUAL ""))
+        set(VTUNE_DIR $ENV{VTUNE_AMPLIFIER_XE_2015_DIR})
+    endif()
+
+    if(VTUNE_DIR)
+        add_definitions(-DENABLE_VTUNE)
+        include_directories(${VTUNE_DIR}/include)
+        list(APPEND PLATFORM_LIBS vtune)
+        link_directories(${VTUNE_DIR}/lib64)
+        if(WIN32)
+            list(APPEND PLATFORM_LIBS libittnotify.lib)
+        else()
+            list(APPEND PLATFORM_LIBS libittnotify.a dl)
+        endif()
+        add_subdirectory(profile/vtune)
     else()
-        list(APPEND PLATFORM_LIBS libittnotify.a dl)
+        MESSAGE("Setup vtune 2015/16 and then enable vtune support")
     endif()
-    add_subdirectory(profile/vtune)
 endif(ENABLE_VTUNE)
 
 option(DETAILED_CU_STATS "Enable internal profiling of encoder work" OFF)
diff -r f8b8ebdc5457 -r 76bcae1864fb source/profile/vtune/CMakeLists.txt
--- a/source/profile/vtune/CMakeLists.txt	Mon Sep 28 14:34:41 2015 +0530
+++ b/source/profile/vtune/CMakeLists.txt	Thu Oct 08 10:00:41 2015 +0530
@@ -1,2 +1,9 @@
-include_directories($ENV{VTUNE_AMPLIFIER_XE_2015_DIR}/include)
+if(NOT("$ENV{VTUNE_AMPLIFIER_XE_2016_DIR}" STREQUAL ""))
+    set(VTUNE_DIR $ENV{VTUNE_AMPLIFIER_XE_2016_DIR})
+elseif(NOT("$ENV{VTUNE_AMPLIFIER_XE_2015_DIR}" STREQUAL ""))
+    set(VTUNE_DIR $ENV{VTUNE_AMPLIFIER_XE_2015_DIR})
+endif()
+
+# This script is called only when vtune is found
+include_directories(${VTUNE_DIR}/include)
 add_library(vtune vtune.h vtune.cpp ../cpuEvents.h)


More information about the x265-devel mailing list