2016-12-04 17:46:02 +00:00
|
|
|
# Find Intel's VTUNE tool
|
|
|
|
|
2021-07-04 05:24:21 +00:00
|
|
|
# VTUNE_FOUND found Vtune
|
2021-04-17 20:30:03 +00:00
|
|
|
# Vtune::Vtune Imported target, if found
|
2021-07-04 05:24:21 +00:00
|
|
|
# VTUNE_INCLUDE_DIRS include path to jitprofiling.h
|
|
|
|
# VTUNE_LIBRARIES path to vtune libs
|
2016-12-04 17:46:02 +00:00
|
|
|
|
|
|
|
find_path(VTUNE_INCLUDE_DIRS NAMES jitprofiling.h PATHS
|
2021-08-21 20:35:50 +00:00
|
|
|
/opt/intel/oneapi/vtune/latest/include
|
2021-07-04 05:24:21 +00:00
|
|
|
/opt/intel/vtune_amplifier_xe_2018/include
|
|
|
|
/opt/intel/vtune_amplifier_xe_2017/include
|
|
|
|
/opt/intel/vtune_amplifier_xe_2016/include
|
|
|
|
)
|
2016-12-04 17:46:02 +00:00
|
|
|
|
|
|
|
if(${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386")
|
2021-07-04 05:24:21 +00:00
|
|
|
find_library(VTUNE_LIBRARIES NAMES libjitprofiling.a PATHS
|
2021-08-21 20:35:50 +00:00
|
|
|
/opt/intel/oneapi/vtune/latest/lib32
|
2021-07-04 05:24:21 +00:00
|
|
|
/opt/intel/vtune_amplifier_xe_2018/lib32
|
|
|
|
/opt/intel/vtune_amplifier_xe_2017/lib32
|
|
|
|
/opt/intel/vtune_amplifier_xe_2016/lib32
|
|
|
|
)
|
2016-12-04 17:46:02 +00:00
|
|
|
else()
|
2021-07-04 05:24:21 +00:00
|
|
|
find_library(VTUNE_LIBRARIES NAMES libjitprofiling.a PATHS
|
2021-08-21 20:35:50 +00:00
|
|
|
/opt/intel/oneapi/vtune/latest/lib64
|
2021-07-04 05:24:21 +00:00
|
|
|
/opt/intel/vtune_amplifier_xe_2018/lib64
|
|
|
|
/opt/intel/vtune_amplifier_xe_2017/lib64
|
|
|
|
/opt/intel/vtune_amplifier_xe_2016/lib64
|
|
|
|
)
|
2016-12-04 17:46:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# handle the QUIETLY and REQUIRED arguments and set VTUNE_FOUND to TRUE if
|
|
|
|
# all listed variables are TRUE
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Vtune DEFAULT_MSG VTUNE_LIBRARIES VTUNE_INCLUDE_DIRS)
|
|
|
|
|
2021-04-17 20:30:03 +00:00
|
|
|
if(VTUNE_LIBRARIES AND NOT TARGET Vtune::Vtune)
|
|
|
|
add_library(Vtune::Vtune UNKNOWN IMPORTED GLOBAL)
|
|
|
|
set_target_properties(Vtune::Vtune PROPERTIES
|
|
|
|
IMPORTED_LOCATION "${VTUNE_LIBRARIES}"
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${VTUNE_INCLUDE_DIRS}")
|
|
|
|
endif()
|
|
|
|
|
2016-12-04 17:46:02 +00:00
|
|
|
mark_as_advanced(VTUNE_FOUND VTUNE_INCLUDE_DIRS VTUNE_LIBRARIES)
|
|
|
|
|