From 383f275aa760a85b278816bcb4cc5e6ee9def6fe Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Fri, 21 Apr 2017 20:13:07 -0400 Subject: [PATCH] cmake: Use pkg-config to find libpci Change-Id: I1ab4397d88a2bd48ce0d6f2d3c33efcf47bc442f Signed-off-by: Jan Vesely Signed-off-by: Felix Kuehling --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd8f32e447..e485adfc9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,8 +90,11 @@ add_library ( ${HSAKMT_TARGET} SHARED ${HSAKMT_SRC} ) set_property ( TARGET ${HSAKMT_TARGET} PROPERTY VERSION "${LIB_VERSION_STRING}" ) set_property ( TARGET ${HSAKMT_TARGET} PROPERTY SOVERSION "${BUILD_VERSION_MAJOR}" ) +find_package(PkgConfig) +pkg_check_modules(PC_LIBPCI REQUIRED libpci) +include_directories ( ${PC_LIBPCI_INCLUDEDIR} ) target_link_libraries ( ${HSAKMT_TARGET} - pthread rt pci numa + pthread rt numa ${PC_LIBPCI_LIBRARIES} ) ## If the library is a release, strip the target library