This file is part of MXE. See LICENSE.md for licensing information.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5aecafc..d843462 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -240,6 +240,7 @@ include(CPack)
 
 message (STATUS "Summary of build options:
 
+  Build shared libs: ${SHAREDLIBS}
   Build static libs: ${STATICLIBS}
   Build C++ bindings: ${FTDIPP}
   Build Python bindings: ${PYTHON_BINDINGS}
diff --git a/CMakeOptions.txt b/CMakeOptions.txt
index 07b5887..dde8b0d 100644
--- a/CMakeOptions.txt
+++ b/CMakeOptions.txt
@@ -1,3 +1,4 @@
+option ( SHAREDLIBS "Build shared libraries" ON )
 option ( STATICLIBS "Build static libraries" ON )
 option ( BUILD_TESTS "Build unit tests with Boost Unit Test framework" OFF )
 option ( DOCUMENTATION "Generate API documentation with Doxygen" OFF )
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 17b3617..73f5d3f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,22 +21,23 @@ configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h
 set(c_sources     ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" )
 set(c_headers     ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c headers" )
 
-add_library(ftdi1 SHARED ${c_sources})
+if ( SHAREDLIBS )
+  add_library(ftdi1 SHARED ${c_sources})
 
-math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1")    # Compatibility with previous releases
-set_target_properties(ftdi1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2)
-# Prevent clobbering each other during the build
-set_target_properties ( ftdi1 PROPERTIES CLEAN_DIRECT_OUTPUT 1 )
+  math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1")    # Compatibility with previous releases
+  set_target_properties(ftdi1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2)
+  # Prevent clobbering each other during the build
+  set_target_properties ( ftdi1 PROPERTIES CLEAN_DIRECT_OUTPUT 1 )
 
+  # Dependencies
+  target_link_libraries(ftdi1 ${LIBUSB_LIBRARIES})
 
-# Dependencies
-target_link_libraries(ftdi1 ${LIBUSB_LIBRARIES})
-
-install ( TARGETS ftdi1
-          RUNTIME DESTINATION bin
-          LIBRARY DESTINATION lib${LIB_SUFFIX}
-          ARCHIVE DESTINATION lib${LIB_SUFFIX}
-        )
+  install ( TARGETS ftdi1
+            RUNTIME DESTINATION bin
+            LIBRARY DESTINATION lib${LIB_SUFFIX}
+            ARCHIVE DESTINATION lib${LIB_SUFFIX}
+          )
+endif ()
 
 if ( STATICLIBS )
   add_library(ftdi1-static STATIC ${c_sources})
