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

Reorganise our code in preparation for our work on the interpreter #1261

Open
wants to merge 111 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
fd05860
Python docstrings tests: don't test for CellmlElementType.
agarny Aug 5, 2024
0207ff9
Code generator: use different arrays for constants, computed constant…
agarny Jul 12, 2024
329b01f
Generator: use different arrays for constants, computed constants, an…
agarny Aug 7, 2024
56a8658
Generator: use different arrays for constants, computed constants, an…
agarny Aug 7, 2024
94515cc
Generator: use different arrays for constants, computed constants, an…
agarny Aug 7, 2024
8488c49
Generator: use different arrays for constants, computed constants, an…
agarny Aug 7, 2024
5287d5b
Generator: use computed_constants and not computedConstants in Python.
agarny Aug 7, 2024
82c104e
Generator profile: bumped the C and Python versions.
agarny Aug 7, 2024
0f8fbf3
Tests: automatically generate the expected file contents.
agarny Aug 8, 2024
c2504d7
Generator profile: added setters/getters for constants, computed cons…
agarny Aug 7, 2024
01bfdec
Analyser: track the constant, computed constant, and algebraic indexes.
agarny Aug 8, 2024
09fcc1f
Some minor cleaning up.
agarny Aug 8, 2024
a7c7774
Generator: added an external array.
agarny Aug 8, 2024
ef86447
Updated JavaScript tests.
agarny Aug 8, 2024
9d7174d
Analyser: keep track of computed constants and external variables for…
agarny Aug 8, 2024
60b26bc
Analyser: some minor cleaning up.
agarny Aug 8, 2024
05aa338
AnalyserModel: keep track of the constants, computed constants, and e…
agarny Aug 8, 2024
7c0d8a1
AnalyserEquation: keep track of states and constants.
agarny Aug 9, 2024
9f8bf25
Generator: generate the CONSTANT_INFO, COMPUTED_CONSTANT_INFO, ALGEBR…
agarny Aug 12, 2024
4bc05e8
Generator: don't need to mention the type of a variable in a XXX_INFO…
agarny Aug 14, 2024
330f6d6
GeneratorProfile: extracted generator profile_p.h.
agarny Aug 14, 2024
aaaeed3
Generator: updated the createXxxArray() methods.
agarny Aug 14, 2024
46e4e93
Generator: updated the signature of our initialiseVariables() method.
agarny Aug 15, 2024
fa807fb
GeneratorProfile: fixed a small issue with our Python profile.
agarny Aug 15, 2024
71ae73b
Generator: initialise things in initialiseVariables() in the order of…
agarny Aug 15, 2024
b1b7536
Generator: initialise all computed constants in computeComputedConsta…
agarny Aug 15, 2024
a46dbca
GeneratorProfile: added the external array string.
agarny Aug 16, 2024
0a05ef9
Generator: don't initialise our external variables in initialiseVaria…
agarny Aug 16, 2024
b514746
Analyser: a variable using an NLA should always be an algebraic varia…
agarny Aug 16, 2024
153b4b5
Analyser: some minor cleaning up.
agarny Aug 16, 2024
19126a8
Analyser: properly set the index of external variables.
agarny Aug 16, 2024
841c676
Analyser: put some struct/class definitions in a corresponding privat…
agarny Aug 16, 2024
8afeb5c
Analyser: simplified things.
agarny Aug 16, 2024
40d3fb4
Generator: make sure that constants are initialised when they are nee…
agarny Aug 17, 2024
b32d169
Generator: renamed the "external" array to "externals".
agarny Aug 19, 2024
8cba9cd
Generator: "initialise" computed constants in initialiseVariables().
agarny Aug 19, 2024
65e1d18
Generator: initialise things in initialiseVariables() in the order of…
agarny Aug 19, 2024
327225a
GeneratorProfile: pass the computedConstants array to initialiseVaria…
agarny Aug 19, 2024
d1020eb
GeneratorProfile: don't need to pass the VOI to initialiseVariables().
agarny Aug 19, 2024
f3bbce3
Tests: removed unneeded generated C/Python files.
agarny Aug 19, 2024
1f09630
Generator: make sure that constants are initialised when they are nee…
agarny Aug 19, 2024
b54f688
GeneratorProfile: use the constants, computed constants, and algebrai…
agarny Aug 19, 2024
d165208
GeneratorProfile: use the constants, computed constants, and algebrai…
agarny Aug 19, 2024
183d531
Tests: some minor cleaning up.
agarny Aug 20, 2024
54e6673
Some minor cleaning up.
agarny Aug 21, 2024
62dc092
GeneratorProfile: use the externals array to retrieve the value of ex…
agarny Aug 20, 2024
4bf1afc
Addressed various coverage issues as a result of our work on issue #1…
agarny Aug 20, 2024
68ad0fc
Some minor cleaning up.
agarny Aug 28, 2024
ff5a1a2
Analyser: improved unit scaling.
agarny Aug 27, 2024
c83f5c7
Some minor cleaning up.
agarny Sep 2, 2024
26ba852
Generator: make sure that NLA systems have access to external variables.
agarny Sep 3, 2024
68c9895
Generator: fixed a small issue with our Python profile.
agarny Sep 5, 2024
f0957e0
Tests: added a test to generate some code for the DAE version of the …
agarny Sep 5, 2024
49b3a4f
Tests: changed the external variable in algebraicEqnWithOneNonIsolate…
agarny Sep 6, 2024
6b74014
Python: improved the API documentation.
agarny Sep 10, 2024
dcbd038
Some minor cleaning up.
agarny Sep 10, 2024
e3ce0d1
Merge branch 'main' into issue1243.
agarny Oct 7, 2024
bc97102
AnalyserEquationAst: don't include "libcellml/undefines.h" in the .cp…
agarny Oct 14, 2024
a581c7f
SWIG: make it work with Clang 19
agarny Oct 14, 2024
c07412b
API: simplifed/improved the API for external variables.
agarny Oct 15, 2024
5febd95
CI: added some "basic" GitHub Actions.
agarny Oct 15, 2024
cf90c3b
CI: added some "basic" GitHub Actions.
agarny Oct 16, 2024
96877a6
CI: added some "basic" GitHub Actions.
agarny Oct 16, 2024
b6d52b0
CI: added some "basic" GitHub Actions.
agarny Oct 16, 2024
1add1b6
CI: added some "basic" GitHub Actions.
agarny Oct 16, 2024
1dce201
CI: added some "basic" GitHub Actions.
agarny Oct 16, 2024
aefa695
CI: added some "basic" GitHub Actions.
agarny Oct 16, 2024
ffd073f
CMake: don't use hints to find llvm-cov and llvm-profdata.
agarny Oct 17, 2024
69aa6ca
CMake: let the user know where the coverage report can be found.
agarny Oct 17, 2024
b9492a5
Merge branch 'python' into issue1260.
agarny Oct 21, 2024
e917ba4
Merge branch 'issue1257' into issue1260.
agarny Oct 21, 2024
f1fa3ed
Merge branch 'issue1251' into issue1260.
agarny Oct 21, 2024
8175278
Merge branch 'issue1243' into issue1260
agarny Oct 21, 2024
c0eef39
Some minor cleaning up.
agarny Oct 21, 2024
e739d34
Merge branch 'issue1251' into issue1243
agarny Oct 21, 2024
8563e4b
Some minor cleaning up.
agarny Oct 21, 2024
dba1002
Merge branch 'issue1243' into issue1260.
agarny Oct 21, 2024
7cf4ed9
Merge branch 'main' into issue1253.
agarny Oct 21, 2024
c9c28d6
Merge branch 'main' into python.
agarny Oct 21, 2024
feffbea
Merge branch 'main' into issue1257.
agarny Oct 21, 2024
4a71e2f
Merge branch 'main' into issue1251.
agarny Oct 21, 2024
ddbb845
Merge branch 'main' into issue1243
agarny Oct 21, 2024
9c70e41
Merge branch 'issue1243' into issue1260.
agarny Oct 21, 2024
aeea86c
Some minor cleaning up.
agarny Oct 21, 2024
98bbe35
Merge branch 'issue1253' into python.
agarny Oct 21, 2024
e279a17
Merge branch 'python' into issue1257.
agarny Oct 21, 2024
925a288
Merge branch 'issue1257' into issue1251.
agarny Oct 21, 2024
e2d73da
Merge branch 'issue1251' into issue1243
agarny Oct 21, 2024
c7a98fa
Merge branch 'issue1243' into issue1260.
agarny Oct 21, 2024
c055c69
Make sure that we can find the version of llvm-cov that we installed.
agarny Oct 21, 2024
6c63b5c
CMake: use the PATH as a hint to find llvm-cov and llvm-profdata.
agarny Oct 21, 2024
62a5331
CMake: let the user know where the coverage report can be found.
agarny Oct 21, 2024
3e709db
Merge branch 'issue1253' into python.
agarny Oct 21, 2024
1c7c1c3
Merge branch 'python' into issue1251
agarny Oct 21, 2024
61f9b08
Merge branch 'issue1251' into issue1243.
agarny Oct 21, 2024
fe0fb28
Merge branch 'issue1243' into issue1260.
agarny Oct 21, 2024
4c4842f
Some minor cleaning up.
agarny Oct 22, 2024
228e25a
Merge branch 'issue1243' into issue1260.
agarny Oct 22, 2024
ee1e561
Some minor cleaning up.
agarny Oct 22, 2024
7c13a04
Moved areNearlyEqual() from utilties to commonutils.
agarny Oct 22, 2024
c029d7e
Analyser: account for the case where a piecewise statement doesn't ha…
agarny Oct 22, 2024
6b4889f
Debug: improved printAstAsTree().
agarny Oct 22, 2024
b61141d
Have our debug.* files formatted.
agarny Oct 22, 2024
8308d8e
Moved parts of our Generator class to our new GeneratorInterpreter cl…
agarny Oct 22, 2024
becf20e
GeneratorProfile: slight math-related improvements.
agarny Oct 22, 2024
a7e4f62
Tests utils: some minor cleaning up.
agarny Oct 22, 2024
a143845
Tests: various minor improvements.
agarny Oct 22, 2024
5a3a19e
Tests: improved our coverage.
agarny Oct 22, 2024
39a712b
Merge branch 'main' into issue1260
agarny Oct 23, 2024
25e0e46
Merge branch 'main' into issue1260
agarny Oct 26, 2024
6abbe9d
Merge branch 'main' into issue1260
agarny Oct 27, 2024
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
267 changes: 267 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
name: CI

on:
pull_request:
branches: [ main ]
workflow_dispatch:

env:
BUILDCACHE_ACCURACY: STRICT
BUILDCACHE_COMPRESS_FORMAT: ZSTD
BUILDCACHE_DEBUG: -1
BUILDCACHE_LOG_FILE: ""

jobs:
cpp_python:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: 'Windows static - C++/Python'
os: windows-latest
bindings_python: ON
build_shared: OFF
unit_tests: ON
set_path: $env:Path="C:\libxml2\bin;C:\zlib\bin;"+$env:Path
additional_cmake_options: -DLIBXML2_INCLUDE_DIR="C:\libxml2\include\libxml2" -DLIBXML2_LIBRARY="C:\libxml2\lib\libxml2.lib" -DZLIB_INCLUDE_DIR="C:\zlib\include" -DZLIB_LIBRARY="C:\zlib\lib\z_dll.lib"
- name: 'Windows shared - C++/Python'
os: windows-latest
bindings_python: ON
build_shared: ON
unit_tests: ON
set_path: $env:Path="C:\libxml2\bin;C:\zlib\bin;"+$env:Path
additional_cmake_options: -DLIBXML2_INCLUDE_DIR="C:\libxml2\include\libxml2" -DLIBXML2_LIBRARY="C:\libxml2\lib\libxml2.lib" -DZLIB_INCLUDE_DIR="C:\zlib\include" -DZLIB_LIBRARY="C:\zlib\lib\z_dll.lib"
- name: 'Linux static - C++ (build only)'
os: ubuntu-latest
bindings_python: OFF
build_shared: OFF
unit_tests: OFF
- name: 'Linux shared - C++/Python'
os: ubuntu-latest
bindings_python: ON
build_shared: ON
unit_tests: ON
- name: 'macOS static - C++ (Intel)'
os: macos-13
bindings_python: OFF
build_shared: OFF
unit_tests: ON
- name: 'macOS shared - C++/Python (Intel)'
os: macos-13
bindings_python: ON
build_shared: ON
unit_tests: ON
- name: 'macOS static - C++ (ARM)'
os: macos-latest
bindings_python: OFF
build_shared: OFF
unit_tests: ON
- name: 'macOS shared - C++/Python (ARM)'
os: macos-latest
bindings_python: ON
build_shared: ON
unit_tests: ON
steps:
- name: Check out libCellML
uses: actions/checkout@v4
- name: Install Python (if needed)
if: ${{ matrix.bindings_python == 'ON' }}
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: mikehardy/buildcache-action@v2
with:
cache_key: ${{ matrix.os }}-${{ matrix.build_shared }}
- name: Configure MSVC (Windows only)
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Install libxml2 (Windows only)
if: ${{ runner.os == 'Windows' }}
run: |
Invoke-WebRequest -UseBasicParsing https://github.com/cellml/gha/releases/download/gha/libxml2.zip -OutFile libxml2.zip
Expand-Archive -LiteralPath libxml2.zip -DestinationPath C:\
- name: Install SWIG (macOS only and if needed)
if: ${{ runner.os == 'macOS' && matrix.bindings_python == 'ON' }}
run: |
brew install swig
- name: Install zlib (Windows only)
if: ${{ runner.os == 'Windows' }}
run: |
Invoke-WebRequest -UseBasicParsing https://github.com/cellml/gha/releases/download/gha/zlib.zip -OutFile zlib.zip
Expand-Archive -LiteralPath zlib.zip -DestinationPath C:\
- name: Configure libCellML
run: |
mkdir build
cd build
${{ matrix.set_path }}
cmake -G Ninja -DBINDINGS_PYTHON=${{ matrix.bindings_python }} -DBUILD_SHARED=${{ matrix.build_shared }} -DCOVERAGE=OFF -DLLVM_COVERAGE=OFF -DMEMCHECK=OFF -DUNIT_TESTS=${{ matrix.unit_tests }} ${{ matrix.additional_cmake_options }} ..
- name: Build libCellML
run: |
cd build
ninja
- name: Unit testing
if: ${{ matrix.unit_tests == 'ON' }}
run: |
cd build
ninja test
javascript:
name: JavaScript
runs-on: macos-latest
strategy:
fail-fast: false
env:
LIBCELLML_WASM_DIR: wasm
LIBXML2_VERSION: 2.9.10
ZLIB_VERSION: 1.2.3
steps:
- name: Check out libCellML
uses: actions/checkout@v4
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: mikehardy/buildcache-action@v2
- name: Install Emscripten
run: |
brew install --overwrite emscripten
- name: Set up the build directory
run: |
mkdir build
- name: Build zlib
run: |
cd build
ZLIB_BUILD_DIR=zlib-wasm
git clone https://github.com/OpenCMISS-Dependencies/zlib.git -b v${ZLIB_VERSION}
mkdir ${ZLIB_BUILD_DIR}
emcmake cmake -G Ninja -S zlib -B ${ZLIB_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/${LIBCELLML_WASM_DIR} -DBUILD_SHARED_LIBS=OFF
cmake --build ${ZLIB_BUILD_DIR}
cmake --install ${ZLIB_BUILD_DIR}
- name: Build libxml2
run: |
cd build
LIBXML2_BUILD_DIR=libxml2-wasm
git clone https://github.com/OpenCMISS-Dependencies/libxml2.git -b v${LIBXML2_VERSION}
mkdir ${LIBXML2_BUILD_DIR}
emcmake cmake -G Ninja -S libxml2 -B ${LIBXML2_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/${LIBCELLML_WASM_DIR} -DZLIB_DIR=~/${LIBCELLML_WASM_DIR}/lib/cmake/ZLIB-${ZLIB_VERSION} -DBUILD_SHARED_LIBS=OFF -DLIBXML2_WITH_ICONV=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_TESTS=OFF -DLIBXML2_WITH_PROGRAMS=OFF
cmake --build ${LIBXML2_BUILD_DIR}
cmake --install ${LIBXML2_BUILD_DIR}
- name: Build libCellML
run: |
cd build
mkdir ${LIBCELLML_WASM_DIR}
emcmake cmake -G Ninja -S .. -B ${LIBCELLML_WASM_DIR} -DLibXml2_DIR=~/${LIBCELLML_WASM_DIR}/lib/cmake/libxml2-${LIBXML2_VERSION} -DBUILD_TYPE=Release
cmake --build ${LIBCELLML_WASM_DIR}
- name: Unit testing
run: |
cd build
cmake --build ${LIBCELLML_WASM_DIR} --target jest_test
code_formatting:
name: Code formatting
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Check out libCellML
uses: actions/checkout@v4
- name: Install ClangFormat
run: |
sudo apt update
sudo apt install clang-format
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Configure libCellML
run: |
mkdir build
cd build
cmake -G Ninja ..
- name: Code formatting
run: |
cd build
ninja test_clang_format
coverage:
name: Code coverage
runs-on: macos-latest
strategy:
fail-fast: false
steps:
- name: Check out libCellML
uses: actions/checkout@v4
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: mikehardy/buildcache-action@v2
- name: Install LLVM
run: |
brew install --overwrite llvm
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.bash_profile
- name: Configure libCellML
run: |
mkdir build
cd build
cmake -G Ninja -DBINDINGS_PYTHON=OFF ..
- name: Code coverage
run: |
cd build
ninja llvm_coverage
if [ `ninja llvm_coverage | grep TOTAL | sed 's/ /\n/g' | grep "100.00%" | wc -l | sed 's/ //g'` -eq 4 ]; then exit 0; else exit 1; fi
memory_leaks:
name: Memory leaks
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Check out libCellML
uses: actions/checkout@v4
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: mikehardy/buildcache-action@v2
- name: Install Valgrind
run: |
sudo apt update
sudo apt install valgrind
- name: Configure libCellML
run: |
mkdir build
cd build
cmake -G Ninja -DBINDINGS_PYTHON=OFF ..
- name: Memory leaks
run: |
cd build
ninja memcheck
documentation:
name: Documentation
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Check out libCellML
uses: actions/checkout@v4
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: mikehardy/buildcache-action@v2
- name: Install dot
run: |
sudo apt update
sudo apt install graphviz
- name: Install Doxygen
run: |
sudo apt update
sudo apt install doxygen
- name: Install Sphinx
run: |
pip3 install sphinx
- name: Configure libCellML
run: |
mkdir build
cd build
cmake -G Ninja -DBINDINGS_PYTHON=OFF ..
- name: Documentation
run: |
cd build
ninja docs
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,10 @@ if(CLANG_FORMAT_AVAILABLE)
${SOURCE_FILES}
${HEADER_FILES}
${CONFIG_FILES}
${TESTS_HEADER_FILES}
${DEBUG_SOURCE_FILES}
${DEBUG_HEADER_FILES}
${TESTS_SOURCE_FILES}
${TESTS_HEADER_FILES}
)

set(CHECK_CODE_FORMATTING_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/cmake_command_check_code_formatting.cmake)
Expand Down
10 changes: 10 additions & 0 deletions cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,13 @@ function(redhat_based _RESULT)
endif()
set(${_RESULT} ${_REDHAT_BASED} PARENT_SCOPE)
endfunction()

function(apply_libxml2_settings _TARGET)
if(HAVE_LIBXML2_CONFIG)
target_link_libraries(${_TARGET} PUBLIC ${LIBXML2_TARGET_NAME})
else()
target_include_directories(${_TARGET} PUBLIC ${LIBXML2_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
target_link_libraries(${_TARGET} PUBLIC ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES})
target_compile_definitions(${_TARGET} PUBLIC ${LIBXML2_DEFINITIONS})
endif()
endfunction()
6 changes: 4 additions & 2 deletions cmake/environmentchecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ else ()
endif()
find_program(CLANG_FORMAT_EXE NAMES ${PREFERRED_CLANG_FORMAT_NAMES} clang-format)
find_program(CLANG_TIDY_EXE NAMES ${PREFERRED_CLANG_TIDY_NAMES} clang-tidy)
find_program(DOT_EXE NAMES ${PREFERRED_FIND_NAMES} dot)
find_program(FIND_EXE NAMES ${PREFERRED_FIND_NAMES} find)
find_program(GCOV_EXE NAMES ${PREFERRED_GCOV_NAMES} gcov)
find_program(LLVM_COV_EXE NAMES ${PREFERRED_LLVM_COV_NAMES} llvm-cov HINTS ${LLVM_BIN_DIR} /Library/Developer/CommandLineTools/usr/bin/)
find_program(LLVM_PROFDATA_EXE NAMES ${PREFERRED_LLVM_PROFDATA_NAMES} llvm-profdata HINTS ${LLVM_BIN_DIR} /Library/Developer/CommandLineTools/usr/bin/)
find_program(LLVM_COV_EXE NAMES ${PREFERRED_LLVM_COV_NAMES} llvm-cov HINTS ${LLVM_BIN_DIR} ENV PATH /Library/Developer/CommandLineTools/usr/bin/)
find_program(LLVM_PROFDATA_EXE NAMES ${PREFERRED_LLVM_PROFDATA_NAMES} llvm-profdata HINTS ${LLVM_BIN_DIR} ENV PATH /Library/Developer/CommandLineTools/usr/bin/)
find_program(VALGRIND_EXE NAMES ${PREFERRED_VALGRIND_NAMES} valgrind)
find_program(INSTALL_NAME_TOOL_EXE NAMES ${PREFERRED_INSTALL_NAME_TOOL_NAMES} install_name_tool)

Expand Down Expand Up @@ -93,6 +94,7 @@ else ()
BUILDCACHE_EXE
CLANG_TIDY_EXE
CLANG_FORMAT_EXE
DOT_EXE
FIND_EXE
GCC_COVERAGE_COMPILER_FLAGS_OK
GCOV_EXE
Expand Down
5 changes: 2 additions & 3 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if(SPHINX_FOUND)
COMMENT "Building HTML documentation with Sphinx")
endif()

if(DOXYGEN_FOUND)
if(DOXYGEN_FOUND AND DOT_EXE)
set(DOXYGEN_DOCS_TARGET api_docs)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in.config ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(${DOXYGEN_DOCS_TARGET}
Expand All @@ -76,7 +76,7 @@ if(LIBCELLML_COVERAGE)
COMMENT "Running coverage tests with html output")
endif()

if(SPHINX_FOUND OR DOXYGEN_FOUND OR LIBCELLML_COVERAGE)
if(SPHINX_FOUND AND DOXYGEN_FOUND AND LIBCELLML_COVERAGE)
add_custom_target(docs
DEPENDS ${SPHINX_DOCS_TARGET} ${DOXYGEN_DOCS_TARGET} ${COVERAGE_DOCS_TARGET} ${DOXYGEN_API_XML_DOCS_TARGET}
COMMENT "Generating documentation")
Expand All @@ -86,4 +86,3 @@ if(SPHINX_FOUND OR DOXYGEN_FOUND OR LIBCELLML_COVERAGE)
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/_doctrees
COMMENT "Cleaning documentation")
endif()

Loading
Loading