Cleanup cmake for documentation creation
This commit is contained in:
parent
8c3374398a
commit
0658d297e5
|
@ -835,30 +835,9 @@ if( APPLE )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#================================================
|
#================================================
|
||||||
# Doxygen Output
|
# Add the documentation
|
||||||
#================================================
|
#================================================
|
||||||
|
add_subdirectory( Documentation )
|
||||||
find_package( Doxygen )
|
|
||||||
if( DOXYGEN_FOUND )
|
|
||||||
add_custom_target( doxygen-docs
|
|
||||||
${CMAKE_COMMAND} -E remove_directory Documentation/doxygen
|
|
||||||
COMMAND ${DOXYGEN_EXECUTABLE}
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
DEPENDS Doxyfile
|
|
||||||
COMMENT "building doxygen docs into directory Documentation/doxygen/html"
|
|
||||||
)
|
|
||||||
add_custom_target( dev-docs
|
|
||||||
${CMAKE_COMMAND} -E remove_directory Documentation/development/doxygen
|
|
||||||
COMMAND ${DOXYGEN_EXECUTABLE}
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Documentation/development
|
|
||||||
DEPENDS Doxyfile
|
|
||||||
COMMENT "building developer's resource docs into directory Documentation/development/doxygen/html"
|
|
||||||
)
|
|
||||||
|
|
||||||
add_subdirectory(Documentation/docset)
|
|
||||||
else()
|
|
||||||
message( STATUS "WARNING: Doxygen not found - doxygen-docs (Source Docs) target not created" )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Generate config.h.
|
# Generate config.h.
|
||||||
configure_file( ${PROJECT_SOURCE_DIR}/CMakeModules/config.h.cmake
|
configure_file( ${PROJECT_SOURCE_DIR}/CMakeModules/config.h.cmake
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
#
|
||||||
|
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, you may find one here:
|
||||||
|
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||||
|
# or you may search the http://www.gnu.org website for the version 2 license,
|
||||||
|
# or you may write to the Free Software Foundation, Inc.,
|
||||||
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
|
||||||
|
function(get_kicad_doc_version RESULT_NAME)
|
||||||
|
|
||||||
|
include( ${CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake )
|
||||||
|
create_git_version_header(${CMAKE_SOURCE_DIR})
|
||||||
|
|
||||||
|
# Now we have KICAD_VERSION, but it's got () around it
|
||||||
|
string(REPLACE "(" "" KICAD_VERSION ${KICAD_VERSION})
|
||||||
|
string(REPLACE ")" "" KICAD_VERSION ${KICAD_VERSION})
|
||||||
|
|
||||||
|
set (${RESULT_NAME} ${KICAD_VERSION} PARENT_SCOPE)
|
||||||
|
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
get_kicad_doc_version(KICAD_DOC_VERSION)
|
||||||
|
|
||||||
|
# copy and modify the "normal" Doxyfile
|
||||||
|
file(COPY ${SRC_DOXYFILE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
file(APPEND ${DOCSET_DOXYFILE} "
|
||||||
|
|
||||||
|
# Added for DocSet generation
|
||||||
|
OUTPUT_DIRECTORY = ${OUTPUT_DIRECTORY}
|
||||||
|
PROJECT_NAME = ${DOCSET_BUNDLE_ID}
|
||||||
|
PROJECT_NUMBER = ${KICAD_DOC_VERSION}
|
||||||
|
GENERATE_DOCSET = YES
|
||||||
|
DOCSET_FEEDNAME = ${DOCSET_BUNDLE_ID}
|
||||||
|
DOCSET_BUNDLE_ID = ${DOCSET_BUNDLE_ID}
|
||||||
|
DISABLE_INDEX = YES
|
||||||
|
GENERATE_TREEVIEW = NO
|
||||||
|
SEARCHENGINE = NO
|
||||||
|
GENERATE_TAGFILE = ${DOXY_TAG_FILE}"
|
||||||
|
)
|
|
@ -0,0 +1,45 @@
|
||||||
|
#
|
||||||
|
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2007-2020 Kicad Developers, see AUTHORS.txt for contributors.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, you may find one here:
|
||||||
|
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||||
|
# or you may search the http://www.gnu.org website for the version 2 license,
|
||||||
|
# or you may write to the Free Software Foundation, Inc.,
|
||||||
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
#
|
||||||
|
|
||||||
|
find_package( Doxygen )
|
||||||
|
|
||||||
|
if( DOXYGEN_FOUND )
|
||||||
|
add_custom_target( doxygen-docs
|
||||||
|
${CMAKE_COMMAND} -E remove_directory Documentation/doxygen
|
||||||
|
COMMAND ${DOXYGEN_EXECUTABLE}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
|
COMMENT "building doxygen docs into directory Documentation/doxygen/html"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_target( dev-docs
|
||||||
|
${CMAKE_COMMAND} -E remove_directory Documentation/development/doxygen
|
||||||
|
COMMAND ${DOXYGEN_EXECUTABLE}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Documentation/development
|
||||||
|
COMMENT "building developer's resource docs into directory Documentation/development/doxygen/html"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add the docset targets
|
||||||
|
add_subdirectory( docset )
|
||||||
|
else()
|
||||||
|
message( STATUS "WARNING: Doxygen not found - doxygen-docs (Source Docs) target not created" )
|
||||||
|
endif()
|
|
@ -34,21 +34,8 @@ find_program(SED sed)
|
||||||
|
|
||||||
if(DOXYGEN_FOUND AND DOXYTAG2ZEALDB AND SED)
|
if(DOXYGEN_FOUND AND DOXYTAG2ZEALDB AND SED)
|
||||||
|
|
||||||
function(get_kicad_doc_version RESULT_NAME)
|
|
||||||
|
|
||||||
include( ${CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake )
|
|
||||||
create_git_version_header(${CMAKE_SOURCE_DIR})
|
|
||||||
|
|
||||||
# Now we have KICAD_VERSION, but it's got () around it
|
|
||||||
string(REPLACE "(" "" KICAD_VERSION ${KICAD_VERSION})
|
|
||||||
string(REPLACE ")" "" KICAD_VERSION ${KICAD_VERSION})
|
|
||||||
|
|
||||||
set (${RESULT_NAME} ${KICAD_VERSION} PARENT_SCOPE)
|
|
||||||
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# The DocSet's bundle ID, which is used for most of the ID's
|
# The DocSet's bundle ID, which is used for most of the ID's
|
||||||
set(BUNDLE_ID KiCad)
|
set(DOCSET_BUNDLE_ID KiCad)
|
||||||
|
|
||||||
# The source for the doxygen config
|
# The source for the doxygen config
|
||||||
set(SRC_DOXYFILE ${CMAKE_SOURCE_DIR}/Doxyfile)
|
set(SRC_DOXYFILE ${CMAKE_SOURCE_DIR}/Doxyfile)
|
||||||
|
@ -57,9 +44,9 @@ if(DOXYGEN_FOUND AND DOXYTAG2ZEALDB AND SED)
|
||||||
set(DOCSET_DOXYFILE ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
set(DOCSET_DOXYFILE ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
||||||
|
|
||||||
# Various pieces of the docset
|
# Various pieces of the docset
|
||||||
set(DOCSET_LOC ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html/${BUNDLE_ID}.docset)
|
set(DOCSET_LOC ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html/${DOCSET_BUNDLE_ID}.docset)
|
||||||
set(DOXY_MAKEFILE ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html/Makefile)
|
set(DOXY_MAKEFILE ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html/Makefile)
|
||||||
set(DOXY_TAG_FILE ${CMAKE_CURRENT_BINARY_DIR}/${BUNDLE_ID}.tag)
|
set(DOXY_TAG_FILE ${CMAKE_CURRENT_BINARY_DIR}/${DOCSET_BUNDLE_ID}.tag)
|
||||||
set(DOCSET_PLIST ${DOCSET_LOC}/Contents/Info.plist)
|
set(DOCSET_PLIST ${DOCSET_LOC}/Contents/Info.plist)
|
||||||
set(DOCSET_DSIDX ${DOCSET_LOC}/Contents/Resources/docSet.dsidx)
|
set(DOCSET_DSIDX ${DOCSET_LOC}/Contents/Resources/docSet.dsidx)
|
||||||
|
|
||||||
|
@ -67,24 +54,20 @@ if(DOXYGEN_FOUND AND DOXYTAG2ZEALDB AND SED)
|
||||||
set(DOCSET_SRC_ICON16 ${CMAKE_CURRENT_SOURCE_DIR}/icon-16.png)
|
set(DOCSET_SRC_ICON16 ${CMAKE_CURRENT_SOURCE_DIR}/icon-16.png)
|
||||||
set(DOCSET_ICON16 ${DOCSET_LOC}/icon.png)
|
set(DOCSET_ICON16 ${DOCSET_LOC}/icon.png)
|
||||||
|
|
||||||
get_kicad_doc_version(KICAD_DOC_VERSION)
|
add_custom_command(
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
# copy and modify the "normal" Doxyfile
|
-DSRC_DOXYFILE=${SRC_DOXYFILE}
|
||||||
file(COPY ${SRC_DOXYFILE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
-DDOCSET_BUNDLE_ID=${DOCSET_BUNDLE_ID}
|
||||||
file(APPEND ${DOCSET_DOXYFILE} "
|
-DDOXY_TAG_FILE=${DOXY_TAG_FILE}
|
||||||
|
-DDOCSET_BUNDLE_ID=${DOCSET_BUNDLE_ID}
|
||||||
# Added for DocSet generation
|
-DDOCSET_DOXYFILE=${DOCSET_DOXYFILE}
|
||||||
OUTPUT_DIRECTORY = ${CMAKE_CURRENT_BINARY_DIR}/doxygen
|
-DOUTPUT_DIRECTORY="${CMAKE_CURRENT_BINARY_DIR}/doxygen"
|
||||||
PROJECT_NAME = ${BUNDLE_ID}
|
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
|
||||||
PROJECT_NUMBER = ${KICAD_DOC_VERSION}
|
-P ${CMAKE_MODULE_PATH}/CreateDocsetDoxyfile.cmake
|
||||||
GENERATE_DOCSET = YES
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/
|
||||||
DOCSET_FEEDNAME = ${BUNDLE_ID}
|
OUTPUT ${DOCSET_DOXYFILE}
|
||||||
DOCSET_BUNDLE_ID = ${BUNDLE_ID}
|
COMMENT "Modifying doxyfile for docset creation"
|
||||||
DISABLE_INDEX = YES
|
)
|
||||||
GENERATE_TREEVIEW = NO
|
|
||||||
SEARCHENGINE = NO
|
|
||||||
GENERATE_TAGFILE = ${DOXY_TAG_FILE}"
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOCSET_DOXYFILE}
|
COMMAND ${DOXYGEN_EXECUTABLE} ${DOCSET_DOXYFILE}
|
||||||
|
@ -98,7 +81,7 @@ GENERATE_TAGFILE = ${DOXY_TAG_FILE}"
|
||||||
# And modify the plist: DocSetPlatformFamily is used for the prefix in Zeal,
|
# And modify the plist: DocSetPlatformFamily is used for the prefix in Zeal,
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
COMMAND make || true
|
COMMAND make || true
|
||||||
COMMAND ${SED} -i "/<key>DocSetPlatformFamily<\\/key>/!b;n;s/doxygen/${BUNDLE_ID}/" ${DOCSET_PLIST}
|
COMMAND ${SED} -i "/<key>DocSetPlatformFamily<\\/key>/!b;n;s/doxygen/${DOCSET_BUNDLE_ID}/" ${DOCSET_PLIST}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html
|
||||||
DEPENDS ${DOXY_MAKEFILE}
|
DEPENDS ${DOXY_MAKEFILE}
|
||||||
OUTPUT ${DOCSET_PLIST}
|
OUTPUT ${DOCSET_PLIST}
|
||||||
|
@ -128,4 +111,4 @@ GENERATE_TAGFILE = ${DOXY_TAG_FILE}"
|
||||||
DEPENDS ${DOCSET_ICON16}
|
DEPENDS ${DOCSET_ICON16}
|
||||||
)
|
)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue