1
1
include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} /.. )
2
2
3
- set (GIT_REPOSITORY https://github.com/intel/ittapi.git )
4
- set (GIT_TAG v3.18.8 )
3
+ if (NOT DEFINED ITTAPI_GIT_REPOSITORY )
4
+ set (ITTAPI_GIT_REPOSITORY https://github.com/intel/ittapi.git )
5
+ endif ()
6
+
7
+ if (NOT DEFINED ITTAPI_GIT_TAG )
8
+ set (ITTAPI_GIT_TAG v3.18.8 )
9
+ endif ()
10
+
11
+ if (NOT DEFINED ITTAPI_SOURCE_DIR )
12
+ set (ITTAPI_SOURCE_DIR ${PROJECT_BINARY_DIR} )
13
+ endif ()
5
14
6
- if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR } /ittapi )
7
- execute_process (COMMAND ${GIT_EXECUTABLE} clone ${GIT_REPOSITORY }
8
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR }
15
+ if (NOT EXISTS ${ITTAPI_SOURCE_DIR } /ittapi )
16
+ execute_process (COMMAND ${GIT_EXECUTABLE} clone ${ITTAPI_GIT_REPOSITORY }
17
+ WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR }
9
18
RESULT_VARIABLE GIT_CLONE_RESULT )
10
19
if (NOT GIT_CLONE_RESULT EQUAL "0" )
11
- message (FATAL_ERROR "git clone ${GIT_REPOSITORY } failed with ${GIT_CLONE_RESULT} , please clone ${GIT_REPOSITORY } " )
20
+ message (FATAL_ERROR "git clone ${ITTAPI_GIT_REPOSITORY } failed with ${GIT_CLONE_RESULT} , please clone ${ITTAPI_GIT_REPOSITORY } " )
12
21
endif ()
13
22
endif ()
14
23
15
- execute_process (COMMAND ${GIT_EXECUTABLE} checkout ${GIT_TAG }
16
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR } /ittapi
24
+ execute_process (COMMAND ${GIT_EXECUTABLE} checkout ${ITTAPI_GIT_TAG }
25
+ WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR } /ittapi
17
26
RESULT_VARIABLE GIT_CHECKOUT_RESULT )
18
27
if (NOT GIT_CHECKOUT_RESULT EQUAL "0" )
19
- message (FATAL_ERROR "git checkout ${GIT_TAG } failed with ${GIT_CHECKOUT_RESULT} , please checkout ${GIT_TAG } at ${CMAKE_CURRENT_SOURCE_DIR } /ittapi" )
28
+ message (FATAL_ERROR "git checkout ${ITTAPI_GIT_TAG } failed with ${GIT_CHECKOUT_RESULT} , please checkout ${ITTAPI_GIT_TAG } at ${ITTAPI_SOURCE_DIR } /ittapi" )
20
29
endif ()
21
30
22
- include_directories ( ${CMAKE_CURRENT_SOURCE_DIR } /ittapi/include/ )
31
+ include_directories ( ${ITTAPI_SOURCE_DIR } /ittapi/include/ )
23
32
24
33
if ( HAVE_LIBDL )
25
34
set (LLVM_INTEL_JIT_LIBS ${CMAKE_DL_LIBS} )
@@ -31,7 +40,7 @@ set(LLVM_INTEL_JIT_LIBS ${LLVM_PTHREAD_LIB} ${LLVM_INTEL_JIT_LIBS})
31
40
add_llvm_component_library (LLVMIntelJITEvents
32
41
IntelJITEventListener.cpp
33
42
jitprofiling.c
34
- ittapi/src/ittnotify/ittnotify_static.c
43
+ ${ITTAPI_SOURCE_DIR} / ittapi/src/ittnotify/ittnotify_static.c
35
44
36
45
LINK_LIBS ${LLVM_INTEL_JIT_LIBS}
37
46
0 commit comments