# Project
-project(libftdi)
+project(libftdi1)
set(MAJOR_VERSION 1)
set(MINOR_VERSION 0)
+set(PACKAGE libftdi1)
set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION})
+set(VERSION ${VERSION_STRING})
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
# CMake
set(CPACK_COMPONENT_SHAREDLIBS_DESCRIPTION
"Shared library for general use.")
set(CPACK_COMPONENT_STATICLIBS_DESCRIPTION
-"Static library, good if you want to embed libftdi in your application.")
+"Static library, good if you want to embed libftdi1 in your application.")
set(CPACK_COMPONENT_HEADERS_DESCRIPTION
"C/C++ header files.")
# Package information
set(CPACK_PACKAGE_VERSION ${VERSION_STRING})
set(CPACK_PACKAGE_CONTACT "Intra2net AG <libftdi@developer.intra2net.com>")
-set(CPACK_PACKAGE_DESCRIPTION "libftdi library.")
+set(CPACK_PACKAGE_DESCRIPTION "libftdi1 library.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${CPACK_PACKAGE_DESCRIPTION}
)
# Package settings
set(CPACK_CMAKE_GENERATOR "MinGW Makefiles")
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VENDOR "")
- set(CPACK_PACKAGE_INSTALL_DIRECTORY "libftdi")
+ set(CPACK_PACKAGE_INSTALL_DIRECTORY "libftdi1")
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win32")
- set(CPACK_NSIS_DISPLAY_NAME "libftdi")
+ set(CPACK_NSIS_DISPLAY_NAME "libftdi1")
set(CPACK_NSIS_MODIFY_PATH "ON")
endif(${WIN32})
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE)
set(CPACK_SOURCE_GENERATOR TGZ)
-set(CPACK_SOURCE_IGNORE_FILES "\\\\.git")
-set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
+set(CPACK_SOURCE_IGNORE_FILES "\\\\.git;~$;build/")
+set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION})
# Subdirectories
if(${UNIX})
option(DOCUMENTATION "Generate API documentation with Doxygen" ON)
+
find_package(Doxygen)
if(DOCUMENTATION AND DOXYGEN_FOUND)
- # Set variables
- set(PACKAGE libftdi)
- set(VERSION ${VERSION_STRING})
- 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 ftdi ftdipp
- )
+ 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)
set(libdir ${CMAKE_INSTALL_PREFIX}/bin)
endif(${WIN32})
-configure_file(${CMAKE_SOURCE_DIR}/libftdi.pc.in ${CMAKE_BINARY_DIR}/libftdi.pc @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/libftdipp.pc.in ${CMAKE_BINARY_DIR}/libftdipp.pc @ONLY)
-install(FILES ${CMAKE_BINARY_DIR}/libftdi.pc ${CMAKE_BINARY_DIR}/libftdipp.pc
+configure_file(${CMAKE_SOURCE_DIR}/libftdi1.spec.in ${CMAKE_BINARY_DIR}/libftdi1.spec @ONLY)
+configure_file(${CMAKE_SOURCE_DIR}/libftdi1.pc.in ${CMAKE_BINARY_DIR}/libftdi1.pc @ONLY)
+configure_file(${CMAKE_SOURCE_DIR}/libftdipp1.pc.in ${CMAKE_BINARY_DIR}/libftdipp1.pc @ONLY)
+install(FILES ${CMAKE_BINARY_DIR}/libftdi1.pc ${CMAKE_BINARY_DIR}/libftdipp1.pc
DESTINATION lib${LIB_SUFFIX}/pkgconfig)
if(${UNIX})
- configure_file(${CMAKE_SOURCE_DIR}/libftdi-config.in ${CMAKE_BINARY_DIR}/libftdi-config @ONLY)
- install(PROGRAMS ${CMAKE_BINARY_DIR}/libftdi-config DESTINATION bin)
+ configure_file(${CMAKE_SOURCE_DIR}/libftdi1-config.in ${CMAKE_BINARY_DIR}/libftdi1-config @ONLY)
+ install(PROGRAMS ${CMAKE_BINARY_DIR}/libftdi1-config DESTINATION bin)
endif(${UNIX})
include(CPack)