Skip to content

Commit

Permalink
Added docs/CMakeLists.txt from MICM, with doxygen sections removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwfncar committed Mar 13, 2024
1 parent bd90cd0 commit 66bcbdb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ message(STATUS "Making MUSICA-Fortran sources installable : ${MAKE_MUSICA_FORTRA

################################################################################
# Projet wide setup options
option(MUSICA_BUILD_DOCS "Build the documentation" OFF)

cmake_dependent_option(
ENABLE_TESTS "Builds tests that ensures each enabled MUSICA component can be used" ON "USE_MUSICA" OFF)
message(STATUS "Build tests for MUSICA : ${ENABLE_TESTS}")
Expand Down Expand Up @@ -109,6 +111,10 @@ if(USE_MUSICA_FORTRAN)
add_subdirectory(musica-fortran)
endif()

if(MUSICA_BUILD_DOCS)
add_subdirectory(docs)
endif()

################################################################################
# Tests
if(ENABLE_TESTS)
Expand Down
20 changes: 20 additions & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
################################################################################
# Sphinx

set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/source)
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/sphinx)
set(SPHINX_INDEX_FILE ${SPHINX_BUILD}/index.html)

add_custom_command(
OUTPUT ${SPHINX_INDEX_FILE} __fake_file_to_ensure_this_always_run
COMMAND
${SPHINX_EXECUTABLE} -b html
${SPHINX_SOURCE} ${SPHINX_BUILD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
MAIN_DEPENDENCY ${SPHINX_SOURCE}/conf.py
COMMENT "Generating documentation with Sphinx"
# run this command each time. This way we don't have to keep track of each individual rst file
BuildDocs
)

add_custom_target(docs ALL DEPENDS ${SPHINX_INDEX_FILE} Doxygen)

0 comments on commit 66bcbdb

Please sign in to comment.