summaryrefslogtreecommitdiff
path: root/lld/cmake
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2013-04-06 00:56:40 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2013-04-06 00:56:40 +0000
commitd4eb47c110f278c4bd503daec771b587de86f9aa (patch)
tree21d12f689b704522ec24ecab003b5ce8ce0defcd /lld/cmake
parente9846f7f3c781a77d1e3e62b061857d533c97f29 (diff)
downloadllvm-d4eb47c110f278c4bd503daec771b587de86f9aa.tar.gz
Add VTune as an optional external dependency and add task tracking.
llvm-svn: 178940
Diffstat (limited to 'lld/cmake')
-rw-r--r--lld/cmake/modules/FindVTune.cmake31
1 files changed, 31 insertions, 0 deletions
diff --git a/lld/cmake/modules/FindVTune.cmake b/lld/cmake/modules/FindVTune.cmake
new file mode 100644
index 000000000000..bd0cbe9a38cb
--- /dev/null
+++ b/lld/cmake/modules/FindVTune.cmake
@@ -0,0 +1,31 @@
+# - Find VTune ittnotify.
+# Defines:
+# VTune_FOUND
+# VTune_INCLUDE_DIRS
+# VTune_LIBRARIES
+
+set(dirs
+ "$ENV{VTUNE_AMPLIFIER_XE_2013_DIR}/"
+ "C:/Program Files (x86)/Intel/VTune Amplifier XE 2013/"
+ "$ENV{VTUNE_AMPLIFIER_XE_2011_DIR}/"
+ "C:/Program Files (x86)/Intel/VTune Amplifier XE 2011/"
+ )
+
+find_path(VTune_INCLUDE_DIRS ittnotify.h
+ PATHS ${dirs}
+ PATH_SUFFIXES include)
+
+if (CMAKE_SIZEOF_VOID_P MATCHES "8")
+ set(vtune_lib_dir lib64)
+else()
+ set(vtune_lib_dir lib32)
+endif()
+
+find_library(VTune_LIBRARIES libittnotify
+ HINTS "${VTune_INCLUDE_DIRS}/.."
+ PATHS ${dirs}
+ PATH_SUFFIXES ${vtune_lib_dir})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+ VTune DEFAULT_MSG VTune_LIBRARIES VTune_INCLUDE_DIRS)