2019-05-16 16:17:59 +02:00
|
|
|
# Generate documentation
|
|
|
|
|
|
|
|
option(BUILD_DEVELOPER_DOCS "Include developer documentation" OFF)
|
2019-05-21 12:04:26 +02:00
|
|
|
add_feature_info("Include developer documentation" BUILD_DEVELOPER_DOCS "")
|
2019-05-16 16:17:59 +02:00
|
|
|
|
2020-02-20 16:46:55 +01:00
|
|
|
function(_find_all_includes _ret_includes _ret_framework_paths)
|
|
|
|
set(_all_includes "${PROJECT_SOURCE_DIR}/src/plugins;${PROJECT_SOURCE_DIR}/src/libs")
|
|
|
|
foreach(_target ${__QTC_PLUGINS} ${__QTC_LIBRARIES})
|
|
|
|
if (NOT TARGET ${_target})
|
|
|
|
continue()
|
|
|
|
endif()
|
|
|
|
get_target_property(_includes ${_target} INCLUDE_DIRECTORIES)
|
|
|
|
foreach(_include ${_includes})
|
|
|
|
string(FIND "${_include}" "/src/plugins/" _in_plugins)
|
|
|
|
string(FIND "${_include}" "/src/libs/" _in_libs)
|
|
|
|
string(FIND "${_include}" "${CMAKE_BINARY_DIR}" _in_build)
|
|
|
|
if(_in_plugins LESS 0 AND _in_libs LESS 0 AND _in_build LESS 0)
|
|
|
|
list(APPEND _all_includes ${_include})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endforeach()
|
|
|
|
list(APPEND _all_includes ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
|
|
|
|
list(REMOVE_DUPLICATES _all_includes)
|
|
|
|
set("${_ret_includes}" "${_all_includes}" PARENT_SCOPE)
|
|
|
|
|
|
|
|
# framework path
|
|
|
|
if (APPLE)
|
2024-07-04 09:59:26 +02:00
|
|
|
get_target_property(_qt_type Qt::Core TYPE)
|
|
|
|
if ("${_qt_type}" STREQUAL "INTERFACE_LIBRARY")
|
|
|
|
# version-less target Qt::Core is an interface library that links to QtX::Core
|
|
|
|
get_target_property(_qt_core Qt::Core INTERFACE_LINK_LIBRARIES)
|
|
|
|
else()
|
|
|
|
set(_qt_core "Qt::Core")
|
|
|
|
endif()
|
2022-12-20 17:31:22 +01:00
|
|
|
get_target_property(_qt_target ${_qt_core} LOCATION) # <fw_path>/QtCore.framework/QtCore
|
2020-02-20 16:46:55 +01:00
|
|
|
get_filename_component(_qt_loc "${_qt_target}" DIRECTORY)
|
|
|
|
set("${_ret_framework_paths}" "${_qt_loc}/.." PARENT_SCOPE)
|
|
|
|
endif()
|
|
|
|
endfunction()
|
2019-05-16 16:17:59 +02:00
|
|
|
|
2023-09-18 09:24:25 +02:00
|
|
|
function(_add_doc _doc_file _dev_doc_file)
|
2024-01-03 10:01:48 +01:00
|
|
|
set(GENERATED_ATTRIBUTIONS_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated_attributions)
|
|
|
|
add_qtc_documentation(${_doc_file}
|
|
|
|
ENVIRONMENT_EXPORTS GENERATED_ATTRIBUTIONS_DIR
|
|
|
|
)
|
2023-09-18 09:24:25 +02:00
|
|
|
add_qtc_doc_attribution(doc_attributions
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../qt_attributions.json"
|
2024-01-03 10:01:48 +01:00
|
|
|
"${GENERATED_ATTRIBUTIONS_DIR}/creator-attributions.qdoc"
|
2023-09-18 09:24:25 +02:00
|
|
|
${_doc_file}
|
|
|
|
)
|
2024-02-06 09:24:00 +01:00
|
|
|
set(litehtml_attributions "${CMAKE_CURRENT_SOURCE_DIR}/../src/libs/qlitehtml/src/3rdparty/qt_attribution.json")
|
|
|
|
if(EXISTS "${litehtml_attributions}")
|
|
|
|
add_qtc_doc_attribution(doc_attributions_litehtml
|
|
|
|
"${litehtml_attributions}"
|
|
|
|
"${GENERATED_ATTRIBUTIONS_DIR}/creator-attributions-litehtml.qdoc"
|
|
|
|
${_doc_file}
|
|
|
|
)
|
|
|
|
endif()
|
2020-05-19 09:42:44 +02:00
|
|
|
if (BUILD_DEVELOPER_DOCS)
|
|
|
|
_find_all_includes(_all_includes _framework_paths)
|
2023-09-18 09:24:25 +02:00
|
|
|
add_qtc_documentation(${_dev_doc_file}
|
2020-05-19 09:42:44 +02:00
|
|
|
INCLUDE_DIRECTORIES ${_all_includes}
|
|
|
|
FRAMEWORK_PATHS ${_framework_paths}
|
2020-02-20 16:46:55 +01:00
|
|
|
)
|
|
|
|
endif()
|
2023-09-18 09:24:25 +02:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
if (WITH_DOCS)
|
|
|
|
_add_doc(${IDE_DOC_FILE} "qtcreatordev/qtcreator-dev.qdocconf")
|
2020-05-19 09:42:44 +02:00
|
|
|
endif()
|
|
|
|
if(WITH_ONLINE_DOCS)
|
2023-09-18 09:24:25 +02:00
|
|
|
_add_doc(${IDE_DOC_FILE_ONLINE} "qtcreatordev/qtcreator-dev-online.qdocconf")
|
2019-05-16 16:17:59 +02:00
|
|
|
endif()
|
2020-05-19 09:42:44 +02:00
|
|
|
|
2024-06-18 15:09:15 +02:00
|
|
|
if (BUILD_DOCS_BY_DEFAULT)
|
|
|
|
set(EXCLUDE_DOCS_FROM_ALL "")
|
|
|
|
else()
|
|
|
|
set(EXCLUDE_DOCS_FROM_ALL "EXCLUDE_FROM_ALL")
|
|
|
|
endif()
|
|
|
|
|
2020-05-19 09:42:44 +02:00
|
|
|
install(DIRECTORY config
|
2021-03-23 17:54:06 +01:00
|
|
|
DESTINATION ${IDE_HEADER_INSTALL_PATH}/doc
|
2020-05-19 09:42:44 +02:00
|
|
|
COMPONENT Devel
|
2024-06-18 15:09:15 +02:00
|
|
|
${EXCLUDE_DOCS_FROM_ALL}
|
2020-05-19 09:42:44 +02:00
|
|
|
)
|