-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathFindITTNOTIFY.cmake
65 lines (52 loc) · 2.24 KB
/
FindITTNOTIFY.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# ITTNOTIFY is the instrumentation and tracing technology (ITT) APIs provided by
# the Intel® VTune™Amplifier enable your application to generate and control
# the collection of trace data during its execution.
#
# The following variables are set when ITTNOTIFY is found:
# ITTNOTIFY_FOUND = Set to true, if all components of ITTNOTIFY have been found.
# ITTNOTIFY_INCLUDE_DIRS = Include path for the header files of ITTNOTIFY.
# ITTNOTIFY_LIBRARY_DIRS = Library search path for the ITTNOTIFY libraries.
# ITTNOTIFY_LIBRARIES = Link these to use ITTNOTIFY.
# ITTNOTIFY_LFLAGS = Linker flags (optional).
if (NOT ITTNOTIFY_FOUND)
find_program(VTUNE_EXECUTABLE amplxe-cl)
if(NOT VTUNE_EXECUTABLE)
set(ITTNOTIFY_FOUND false)
return()
endif()
get_filename_component(VTUNE_DIR ${VTUNE_EXECUTABLE} PATH)
set(ITTNOTIFY_ROOT_DIR "${VTUNE_DIR}/..")
##_____________________________________________________________________________
## Check for the header files
find_path (ITTNOTIFY_INCLUDE_DIRS
NAMES ittnotify.h
HINTS ${ITTNOTIFY_ROOT_DIR}
PATHS /usr /usr/local
PATH_SUFFIXES include
)
##_____________________________________________________________________________
## Check for the library
find_library (ITTNOTIFY_LIBRARIES ittnotify
HINTS ${ITTNOTIFY_ROOT_DIR}
PATHS /usr /usr/local /opt/local
PATH_SUFFIXES lib64 lib
)
##_____________________________________________________________________________
## Actions taken when all components have been found
find_package_handle_standard_args (ITTNOTIFY DEFAULT_MSG ITTNOTIFY_LIBRARIES ITTNOTIFY_INCLUDE_DIRS)
if (ITTNOTIFY_FOUND)
if (NOT ITTNOTIFY_FIND_QUIETLY)
message (STATUS "Found components for ITTNOTIFY")
message (STATUS "ITTNOTIFY_ROOT_DIR = ${ITTNOTIFY_ROOT_DIR}")
message (STATUS "ITTNOTIFY_INCLUDE_DIRS = ${ITTNOTIFY_INCLUDE_DIRS}")
message (STATUS "ITTNOTIFY_LIBRARIES = ${ITTNOTIFY_LIBRARIES}")
endif (NOT ITTNOTIFY_FIND_QUIETLY)
else (ITTNOTIFY_FOUND)
if (ITTNOTIFY_FIND_REQUIRED)
message (FATAL_ERROR "Could not find ITTNOTIFY!")
endif (ITTNOTIFY_FIND_REQUIRED)
endif (ITTNOTIFY_FOUND)
if(UNIX)
list(APPEND ITTNOTIFY_LIBRARIES dl)
endif()
endif (NOT ITTNOTIFY_FOUND)