Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Make QDOC_INDEX_DIR optional #875

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if(NOT DEFINED QDOC_TEMPLATE_DIR)
endif()

if(NOT DEFINED QDOC_INDEX_DIR)
# compute the qdoc index dir from where qtcore.index is found
# try to compute the qdoc index dir from where qtcore.index is found
find_file(QDOC_INDEX qtcore.index HINTS ${QT_INSTALL_DOCS}/qtcore ${QT_INSTALL_DATA}/doc/qtcore)
if(QDOC_INDEX)
get_filename_component(QDOC_INDEX_DIR ${QDOC_INDEX} DIRECTORY)
Expand All @@ -57,7 +57,6 @@ endif()
if(NOT QDOC_EXECUTABLE
OR NOT QHELPGEN_EXECUTABLE
OR NOT QDOC_TEMPLATE_DIR
OR NOT QDOC_INDEX_DIR
OR NOT QTATTRIBUTIONSSCANNER_EXECUTABLE
)
# Expand imported target data for status reporting
Expand All @@ -82,6 +81,9 @@ if(NOT QDOC_EXECUTABLE
set(GAMMARAY_USER_MANUAL_BUILD False)
else()
set(GAMMARAY_USER_MANUAL_BUILD True)
if(NOT QDOC_INDEX_DIR)
message(STATUS "Couldn't find index dir, manual won't link to system documentation")
endif()
endif()

add_feature_info(
Expand Down
21 changes: 12 additions & 9 deletions docs/manual/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ macro(qt_build_doc _qdocconf_name)
COMMENT "Generate codecontrbutions.qdoc using qtattributescanner"
)

# Point to the qt documentation index files, if discovered
set(_qdoc_index_args)
if(QDOC_INDEX_DIR)
set(_qdoc_index_args --indexdir ${QDOC_INDEX_DIR})
endif()

# offline docs
# run qdoc to get qhp file
set(_qdoc_output_dir ${CMAKE_CURRENT_BINARY_DIR}/${_qdocconf_name})
Expand All @@ -30,9 +36,8 @@ macro(qt_build_doc _qdocconf_name)
OUTPUT ${_qdoc_output_dir}/${_qdocconf_name}.qhp
COMMAND
${CMAKE_COMMAND} -E env QT_INSTALL_DOCS=${QDOC_TEMPLATE_DIR} QT_VERSION_TAG=${GAMMARAY_PLUGIN_VERSION}
QT_VERSION=${GAMMARAY_VERSION} BUILDDIR=${CMAKE_CURRENT_BINARY_DIR} ${QDOC_EXECUTABLE} --indexdir
${QDOC_INDEX_DIR} --outputdir ${_qdoc_output_dir}
${CMAKE_CURRENT_SOURCE_DIR}/${_qdocconf_name}-offline.qdocconf
QT_VERSION=${GAMMARAY_VERSION} BUILDDIR=${CMAKE_CURRENT_BINARY_DIR} ${QDOC_EXECUTABLE} ${_qdoc_index_args}
--outputdir ${_qdoc_output_dir} ${CMAKE_CURRENT_SOURCE_DIR}/${_qdocconf_name}-offline.qdocconf
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_qdocconf_name}-offline.qdocconf ${_qdoc_srcs} ${_qdoc_imgs}
COMMENT "Generate the offline manual using qdoc"
)
Expand Down Expand Up @@ -61,9 +66,8 @@ macro(qt_build_doc _qdocconf_name)
OUTPUT ${_qdoc_output_dir}/index.html
COMMAND
${CMAKE_COMMAND} -E env QT_INSTALL_DOCS=${QDOC_TEMPLATE_DIR} QT_VERSION_TAG=${GAMMARAY_PLUGIN_VERSION}
QT_VERSION=${GAMMARAY_VERSION} BUILDDIR=${CMAKE_CURRENT_BINARY_DIR} ${QDOC_EXECUTABLE} --indexdir
${QDOC_INDEX_DIR} --outputdir ${_qdoc_output_dir}
${CMAKE_CURRENT_SOURCE_DIR}/${_qdocconf_name}-online.qdocconf
QT_VERSION=${GAMMARAY_VERSION} BUILDDIR=${CMAKE_CURRENT_BINARY_DIR} ${QDOC_EXECUTABLE} ${_qdoc_index_args}
--outputdir ${_qdoc_output_dir} ${CMAKE_CURRENT_SOURCE_DIR}/${_qdocconf_name}-online.qdocconf
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_qdocconf_name}-online.qdocconf ${_qdoc_srcs} ${_qdoc_imgs}
${_qdoc_styles}
COMMENT "Generate the Qt-branded online manual using qdoc"
Expand All @@ -79,9 +83,8 @@ macro(qt_build_doc _qdocconf_name)
OUTPUT ${_qdoc_output_dir}/index.html
COMMAND
${CMAKE_COMMAND} -E env QT_INSTALL_DOCS=${QDOC_TEMPLATE_DIR} QT_VERSION_TAG=${GAMMARAY_PLUGIN_VERSION}
QT_VERSION=${GAMMARAY_VERSION} BUILDDIR=${CMAKE_CURRENT_BINARY_DIR} ${QDOC_EXECUTABLE} --indexdir
${QDOC_INDEX_DIR} --outputdir ${_qdoc_output_dir}
${CMAKE_CURRENT_SOURCE_DIR}/${_qdocconf_name}-online-kdab.qdocconf
QT_VERSION=${GAMMARAY_VERSION} BUILDDIR=${CMAKE_CURRENT_BINARY_DIR} ${QDOC_EXECUTABLE} ${_qdoc_index_args}
--outputdir ${_qdoc_output_dir} ${CMAKE_CURRENT_SOURCE_DIR}/${_qdocconf_name}-online-kdab.qdocconf
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_qdocconf_name}-online-kdab.qdocconf ${_qdoc_srcs} ${_qdoc_imgs}
${_qdoc_styles}
COMMENT "Generate the KDAB-branded online manual using qdoc"
Expand Down