CMakeLists.txt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #*******************************************************************************
  2. # Copyright (c) 2015 logi.cals GmbH
  3. #
  4. # All rights reserved. This program and the accompanying materials
  5. # are made available under the terms of the Eclipse Public License v2.0
  6. # and Eclipse Distribution License v1.0 which accompany this distribution.
  7. #
  8. # The Eclipse Public License is available at
  9. # https://www.eclipse.org/legal/epl-2.0/
  10. # and the Eclipse Distribution License is available at
  11. # http://www.eclipse.org/org/documents/edl-v10.php.
  12. #
  13. # Contributors:
  14. # Rainer Poisel - initial version
  15. #*******************************************************************************/
  16. # Note: on OS X you should install XCode and the associated command-line tools
  17. ### documentation settings
  18. FIND_PACKAGE(Doxygen)
  19. IF(NOT DOXYGEN_FOUND)
  20. message(FATAL_ERROR "Doxygen is needed to build the documentation.")
  21. ENDIF()
  22. SET(DOXYTARGETS)
  23. FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc)
  24. FOREACH(DOXYFILE_SRC DoxyfileV3ClientAPI;DoxyfileV3AsyncAPI;DoxyfileV3ClientInternal)
  25. SET(DOXYFILE_IN ${DOXYFILE_SRC}.in)
  26. SET(DOXYFILE ${CMAKE_CURRENT_BINARY_DIR}/${DOXYFILE_SRC})
  27. CONFIGURE_FILE(${DOXYFILE_IN} ${DOXYFILE} @ONLY)
  28. ADD_CUSTOM_TARGET(${DOXYFILE_SRC}.target
  29. COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE}
  30. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  31. COMMENT "Generating API documentation with Doxygen"
  32. VERBATIM
  33. )
  34. SET(DOXYTARGETS ${DOXYTARGETS} ${DOXYFILE_SRC}.target)
  35. ENDFOREACH(DOXYFILE_SRC)
  36. ADD_CUSTOM_TARGET(doc ALL DEPENDS ${DOXYTARGETS})
  37. IF (PAHO_ENABLE_CPACK)
  38. INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/ DESTINATION ${CMAKE_INSTALL_DOCDIR})
  39. ELSE()
  40. INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION ${CMAKE_INSTALL_DOCDIR})
  41. ENDIF()