Currently CMakeLists.txt searches only for libftdi but on platforms where libftdi may be parallel installed this is insufficient. Fix the package detection and ensure we apply the detection results to the default build arguments.
Also removes the check for libusb; 96boardsctl.c does not directly use this library so we can rely on pkg-config to get the link line right.
Signed-off-by: Daniel Thompson daniel.thompson@linaro.org --- 96boardsctl/CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/96boardsctl/CMakeLists.txt b/96boardsctl/CMakeLists.txt index a55852894f95..2e74c4e63de2 100644 --- a/96boardsctl/CMakeLists.txt +++ b/96boardsctl/CMakeLists.txt @@ -8,10 +8,18 @@ configure_file ("${PROJECT_SOURCE_DIR}/config.h.in" "${PROJECT_BINARY_DIR}/confi include_directories ("${PROJECT_BINARY_DIR}")
find_package(PkgConfig) -pkg_check_modules(PC_LIBS REQUIRED libusb libftdi) + +pkg_check_modules(LIBFTDI libftdi1) +if (NOT LIBFTDI_FOUND) + pkg_check_modules(LIBFTDI REQUIRED libftdi) +endif() + +include_directories(${LIBFTDI_INCLUDE_DIRS}) +link_directories(${LIBFTDI_LIBRARY_DIRS}) +add_definitions(${LIBFTDI_CFLAGS_OTHER})
add_executable(96boardsctl 96boardsctl.c) -target_link_libraries(96boardsctl usb ftdi) +target_link_libraries(96boardsctl ${LIBFTDI_LIBRARIES})
install (TARGETS 96boardsctl DESTINATION bin) install (FILES udev-rules/71-ftdi_sio.rules DESTINATION etc/udev/rules.d)