--- /dev/null
+From c215d5ecd985b57700e817920d0e99112b4a571b Mon Sep 17 00:00:00 2001
+From: Samuel Martin <s.martin49@gmail.com>
+Date: Sun, 25 Jan 2015 13:35:24 +0100
+Subject: [PATCH] cmake: do not check for g++ when FTDIPP is disabled
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+---
+ CMakeLists.txt | 6 ++++--
+ ftdipp/CMakeLists.txt | 1 +
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0ba0b08..e880211 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,5 +1,5 @@
+ # Project
+-project(libftdi1)
++project(libftdi1 C)
+ set(MAJOR_VERSION 1)
+ set(MINOR_VERSION 2)
+ set(PACKAGE libftdi1)
+@@ -145,7 +145,9 @@ else(DOCUMENTATION AND DOXYGEN_FOUND)
+ endif(DOCUMENTATION AND DOXYGEN_FOUND)
+
+ add_subdirectory(src)
+-add_subdirectory(ftdipp)
++if(FTDIPP)
++ add_subdirectory(ftdipp)
++endif()
+ add_subdirectory(python)
+ add_subdirectory(ftdi_eeprom)
+ add_subdirectory(examples)
+diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt
+index 27e7884..2d080f4 100644
+--- a/ftdipp/CMakeLists.txt
++++ b/ftdipp/CMakeLists.txt
+@@ -1,4 +1,5 @@
+ # Check
++project(libftdipp1 C CXX)
+ set(FTDI_BUILD_CPP False PARENT_SCOPE)
+
+ option ( FTDIPP "Build C++ binding library libftdi1++" ON )
+--
+2.2.2
+
+++ /dev/null
-From 81275d75ae88fe8ab1915d3ba260ea935e63c362 Mon Sep 17 00:00:00 2001
-From: Samuel Martin <s.martin49@gmail.com>
-Date: Sun, 25 Jan 2015 10:01:17 +0100
-Subject: [PATCH 2/2] cmake: fix FindUSB1.cmake
-
-Make sure all ldflags are correctly set, especially for static build.
-
-Signed-off-by: Samuel Martin <s.martin49@gmail.com>
----
- cmake/FindUSB1.cmake | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/cmake/FindUSB1.cmake b/cmake/FindUSB1.cmake
-index b90e297..e7f1b3c 100644
---- a/cmake/FindUSB1.cmake
-+++ b/cmake/FindUSB1.cmake
-@@ -26,8 +26,12 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
- PATH_SUFFIXES libusb-1.0
- PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
-
-- FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0
-- PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
-+ set(LIBUSB_LIBRARIES ${PC_LIBUSB_STATIC_LDFLAGS} ${PC_LIBUSB_STATIC_LDFLAGS_OTHER})
-+ foreach(libname ${PC_LIBUSB_STATIC_LIBRARIES})
-+ FIND_LIBRARY(lib NAMES ${libname}
-+ PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
-+ list(APPEND LIBUSB_LIBRARIES ${lib})
-+ endforeach()
-
- include(FindPackageHandleStandardArgs)
- FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
---
-2.2.2
-
+++ /dev/null
-From c215d5ecd985b57700e817920d0e99112b4a571b Mon Sep 17 00:00:00 2001
-From: Samuel Martin <s.martin49@gmail.com>
-Date: Sun, 25 Jan 2015 13:35:24 +0100
-Subject: [PATCH] cmake: do not check for g++ when FTDIPP is disabled
-
-Signed-off-by: Samuel Martin <s.martin49@gmail.com>
----
- CMakeLists.txt | 6 ++++--
- ftdipp/CMakeLists.txt | 1 +
- 2 files changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 0ba0b08..e880211 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -1,5 +1,5 @@
- # Project
--project(libftdi1)
-+project(libftdi1 C)
- set(MAJOR_VERSION 1)
- set(MINOR_VERSION 2)
- set(PACKAGE libftdi1)
-@@ -145,7 +145,9 @@ else(DOCUMENTATION AND DOXYGEN_FOUND)
- endif(DOCUMENTATION AND DOXYGEN_FOUND)
-
- add_subdirectory(src)
--add_subdirectory(ftdipp)
-+if(FTDIPP)
-+ add_subdirectory(ftdipp)
-+endif()
- add_subdirectory(python)
- add_subdirectory(ftdi_eeprom)
- add_subdirectory(examples)
-diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt
-index 27e7884..2d080f4 100644
---- a/ftdipp/CMakeLists.txt
-+++ b/ftdipp/CMakeLists.txt
-@@ -1,4 +1,5 @@
- # Check
-+project(libftdipp1 C CXX)
- set(FTDI_BUILD_CPP False PARENT_SCOPE)
-
- option ( FTDIPP "Build C++ binding library libftdi1++" ON )
---
-2.2.2
-
--- /dev/null
+From fcda9c6a208d3a7fe651ef661b2eb6e462a89c17 Mon Sep 17 00:00:00 2001
+From: Eneas U de Queiroz <cote2004-github@yahoo.com>
+Date: Tue, 31 Jul 2018 17:44:57 -0300
+Subject: [PATCH] CMake: use find_package (SWIG) for cmake >= 3.0.0
+
+There's a workaround for a bug (fixed in cmake 3.0.0) that does not
+work in CMake 3.12. Only use the workaround with cmake < 3.0.0.
+
+Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
+[Mark: patch retrieved and updated from
+http://developer.intra2net.com/git/?p=libftdi;a=commit;h=fcda9c6a208d3a7fe651ef661b2eb6e462a89c17]
+Signed-off-by: Mark Corbin <mark.corbin@embecosm.com>
+[Update patch to make it work with cmake < 3.7:
+http://developer.intra2net.com/mailarchive/html/libftdi/2019/msg00009.html]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
+index 31ef1c6..eefc344 100644
+--- a/python/CMakeLists.txt
++++ b/python/CMakeLists.txt
+@@ -3,7 +3,7 @@ option ( LINK_PYTHON_LIBRARY "Link against python libraries" ON )
+
+ if ( PYTHON_BINDINGS )
+ # workaround for cmake bug #0013449
+- if ( NOT DEFINED CMAKE_FIND_ROOT_PATH )
++ if ( NOT DEFINED CMAKE_FIND_ROOT_PATH OR NOT CMAKE_VERSION VERSION_LESS 3.0.0 )
+ find_package ( SWIG )
+ else ()
+ find_program ( SWIG_EXECUTABLE NAMES swig2.0 swig )
+++ /dev/null
-From fcda9c6a208d3a7fe651ef661b2eb6e462a89c17 Mon Sep 17 00:00:00 2001
-From: Eneas U de Queiroz <cote2004-github@yahoo.com>
-Date: Tue, 31 Jul 2018 17:44:57 -0300
-Subject: [PATCH] CMake: use find_package (SWIG) for cmake >= 3.0.0
-
-There's a workaround for a bug (fixed in cmake 3.0.0) that does not
-work in CMake 3.12. Only use the workaround with cmake < 3.0.0.
-
-Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
-[Mark: patch retrieved and updated from
-http://developer.intra2net.com/git/?p=libftdi;a=commit;h=fcda9c6a208d3a7fe651ef661b2eb6e462a89c17]
-Signed-off-by: Mark Corbin <mark.corbin@embecosm.com>
-[Update patch to make it work with cmake < 3.7:
-http://developer.intra2net.com/mailarchive/html/libftdi/2019/msg00009.html]
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
----
-diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
-index 31ef1c6..eefc344 100644
---- a/python/CMakeLists.txt
-+++ b/python/CMakeLists.txt
-@@ -3,7 +3,7 @@ option ( LINK_PYTHON_LIBRARY "Link against python libraries" ON )
-
- if ( PYTHON_BINDINGS )
- # workaround for cmake bug #0013449
-- if ( NOT DEFINED CMAKE_FIND_ROOT_PATH )
-+ if ( NOT DEFINED CMAKE_FIND_ROOT_PATH OR NOT CMAKE_VERSION VERSION_LESS 3.0.0 )
- find_package ( SWIG )
- else ()
- find_program ( SWIG_EXECUTABLE NAMES swig2.0 swig )