cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
+message(STATUS "CMake version: ${CMAKE_VERSION}")
+
# Project
project(libftdi1 C)
set(MAJOR_VERSION 1)
set(VERSION ${VERSION_STRING})
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
+# Support new if() IN_LIST operator
+if(POLICY CMP0057)
+ cmake_policy(SET CMP0057 NEW)
+endif()
+
+# Included scripts do automatic cmake_policy() PUSH and POP
+if(POLICY CMP0011)
+ cmake_policy(SET CMP0011 NEW)
+endif()
+
+# Target link properties INTERFACE_LINK_OPTIONS, INTERFACE_LINK_DIRECTORIES
+# and INTERFACE_LINK_DEPENDS are now transitive over private dependencies
+# of static libraries
+if(POLICY CMP0099)
+ cmake_policy(SET CMP0099 NEW)
+endif()
+
# CMake
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE RelWithDebInfo)
add_definitions(-DDEBUG)
endif(${CMAKE_BUILD_TYPE} STREQUAL Debug)
-# find libusb
-find_package( PkgConfig )
-if (PkgConfig_FOUND)
- pkg_check_modules( LIBUSB libusb-1.0 )
- if (LIBUSB_FOUND)
- include_directories ( ${LIBUSB_INCLUDE_DIRS} )
- else()
- find_package ( USB1 REQUIRED )
- include_directories ( ${LIBUSB_INCLUDE_DIR} )
- endif()
-endif()
+# Find libusb
+find_package ( LibUSB REQUIRED )
+include_directories ( ${LIBUSB_INCLUDE_DIR} )
# Find Boost
if (FTDIPP OR BUILD_TESTS)
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
if ( DOCUMENTATION )
- find_package ( Doxygen REQUIRED)
-
- # Copy doxy.config.in
- set(top_srcdir ${CMAKE_SOURCE_DIR})
- configure_file(${CMAKE_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile )
- configure_file(${CMAKE_SOURCE_DIR}/doc/Doxyfile.xml.in ${CMAKE_BINARY_DIR}/Doxyfile.xml )
-
- # Run doxygen
- add_custom_command(
- OUTPUT ${CMAKE_BINARY_DIR}/doc/html/index.html
- COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/doc
- COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
- DEPENDS ${c_headers};${c_sources};${cpp_sources};${cpp_headers}
- )
-
- add_custom_target(docs ALL DEPENDS ${CMAKE_BINARY_DIR}/doc/html/index.html)
-endif ()
+ add_subdirectory(doc)
+endif ( DOCUMENTATION )
add_subdirectory(src)
if ( FTDIPP )