[Corrected] libftdi-1: Adapt CMake support file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Corrected] libftdi-1: Adapt CMake support file

Uwe Bonnes

the libftdi-1 branch needs to search for libusb-1. Appended patch adapt the
cmake support file to look for libusb-1.

This revision of the patch really links against libusb-1

Bye
--
Uwe Bonnes                [hidden email]

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
From 6b4a3f58d5cf2ac38e75d90e17f93769c2edacbd Mon Sep 17 00:00:00 2001
From: Uwe Bonnes <[hidden email]>
Date: Tue, 2 Feb 2010 18:52:37 +0100
Subject: We need to find libusb-1, so adapt the CMake support files

---
 CMakeLists.txt |    2 +-
 FindUSB.cmake  |   38 --------------------------------------
 FindUSB1.cmake |   38 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 39 deletions(-)
 delete mode 100644 FindUSB.cmake
 create mode 100644 FindUSB1.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3595198..564dc4d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,7 @@ if(${CMAKE_BUILD_TYPE} STREQUAL Debug)
    add_definitions(-DDEBUG)
 endif(${CMAKE_BUILD_TYPE} STREQUAL Debug)
 
-FIND_PACKAGE(USB REQUIRED)
+FIND_PACKAGE(USB1 REQUIRED)
 INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIR})
 
 # Set components
diff --git a/FindUSB.cmake b/FindUSB.cmake
deleted file mode 100644
index 566cdd8..0000000
--- a/FindUSB.cmake
+++ /dev/null
@@ -1,38 +0,0 @@
-# - Try to find the freetype library
-# Once done this defines
-#
-#  LIBUSB_FOUND - system has libusb
-#  LIBUSB_INCLUDE_DIR - the libusb include directory
-#  LIBUSB_LIBRARIES - Link these to use libusb
-
-# Copyright (c) 2006, 2008  Laurent Montel, <[hidden email]>
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-
-if (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
-
-  # in cache already
-  set(LIBUSB_FOUND TRUE)
-
-else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
-  IF (NOT WIN32)
-    # use pkg-config to get the directories and then use these values
-    # in the FIND_PATH() and FIND_LIBRARY() calls
-    find_package(PkgConfig)
-    pkg_check_modules(PC_LIBUSB libusb)
-  ENDIF(NOT WIN32)
-
-  FIND_PATH(LIBUSB_INCLUDE_DIR usb.h
-    PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
-
-  FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb
-    PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
-
-  include(FindPackageHandleStandardArgs)
-  FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
-
-  MARK_AS_ADVANCED(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
-
-endif (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
diff --git a/FindUSB1.cmake b/FindUSB1.cmake
new file mode 100644
index 0000000..229c825
--- /dev/null
+++ b/FindUSB1.cmake
@@ -0,0 +1,38 @@
+# - Try to find the freetype library
+# Once done this defines
+#
+#  LIBUSB_FOUND - system has libusb
+#  LIBUSB_INCLUDE_DIR - the libusb include directory
+#  LIBUSB_LIBRARIES - Link these to use libusb
+
+# Copyright (c) 2006, 2008  Laurent Montel, <[hidden email]>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+
+  # in cache already
+  set(LIBUSB_FOUND TRUE)
+
+else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+  IF (NOT WIN32)
+    # use pkg-config to get the directories and then use these values
+    # in the FIND_PATH() and FIND_LIBRARY() calls
+    find_package(PkgConfig)
+    pkg_check_modules(PC_LIBUSB libusb-1.0)
+  ENDIF(NOT WIN32)
+
+  FIND_PATH(LIBUSB_INCLUDE_DIR libusb.h
+    PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
+
+  FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0
+    PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
+
+  include(FindPackageHandleStandardArgs)
+  FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
+
+  MARK_AS_ADVANCED(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
+
+endif (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
--
1.6.4.2


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]  

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Corrected] libftdi-1: Adapt CMake support file

Jie Zhang-2
On Wed, Feb 3, 2010 at 1:54 AM, Uwe Bonnes
<[hidden email]> wrote:
>
> the libftdi-1 branch needs to search for libusb-1. Appended patch adapt the
> cmake support file to look for libusb-1.
>
> This revision of the patch really links against libusb-1
>
Sorry for the delay. I finally got some time. Installed. Thanks!


Jie

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]  

Loading...