mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
cmake: Add a Doxygen target to the binary distribution (fixes issue #3386)
This change also writes a docs/index.html file to provide an easier entry point for loading the documentation from the docs/html directory.
This commit is contained in:
@ -234,3 +234,22 @@ endif()
|
|||||||
|
|
||||||
# Display configuration settings.
|
# Display configuration settings.
|
||||||
PRINT_CEF_CONFIG()
|
PRINT_CEF_CONFIG()
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Define the API documentation target.
|
||||||
|
#
|
||||||
|
|
||||||
|
find_package(Doxygen)
|
||||||
|
if(DOXYGEN_FOUND)
|
||||||
|
add_custom_target(apidocs ALL
|
||||||
|
# Generate documentation in the docs/html directory.
|
||||||
|
COMMAND "${DOXYGEN_EXECUTABLE}" Doxyfile
|
||||||
|
# Write a docs/index.html file.
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E echo "<html><head><meta http-equiv=\"refresh\" content=\"0;URL='html/index.html'\"/></head></html>" > docs/index.html
|
||||||
|
WORKING_DIRECTORY "${CEF_ROOT}"
|
||||||
|
COMMENT "Generating API documentation with Doxygen..."
|
||||||
|
VERBATIM )
|
||||||
|
else()
|
||||||
|
message(WARNING "Doxygen must be installed to generate API documentation.")
|
||||||
|
endif()
|
||||||
|
@ -25,8 +25,12 @@ for /F %%i in ('python.bat %~dp0\cef_version.py current') do set PROJECT_NUMBER=
|
|||||||
set CURRENT_PATH="%CD%"
|
set CURRENT_PATH="%CD%"
|
||||||
cd "%~dp0\.."
|
cd "%~dp0\.."
|
||||||
|
|
||||||
|
:: Generate documentation in the docs/html directory.
|
||||||
%DOXYGEN_EXE% Doxyfile
|
%DOXYGEN_EXE% Doxyfile
|
||||||
|
|
||||||
|
:: Write a docs/index.html file.
|
||||||
|
echo|set /p="<html><head><meta http-equiv="refresh" content="0;URL='html/index.html'"/></head></html>" > docs/index.html
|
||||||
|
|
||||||
cd "%CURRENT_PATH%"
|
cd "%CURRENT_PATH%"
|
||||||
|
|
||||||
:end
|
:end
|
||||||
|
@ -211,6 +211,17 @@ def copy_gtest(tests_dir):
|
|||||||
os.path.join(target_gtest_dir, 'teamcity'), options.quiet)
|
os.path.join(target_gtest_dir, 'teamcity'), options.quiet)
|
||||||
|
|
||||||
|
|
||||||
|
def transfer_doxyfile(dst_dir, quiet):
|
||||||
|
""" Transfer and post-process the Doxyfile. """
|
||||||
|
src_file = os.path.join(cef_dir, 'Doxyfile')
|
||||||
|
if os.path.isfile(src_file):
|
||||||
|
data = read_file(src_file)
|
||||||
|
data = data.replace("$(PROJECT_NUMBER)", cef_ver)
|
||||||
|
write_file(os.path.join(dst_dir, 'Doxyfile'), data)
|
||||||
|
if not quiet:
|
||||||
|
sys.stdout.write('Creating Doxyfile file.\n')
|
||||||
|
|
||||||
|
|
||||||
def transfer_gypi_files(src_dir, gypi_paths, gypi_path_prefix, dst_dir, quiet):
|
def transfer_gypi_files(src_dir, gypi_paths, gypi_path_prefix, dst_dir, quiet):
|
||||||
""" Transfer files from one location to another. """
|
""" Transfer files from one location to another. """
|
||||||
for path in gypi_paths:
|
for path in gypi_paths:
|
||||||
@ -842,6 +853,9 @@ if mode == 'standard':
|
|||||||
copy_file(os.path.join(cef_dir, 'cef_paths2.gypi'), \
|
copy_file(os.path.join(cef_dir, 'cef_paths2.gypi'), \
|
||||||
os.path.join(output_dir, 'cef_paths2.gypi'), options.quiet)
|
os.path.join(output_dir, 'cef_paths2.gypi'), options.quiet)
|
||||||
|
|
||||||
|
# transfer Doxyfile
|
||||||
|
transfer_doxyfile(output_dir, options.quiet)
|
||||||
|
|
||||||
if platform == 'windows':
|
if platform == 'windows':
|
||||||
libcef_dll = 'libcef.dll'
|
libcef_dll = 'libcef.dll'
|
||||||
libcef_dll_lib = '%s.lib' % libcef_dll
|
libcef_dll_lib = '%s.lib' % libcef_dll
|
||||||
@ -1010,7 +1024,7 @@ if platform == 'windows':
|
|||||||
sys.stdout.write(result['err'])
|
sys.stdout.write(result['err'])
|
||||||
sys.stdout.write(result['out'])
|
sys.stdout.write(result['out'])
|
||||||
|
|
||||||
src_dir = os.path.join(cef_dir, 'docs', 'html')
|
src_dir = os.path.join(cef_dir, 'docs')
|
||||||
if path_exists(src_dir):
|
if path_exists(src_dir):
|
||||||
# create the docs output directory
|
# create the docs output directory
|
||||||
docs_output_dir = create_output_dir(output_dir_base + '_docs',
|
docs_output_dir = create_output_dir(output_dir_base + '_docs',
|
||||||
|
Reference in New Issue
Block a user