find_package(Doxygen)
if(DOCUMENTATION AND DOXYGEN_FOUND)
- # Set variables
- set(top_srcdir ${CMAKE_SOURCE_DIR})
-
# Find doxy config
message(STATUS "Doxygen found.")
- set(DOXY_DIR "${CMAKE_SOURCE_DIR}/doc")
- set(DOXY_CONFIG "${DOXY_DIR}/Doxyfile.in")
# Copy doxy.config.in
- configure_file("${DOXY_CONFIG}" "${CMAKE_BINARY_DIR}/doxy.config")
-
- # Create doc directory
- add_custom_command(
- OUTPUT ${CMAKE_BINARY_DIR}/doc
- COMMAND rm -rf ${CMAKE_BINARY_DIR}/doc/{html,man}
- COMMAND mkdir -p ${CMAKE_BINARY_DIR}/doc
- DEPENDS ftdi1 ftdipp1
- )
+ set(top_srcdir ${CMAKE_SOURCE_DIR})
+ configure_file(${CMAKE_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile )
# Run doxygen
add_custom_command(
- OUTPUT ${CMAKE_BINARY_DIR}/doc/html/index.html
- COMMAND ${DOXYGEN_EXECUTABLE} "${CMAKE_BINARY_DIR}/doxy.config"
- DEPENDS "${CMAKE_BINARY_DIR}/doxy.config" "${CMAKE_BINARY_DIR}/doc"
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/doc
+ 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)
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
-OUTPUT_DIRECTORY =
+OUTPUT_DIRECTORY = doc
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
option(FTDIPP "Build C++ binding library libftdi1++" ON)
+# Targets
+set(cpp_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.cpp CACHE INTERNAL "List of cpp sources" )
+set(cpp_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.hpp CACHE INTERNAL "List of cpp headers" )
+
if (FTDIPP)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
- # Targets
- set(cpp_sources ftdi.cpp)
- set(cpp_headers ftdi.hpp)
+
set(FTDI_BUILD_CPP True PARENT_SCOPE)
message(STATUS "Building libftdi1++")
configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h" @ONLY)
# Targets
-set(c_sources ftdi.c ftdi_stream.c)
-set(c_headers ftdi.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})