Add ftdi_eeprom target (currently disabled). Get version info from CMakeLists.txt
[libftdi] / CMakeLists.txt
index 3e6c96d..7533abe 100644 (file)
@@ -5,11 +5,6 @@ set(MINOR_VERSION 17)
 set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION})
 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
 
-option(ASYNC-MODE "enable experimental async mode. Linux only")
-if(ASYNC-MODE)
-  add_definitions(-DLIBFTDI_LINUX_ASYNC_MODE)
-endif(ASYNC-MODE)
-
 # CMake
 if("${CMAKE_BUILD_TYPE}" STREQUAL "")
    set(CMAKE_BUILD_TYPE     Debug)
@@ -17,6 +12,8 @@ endif("${CMAKE_BUILD_TYPE}" STREQUAL "")
 set(CMAKE_COLOR_MAKEFILE ON)
 cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
 
+add_definitions(-Wall)
+
 # Debug build
 message("-- Build type: ${CMAKE_BUILD_TYPE}")
 if(${CMAKE_BUILD_TYPE} STREQUAL Debug)
@@ -26,6 +23,9 @@ endif(${CMAKE_BUILD_TYPE} STREQUAL Debug)
 FIND_PACKAGE(USB1 REQUIRED)
 INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIR})
 
+# Find Boost (optional package)
+find_package(Boost)
+
 # Set components
 set(CPACK_COMPONENTS_ALL sharedlibs staticlibs headers)
 set(CPACK_COMPONENT_SHAREDLIBS_DISPLAY_NAME "Shared libraries")
@@ -43,14 +43,19 @@ set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development")
 set(CPACK_COMPONENT_STATICLIBS_GROUP "Development")
 set(CPACK_COMPONENT_HEADERS_GROUP    "Development")
 
-# Create suffix to eventually install in lib64
-IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
-    SET(LIB_SUFFIX "")
-    SET(PACK_ARCH "")
-  ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
-    SET(LIB_SUFFIX 64)
-    SET(PACK_ARCH .x86_64)
-endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+if(NOT APPLE)
+  # Create suffix to eventually install in lib64
+  if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+      SET(LIB_SUFFIX "")
+      SET(PACK_ARCH "")
+    else(CMAKE_SIZEOF_VOID_P EQUAL 8)
+      SET(LIB_SUFFIX 64)
+      SET(PACK_ARCH .x86_64)
+  endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+else(NOT APPLE)
+  SET(LIB_SUFFIX "")
+  SET(PACK_ARCH "")
+endif(NOT APPLE)
 
 # Package information
 set(CPACK_PACKAGE_VERSION              ${VERSION_STRING})
@@ -91,6 +96,7 @@ endif(${UNIX})
 add_subdirectory(src)
 add_subdirectory(ftdipp)
 add_subdirectory(bindings)
+add_subdirectory(ftdi_eeprom)
 add_subdirectory(examples)
 add_subdirectory(packages)