Skip to content

Commit

Permalink
adding doxygen build
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Dec 28, 2023
1 parent 3c5074d commit 4481eba
Show file tree
Hide file tree
Showing 4 changed files with 2,700 additions and 1 deletion.
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# This is the main CMake file for fv3atm.
#
# Mark Potts, Kyle Gerheiser, Alex Richert
cmake_minimum_required(VERSION 3.19)

# Handle user build options.
option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)

# Enable CI build & unit testing:
if(BUILD_TESTING)
cmake_minimum_required(VERSION 3.19)
project(fv3atm VERSION 1.0 LANGUAGES C CXX Fortran)
include(ci/CMakeLists.txt)
endif()
Expand Down Expand Up @@ -141,6 +148,12 @@ if(OPENMP)
target_link_libraries(fv3atm PUBLIC OpenMP::OpenMP_Fortran)
endif()

# Determine whether or not to generate documentation.
if(ENABLE_DOCS)
find_package(Doxygen REQUIRED)
endif()
add_subdirectory(docs)

###############################################################################
### Install
###############################################################################
Expand Down
17 changes: 17 additions & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This is the CMake file for building the docs directory of fv3atm.
#
# Ed Hartnett 12/28/23

IF(ENABLE_DOCS)

# Create doxyfile.
SET(abs_top_srcdir "${CMAKE_SOURCE_DIR}")
SET(abs_top_builddir "${CMAKE_BINARY_DIR}")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
ADD_CUSTOM_TARGET(doc ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API Documentation with Doxygen" VERBATIM)

ENDIF(ENABLE_DOCS)

Loading

0 comments on commit 4481eba

Please sign in to comment.