Commit 752300e7 authored by Mike Kremer's avatar Mike Kremer

CMake now generates QtHelp files out of html folders within a plugin's Documentation folder.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9397 383ad7c9-94d9-4d36-a494-682f7c89f535
parent c49e976e
......@@ -253,6 +253,19 @@ function (_build_openflipper_plugin plugin)
endif()
# Copy the html folder
acg_copy_after_build (${plugin}-doc "${CMAKE_CURRENT_SOURCE_DIR}/Documentation/html" "${plugin_doc_dir}/html")
generate_qhp_file("${CMAKE_CURRENT_SOURCE_DIR}/Documentation/html" "Plugin-${plugin}")
if(WIN32)
add_custom_command(TARGET ${plugin}-doc POST_BUILD
COMMAND ${QT_BINARY_DIR}/qhelpgenerator.exe
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/Documentation/html/Plugin-${plugin}.qhp)
else()
add_custom_command(TARGET ${plugin}-doc POST_BUILD
COMMAND ${QT_BINARY_DIR}/qhelpgenerator
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/Documentation/html/Plugin-${plugin}.qhp)
endif()
add_custom_command(TARGET ${plugin}-doc POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/Documentation/html/Plugin-${plugin}.qch" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Help/Plugin-${plugin}.qch"
)
else (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Documentation/doxy.config.in)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Documentation/CMakeLists.txt)
# Create directories in order to avoid doxygen warnings
......
......@@ -583,3 +583,30 @@ function (acg_add_translations _target _languages _sources)
install (FILES ${_qm_files} DESTINATION "${ACG_PROJECT_DATADIR}/Translations")
endif ()
endfunction ()
# Function that writes all generated qch files into one Help.qhcp project file
function (generate_qhp_file files_loc plugin_name)
set(qhp_file "${files_loc}/${plugin_name}.qhp")
# Read in template file
file(STRINGS "${CMAKE_SOURCE_DIR}/OpenFlipper/Documentation/QtHelpResources/QtHelpProject.qhp" qhp_template)
# Initialize new project file
file(WRITE ${qhp_file} "")
foreach (_line ${qhp_template})
string(STRIP ${_line} stripped)
if("${stripped}" STREQUAL "files")
acg_get_files_in_dir (_files ${files_loc})
foreach (_file ${_files})
string(REGEX MATCH ".+[.]+((html)|(htm)|(xml))$" fileresult ${_file})
string(LENGTH "${fileresult}" len)
if(${len} GREATER 0)
file(APPEND ${qhp_file} "<file>${_file}</file>\n")
endif()
endforeach()
else()
string(REGEX REPLACE "plugin" ${plugin} newline ${_line})
file(APPEND ${qhp_file} "${newline}\n")
endif()
endforeach()
endfunction()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment