Private
Public Access
2
0

imraa: update udev cmake configuration

Signed-off-by: Longwei Su <lsu@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Longwei Su
2016-03-17 15:21:02 -04:00
committed by Brendan Le Foll
parent 0fb2aed7af
commit f1f578363a
2 changed files with 24 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
# UDEV_FOUND - true if library and headers were found
# UDEV_INCLUDE_DIRS - include directories
# UDEV_LIBRARIES - library directories
find_package (PkgConfig)
pkg_check_modules (PC_UDEV QUIET udev)
find_path (UDEV_INCLUDE_DIR libudev.h HINTS ${PC_UDEV_INCLUDEDIR}
${PC_UDEV_INCLUDE_DIRS} PATH_SUFFIXES udev)
find_library (UDEV_LIBRARY NAMES udev libudev HINTS ${PC_UDEV_LIBDIR}
${PC_UDEV_LIBRARY_DIRS})
set (UDEV_LIBRARIES ${UDEV_LIBRARY})
set (UDEV_INCLUDE_DIRS ${UDEV_INCLUDE_DIR})
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (UDEV DEFAULT_MSG UDEV_LIBRARY UDEV_INCLUDE_DIR)
mark_as_advanced (UDEV_INCLUDE_DIR UDEV_LIBRARY)

View File

@@ -8,7 +8,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DIMRAA=1")
find_package (JSON-C REQUIRED)
include_directories (${JSON-C_INCLUDE_DIR})
target_link_libraries (imraa mraa ${JSON-C_LIBRARIES} udev)
find_package (UDEV REQUIRED)
include_directories (${UDEV_INCLUDE_DIR})
target_link_libraries (imraa mraa ${JSON-C_LIBRARIES} ${UDEV_LIBRARIES})
set_property (TARGET imraa PROPERTY C_STANDARD 99)