From 6ee0df629e43dc783f9bc4058f676fa46bbfb5d9 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 9 May 2009 17:08:45 +0200 Subject: Add cmake library checks --- libmpio/CMakeLists.txt | 8 ++++++++ libmpio/src/CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'libmpio') diff --git a/libmpio/CMakeLists.txt b/libmpio/CMakeLists.txt index fb590ef..4ceb7fd 100644 --- a/libmpio/CMakeLists.txt +++ b/libmpio/CMakeLists.txt @@ -3,4 +3,12 @@ cmake_minimum_required (VERSION 2.4) set (PACKAGE libmpio) project (${PACKAGE} C) +find_library (LIBUSB NAMES usb) + +if (LIBUSB) + message (STATUS "found libusb at ${LIBUSB}") +else (LIBUSB) + message (FATAL_ERROR "libusb is required") +endif (LIBUSB) + add_subdirectory (src) diff --git a/libmpio/src/CMakeLists.txt b/libmpio/src/CMakeLists.txt index 0422cb7..e16f34e 100644 --- a/libmpio/src/CMakeLists.txt +++ b/libmpio/src/CMakeLists.txt @@ -5,5 +5,5 @@ include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../) add_library (mpio STATIC mpio.c io.c debug.c smartmedia.c mmc.c directory.c fat.c ecc.c cis.c) -target_link_libraries (mpio -lusb) +target_link_libraries (mpio ${LIBUSB}) -- cgit v1.2.3