[CMake] Unable to add doxygen to build package for NSIS
Torri, Stephen CIV NSWCDD, W15
stephen.torri at navy.mil
Fri Jun 11 14:30:58 EDT 2010
I am trying to add doxygen output to my installation package made via NSIS. I want to allow the user to install the C++ API documentation. I would like the install page of the NSIS wizard to look like:
Development
|---- C++ Headers
|---- Documentation
Runtime
|---- Libraries
Right now I don't see the "Documentation" option. So I will lay out my setup below. What am I doing wrong that I don't see "Documentation" on the "Choose Component" page?
Stephen
----------------------------------------------------------------------------------------------------------------------------------------
Parent CMakeLists.txt
----------------------------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------
# CPACK
#-----------------------------------------------------
#-----------------------------
# CPACK DESCRIPTION INFORMATION
#-----------------------------
SET(CPACK_PACKAGE_NAME "Project")
SET(CPACK_PACKAGE_VENDOR "Work")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Project text")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
SET(CPACK_PACKAGE_VERSION "0.2.0")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "2")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Project ${CPACK_PACKAGE_VERSION}")
#-----------------------------------------------------
# DOCUMENTATION
#-----------------------------------------------------
find_package ( Doxygen )
IF(DOXYGEN)
ADD_SUBDIRECTORY(documentation)
ELSE(DOXYGEN)
MESSAGE(STATUS "WARNING: Doxygen not found - API documentation not created")
ENDIF(DOXYGEN)
#-----------------------------
# INSTALLATION INFORMATION
#-----------------------------
SET(CPACK_COMPONENTS_ALL libraries devel)
SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
SET(CPACK_COMPONENT_LIBRARIES_DESCRIPTION "Dynamic library used to build programs with Interface")
SET(CPACK_COMPONENT_DEVEL_DISPLAY_NAME "C++ Headers")
SET(CPACK_COMPONENT_DEVEL_DESCRIPTION "C++ header files for use with Interface")
SET(CPACK_COMPONENT_DEVEL_DEPENDS libraries)
SET(CPACK_COMPONENT_DOCS_DISPLAY_NAME "C++ API Documentation")
SET(CPACK_COMPONENT_DOCS_DESCRIPTION "C++ API HTML files describing the API for Interface")
SET(CPACK_COMPONENT_LIBRARIES_GROUP "Runtime")
SET(CPACK_COMPONENT_DEVEL_GROUP "Development")
SET(CPACK_COMPONENT_DOCS_GROUP "Development")
SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION "All of the tools necessary to develop against the Interface")
#-----------------------------
# INSTALLATION TYPES
#-----------------------------
SET(CPACK_ALL_INSTALL_TYPES Full Runtime Developer)
SET(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES Full Developer Runtime)
SET(CPACK_COMPONENT_DEVEL_INSTALL_TYPES Full Developer)
SET(CPACK_COMPONENT_DOCS_INSTALL_TYPES Full Developer)
IF (WIN32)
SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\InstallIcon.bmp")
SET(CPACK_NSIS_MODIFY_PATH ON)
SET(CPACK_GENERATOR "NSIS")
ELSE (UNIX)
SET(CPACK_GENERATOR "STGZ;TGZ;RPM")
ENDIF(WIN32)
# Always include this last.
INCLUDE(CPack)
----------------------------------------------------------------------------------------------------------------------------------------
Documentation CMakeLists.txt
----------------------------------------------------------------------------------------------------------------------------------------
# prepare doxygen configuration file
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
# add doxygen as target
add_custom_target(doxygen ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
# cleanup $build/api-doc on "make clean"
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES api-doc)
# add doxygen as dependency to doc-target
get_target_property(DOC_TARGET doc TYPE)
if(NOT DOC_TARGET)
add_custom_target(doc)
endif()
add_dependencies(doc doxygen)
# install HTML API documentation and manual pages
set(DOC_PATH "share/doc/${CPACK_PACKAGE_NAME}-${VERSION}")
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/api-doc/html
DESTINATION ${DOC_PATH}
COMPONENT docs )
IF(UNIX)
# install man pages into packages, scope is now project root..
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/api-doc/man/man3
DESTINATION share/man/man3/
)
ENDIF(UNIX
More information about the CMake
mailing list