CMake/Utilities/Doxygen/CMakeLists.txt

97 lines
2.9 KiB
CMake
Raw Normal View History

Simplify CMake per-source license notices Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
2016-09-27 22:01:08 +03:00
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
if(NOT CMake_SOURCE_DIR)
set(CMakeDeveloperReference_STANDALONE 1)
cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR)
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)
include(${CMake_SOURCE_DIR}/Source/CMakeVersionCompute.cmake)
include(${CMake_SOURCE_DIR}/Source/CMakeInstallDestinations.cmake)
unset(CMAKE_DATA_DIR)
unset(CMAKE_DATA_DIR CACHE)
macro(CMake_OPTIONAL_COMPONENT)
set(COMPONENT "")
endmacro()
endif()
project(CMakeDeveloperReference NONE)
2001-11-03 00:05:37 +03:00
#
# Build the reference
2001-11-03 00:05:37 +03:00
#
if (CMake_BUILD_DEVELOPER_REFERENCE OR CMakeDeveloperReference_STANDALONE)
find_package(Doxygen REQUIRED)
#
## Output formats
#
option(CMake_BUILD_DEVELOPER_REFERENCE_HTML "Build CMake Developer Reference - HTML format" ON)
mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
if(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
set(GENERATE_HTML YES)
else()
set(GENERATE_HTML NO)
endif()
option(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP "Build CMake Developer Reference - QtHelp format" OFF)
mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP)
if(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP)
set(GENERATE_QHP YES)
find_program(QHELPGENERATOR_EXECUTABLE
NAMES qhelpgenerator
DOC "qhelpgenerator tool"
)
if(NOT QHELPGENERATOR_EXECUTABLE)
message(FATAL_ERROR "QHELPGENERATOR_EXECUTABLE (qhelpgenerator) not found!")
endif()
else()
set(GENERATE_QHP NO)
endif()
2001-11-03 00:05:37 +03:00
#
# Configure the script and the doxyfile, then add target
#
if(DOXYGEN_DOT_FOUND)
set(HAVE_DOT YES)
else()
set(HAVE_DOT NO)
endif()
if(NOT DOT_PATH)
get_filename_component(DOT_PATH ${DOXYGEN_DOT_EXECUTABLE} PATH)
endif()
configure_file(doxyfile.in doxyfile @ONLY)
add_custom_target(cmake-developer-reference-all
${DOXYGEN_EXECUTABLE} doxyfile
WORKING_DIRECTORY ${CMakeDeveloperReference_BINARY_DIR})
add_custom_target(cmake-developer-reference ALL DEPENDS cmake-developer-reference-all)
2001-11-03 00:05:37 +03:00
#
# Installation
#
2001-11-03 00:05:37 +03:00
if(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
CMake_OPTIONAL_COMPONENT(cmake-developer-reference-html)
install(DIRECTORY "${CMakeDeveloperReference_BINARY_DIR}/developer-reference/html"
DESTINATION ${CMAKE_DOC_DIR}/developer-reference
${COMPONENT})
endif()
if(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP)
CMake_OPTIONAL_COMPONENT(cmake-developer-reference-qthelp)
install(FILES "${CMakeDeveloperReference_BINARY_DIR}/developer-reference/CMakeDeveloperReference-${CMake_VERSION_MAJOR}${CMake_VERSION_MINOR}${CMake_VERSION_PATCH}.qch"
DESTINATION ${CMAKE_DOC_DIR}/developer-reference
${COMPONENT})
endif()
2001-11-03 00:05:37 +03:00
endif ()