# Project
project(libftdi)
set(MAJOR_VERSION 0)
-set(MINOR_VERSION 17)
+set(MINOR_VERSION 99)
set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION})
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
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)
add_definitions(-DDEBUG)
endif(${CMAKE_BUILD_TYPE} STREQUAL Debug)
-FIND_PACKAGE(USB REQUIRED)
+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")
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(UNIX AND NOT CMAKE_CROSSCOMPILING AND NOT EXISTS "/etc/debian_version")
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT LIB_SUFFIX)
+ set(LIB_SUFFIX "64")
+ endif()
+endif()
+
+if(NOT APPLE)
+ # Create suffix to eventually install in lib64
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ SET(PACK_ARCH "")
+ else(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ SET(PACK_ARCH .x86_64)
+ endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+else(NOT APPLE)
+ SET(PACK_ARCH "")
+endif(NOT APPLE)
# Package information
set(CPACK_PACKAGE_VERSION ${VERSION_STRING})
-set(CPACK_PACKAGE_CONTACT "Marek Vavrusa <marek@vavrusa.com>")
+set(CPACK_PACKAGE_CONTACT "Intra2net AG <libftdi@developer.intra2net.com>")
set(CPACK_PACKAGE_DESCRIPTION "libftdi library.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${CPACK_PACKAGE_DESCRIPTION}
)
add_subdirectory(src)
add_subdirectory(ftdipp)
add_subdirectory(bindings)
+add_subdirectory(ftdi_eeprom)
add_subdirectory(examples)
add_subdirectory(packages)
+add_subdirectory(test)
+# "make dist" target
+set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${VERSION_STRING})
+add_custom_target(dist
+ COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD
+ | bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
# Documentation
+
+option(DOCUMENTATION "Generate API documentation with Doxygen" ON)
+
find_package(Doxygen)
-if(DOXYGEN_FOUND)
+if(DOCUMENTATION AND DOXYGEN_FOUND)
# Set variables
set(PACKAGE libftdi)
# Create doc directory
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/doc
- COMMAND rm -rf ${CMAKE_BINARY_DIR}/doc
- COMMAND mkdir ${CMAKE_BINARY_DIR}/doc
+ COMMAND rm -rf ${CMAKE_BINARY_DIR}/doc/{html,man}
+ COMMAND mkdir -p ${CMAKE_BINARY_DIR}/doc
DEPENDS ftdi ftdipp
)
add_custom_target(docs ALL DEPENDS ${CMAKE_BINARY_DIR}/doc/html/index.html)
-endif(DOXYGEN_FOUND)
+ message(STATUS "Generating API documentation with Doxygen")
+else(DOCUMENTATION AND DOXYGEN_FOUND)
+ message(STATUS "Not generating API documentation")
+endif(DOCUMENTATION AND DOXYGEN_FOUND)
# PkgConfig
set(prefix ${CMAKE_INSTALL_PREFIX})