summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindQAT.cmake40
-rw-r--r--cmake/modules/FindQatDrv.cmake8
2 files changed, 48 insertions, 0 deletions
diff --git a/cmake/modules/FindQAT.cmake b/cmake/modules/FindQAT.cmake
new file mode 100644
index 00000000000..9044e549392
--- /dev/null
+++ b/cmake/modules/FindQAT.cmake
@@ -0,0 +1,40 @@
+find_package(PkgConfig)
+pkg_search_module(PC_QAT libqat qatlib QUIET)
+
+find_path(QAT_INCLUDE_DIR
+ NAMES qat/cpa.h
+ HINTS ${PC_QAT_INCLUDE_DIRS})
+
+find_library(QAT_LIBRARY
+ NAMES qat
+ HINTS ${PC_QAT_LIBRARY_DIRS})
+
+find_library(QAT_USDM_LIBRARY
+ NAMES usdm
+ HINTS ${PC_QAT_LIBRARY_DIRS})
+
+set(QAT_VERSION ${PC_QAT_VERSION})
+set(QAT_LIBRARIES ${QAT_LIBRARY} ${QAT_USDM_LIBRARY})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(QAT
+ REQUIRED_VARS QAT_LIBRARY QAT_USDM_LIBRARY QAT_INCLUDE_DIR
+ VERSION_VAR QAT_VERSION)
+
+mark_as_advanced(QAT_LIBRARY QAT_USDM_LIBRARY QAT_LIBRARIES QAT_INCLUDE_DIR QAT_VERSION)
+
+if(QAT_FOUND AND NOT (TARGET QAT::qat))
+ add_library(QAT::qat UNKNOWN IMPORTED)
+ set_target_properties(QAT::qat PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${QAT_INCLUDE_DIR}"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_LOCATION "${QAT_LIBRARY}")
+endif()
+
+if(QAT_FOUND AND NOT (TARGET QAT::usdm))
+ add_library(QAT::usdm UNKNOWN IMPORTED)
+ set_target_properties(QAT::usdm PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${QAT_INCLUDE_DIR}"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_LOCATION "${QAT_USDM_LIBRARY}")
+endif()
diff --git a/cmake/modules/FindQatDrv.cmake b/cmake/modules/FindQatDrv.cmake
index 3305a38c06c..e2849d9c89b 100644
--- a/cmake/modules/FindQatDrv.cmake
+++ b/cmake/modules/FindQatDrv.cmake
@@ -74,7 +74,15 @@ foreach(component ${QatDrv_FIND_COMPONENTS})
add_library(QatDrv::${component} STATIC IMPORTED GLOBAL)
set_target_properties(QatDrv::${component} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${QatDrv_INCLUDE_DIRS}"
+ INTERFACE_COMPILE_OPTIONS "-DHAVE_QATDRV"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${QatDrv_${component}_LIBRARIES}")
endif()
+
+ # add alias targets to match FindQAT.cmake
+ if(component STREQUAL "qat_s")
+ add_library(QAT::qat ALIAS QatDrv::qat_s)
+ elseif(component STREQUAL "usdm_drv_s")
+ add_library(QAT::usdm ALIAS QatDrv::usdm_drv_s)
+ endif()
endforeach()