X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=CMakeLists.txt;h=dbf60525a4f964f7312004fd04e8365cb91e2204;hp=b6aaac34b759e127572e127bce67e1b4e5f9a7c5;hb=3ab8f642787d972f9ceb8ed4a385c09aeb39848d;hpb=e5cf3c2858e0b7a3e1570efee01f99968a1a48d1 diff --git a/CMakeLists.txt b/CMakeLists.txt index b6aaac3..dbf6052 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,8 @@ project(libftdi) set(MAJOR_VERSION 0) set(MINOR_VERSION 15) -set(PATCH_VERSION 0) -set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}) +set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}) +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") # CMake if("${CMAKE_BUILD_TYPE}" STREQUAL "") @@ -18,6 +18,9 @@ if(${CMAKE_BUILD_TYPE} STREQUAL Debug) add_definitions(-DDEBUG) endif(${CMAKE_BUILD_TYPE} STREQUAL Debug) +FIND_PACKAGE(USB REQUIRED) +INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIR}) + # Set components set(CPACK_COMPONENTS_ALL sharedlibs staticlibs headers) set(CPACK_COMPONENT_SHAREDLIBS_DISPLAY_NAME "Shared libraries") @@ -35,26 +38,6 @@ set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development") set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") set(CPACK_COMPONENT_HEADERS_GROUP "Development") -# Documentation -find_package(Doxygen) -if(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") - add_custom_target(doc "${DOXYGEN_EXECUTABLE}" "doxy.config") - -endif(DOXYGEN_FOUND) - # Package information set(CPACK_PACKAGE_VERSION ${VERSION_STRING}) set(CPACK_PACKAGE_CONTACT "Marek Vavrusa ") @@ -80,7 +63,11 @@ if(${WIN32}) set(CPACK_NSIS_MODIFY_PATH "ON") endif(${WIN32}) -set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING.LIB) +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}) # Subdirectories if(${UNIX}) @@ -92,6 +79,45 @@ add_subdirectory(ftdipp) add_subdirectory(examples) add_subdirectory(packages) + + +# Documentation +find_package(Doxygen) +if(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 + COMMAND mkdir ${CMAKE_BINARY_DIR}/doc + DEPENDS ftdi ftdipp + ) + + # 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 + ) + + add_custom_target(docs ALL DEPENDS ${CMAKE_BINARY_DIR}/doc/html/index.html) + +endif(DOXYGEN_FOUND) + # PkgConfig set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin) @@ -106,5 +132,12 @@ 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 + DESTINATION lib/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) +endif(${UNIX}) include(CPack)