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

[feature] Enable or disable doxygen during build phase #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
24 changes: 21 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ cmake_minimum_required(VERSION 3.22)
project(srecord VERSION "1.65")
set(CMAKE_BUILD_TYPE Release)

option(SRecord_ENABLE_DOCS "Enable documentation generation" OFF)

# Headers are all relative to project root
include_directories(./)

Expand All @@ -45,7 +47,7 @@ include(packaging)
# libsrecord
add_subdirectory(srecord)

# Build srecord executables
# Build srecord executablesF
add_custom_target(srecord-executables)
add_custom_target(srecord-executables-version DEPENDS srecord-executables)
foreach(p IN ITEMS srec_cat srec_cmp srec_info)
Expand All @@ -62,8 +64,24 @@ endforeach()
enable_testing()
add_subdirectory(test)

# Documentation & Man Pages
add_subdirectory(doc)


if(SRecord_ENABLE_DOCS OR (CMAKE_BUILD_TYPE STREQUAL "Release"))
# Use CMakes built in rule for Doxygen
find_package(Doxygen)
if(NOT DOXYGEN_FOUND)
message(FATAL_ERROR "Unable to find Doxygen")
else()
set(SRecord_INTERNAL_ENABLE_DOCS YES)
endif()
else()
set(SRecord_INTERNAL_ENABLE_DOCS NO)
endif()

if(SRecord_INTERNAL_ENABLE_DOCS)
# Documentation & Man Pages
add_subdirectory(doc)
endif()

# Package SRecord
include(CPack)
58 changes: 29 additions & 29 deletions etc/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,32 +138,32 @@ option(_TANDEM_SOURCE ON)
# Enable general extensions on Solaris.
option(__EXTENSIONS__ ON)

# Doxygen configuration
find_package(Doxygen REQUIRED doxygen dot)

set(DOXYGEN_DOT_GRAPH_MAX_NODES 150)
set(DOXYGEN_ALPHABETICAL_INDEX NO)
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_CASE_SENSE_NAMES NO)
set(DOXYGEN_CLASS_DIAGRAMS YES)
set(DOXYGEN_DISTRIBUTE_GROUP_DOC YES)
set(DOXYGEN_EXCLUDE bin)
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_EXTRACT_LOCAL_CLASSES NO)
set(DOXYGEN_FILE_PATTERNS *.h)
set(DOXYGEN_GENERATE_TREEVIEW YES)
set(DOXYGEN_HIDE_FRIEND_COMPOUNDS YES)
set(DOXYGEN_HIDE_IN_BODY_DOCS YES)
set(DOXYGEN_HIDE_UNDOC_CLASSES YES)
set(DOXYGEN_HIDE_UNDOC_MEMBERS YES)
set(DOXYGEN_JAVADOC_AUTOBRIEF YES)
set(DOXYGEN_QT_AUTOBRIEF YES)
set(DOXYGEN_QUIET YES)
set(DOXYGEN_RECURSIVE YES)
set(DOXYGEN_REFERENCED_BY_RELATION YES)
set(DOXYGEN_REFERENCES_RELATION YES)
set(DOXYGEN_SORT_BY_SCOPE_NAME YES)
set(DOXYGEN_SORT_MEMBER_DOCS NO)
set(DOXYGEN_SOURCE_BROWSER YES)
set(DOXYGEN_STRIP_CODE_COMMENTS NO)
set(DOXYGEN_GENERATE_HTML YES)
if(SRecord_INTERNAL_ENABLE_DOCS)
# Doxygen configuration
set(DOXYGEN_DOT_GRAPH_MAX_NODES 150)
set(DOXYGEN_ALPHABETICAL_INDEX NO)
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_CASE_SENSE_NAMES NO)
set(DOXYGEN_CLASS_DIAGRAMS YES)
set(DOXYGEN_DISTRIBUTE_GROUP_DOC YES)
set(DOXYGEN_EXCLUDE bin)
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_EXTRACT_LOCAL_CLASSES NO)
set(DOXYGEN_FILE_PATTERNS *.h)
set(DOXYGEN_GENERATE_TREEVIEW YES)
set(DOXYGEN_HIDE_FRIEND_COMPOUNDS YES)
set(DOXYGEN_HIDE_IN_BODY_DOCS YES)
set(DOXYGEN_HIDE_UNDOC_CLASSES YES)
set(DOXYGEN_HIDE_UNDOC_MEMBERS YES)
set(DOXYGEN_JAVADOC_AUTOBRIEF YES)
set(DOXYGEN_QT_AUTOBRIEF YES)
set(DOXYGEN_QUIET YES)
set(DOXYGEN_RECURSIVE YES)
set(DOXYGEN_REFERENCED_BY_RELATION YES)
set(DOXYGEN_REFERENCES_RELATION YES)
set(DOXYGEN_SORT_BY_SCOPE_NAME YES)
set(DOXYGEN_SORT_MEMBER_DOCS NO)
set(DOXYGEN_SOURCE_BROWSER YES)
set(DOXYGEN_STRIP_CODE_COMMENTS NO)
set(DOXYGEN_GENERATE_HTML YES)
endif()
10 changes: 6 additions & 4 deletions srecord/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ configure_file(config.h.in config.h @ONLY)
configure_file(patchlevel.h.in patchlevel.h @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

# Generate doxygen content
doxygen_add_docs(doxygen
${LIB_SRECORD_HDR}
ALL)
if(SRecord_INTERNAL_ENABLE_DOCS)
# Generate doxygen content
doxygen_add_docs(doxygen
${LIB_SRECORD_HDR}
ALL)
endif()