Skip to content
Snippets Groups Projects
Commit 71363f76 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Add a Sphinx doc

parent 2ccff869
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ dune_register_package_flags(LIBRARIES dunecodegen) ...@@ -29,6 +29,7 @@ dune_register_package_flags(LIBRARIES dunecodegen)
dune_enable_all_packages() dune_enable_all_packages()
add_subdirectory(doc)
add_subdirectory(dune/codegen) add_subdirectory(dune/codegen)
add_subdirectory(cmake/modules) add_subdirectory(cmake/modules)
......
...@@ -22,19 +22,20 @@ ...@@ -22,19 +22,20 @@
# The name given to the added executable target. # The name given to the added executable target.
# #
# .. cmake_param:: SOURCE # .. cmake_param:: SOURCE
# :single:
# #
# The cc source file to build from. If omitted, a minimal # The cc source file to build from. If omitted, a minimal
# source file and a driver file will be generated. # source file and a driver file will be generated.
# #
# .. cmake_param:: FORM_COMPILER_ARGS # .. cmake_param:: FORM_COMPILER_ARGS
# :multi: # :multi:
# :argname arg: # :argname: arg
# #
# Additional arguments as recognized by the form compiler. # Additional arguments as recognized by the form compiler.
# #
# .. cmake_param:: DEPENDS # .. cmake_param:: DEPENDS
# :multi: # :multi:
# :argname dep: # :argname: dep
# #
# Additional dependencies of the generated executable (changes in those # Additional dependencies of the generated executable (changes in those
# will retrigger generation) # will retrigger generation)
...@@ -57,7 +58,7 @@ ...@@ -57,7 +58,7 @@
# #
# .. cmake_param:: ANALYZE_GRID_COMMAND # .. cmake_param:: ANALYZE_GRID_COMMAND
# :multi: # :multi:
# :argname command: # :argname: command
# #
# Use this to pass a custom grid analysis command. This is necessary # Use this to pass a custom grid analysis command. This is necessary
# if you use a custom grid generation methdod. The inifile and the # if you use a custom grid generation methdod. The inifile and the
......
# System testing for generated executables. All ideas taken from dune-testtools. # System testing for generated executables. All ideas taken from dune-testtools.
#
# .. cmake_function:: dune_add_formcompiler_system_test
#
# .. cmake_param:: UFLFILE
# :single:
# :required:
#
# The UFL file to create the generate code from.
#
# .. cmake_param:: INIFILE
# :single:
# :required:
#
# The ini file that controls the form compilation process.
# It is expected to contain a [formcompiler] section. This
# file may contain meta ini annotations.
#
# .. cmake_param:: BASENAME
# :single:
# :required:
#
# The basename for the generated executables.
#
# .. cmake_param:: SCRIPT
# :single:
#
# The python script that decides about test failure/success.
# Defaults to a script that simply runs the program and checks
# the exit code. More scripts to be found in dune-testtools.
#
# .. cmake_param:: SOURCE
# :single:
#
# The cc source file to build from. If omitted, a minimal
# source file and a driver file will be generated.
#
# .. cmake_param:: CREATED_TARGETS
# :single:
#
# A variable name that should be filled with the list of generated
# targets. This can be used to modify these lateron.
#
# .. cmake_param:: DEPENDS
# :multi:
# :argname: dep
#
# Additional dependencies of the generated executable (changes in those
# will retrigger generation)
#
# .. cmake_param:: NO_TESTS
# :option:
#
# If given, code will be generated and built normally, but no tests will
# be added to the test suite.
#
# .. cmake_param:: ANALYZE_GRID
# :option:
#
# Set this option to enable code generation time grid analysis.
# This is useful to reduce the variety of sum factorization kernels
# in unstructured grids. Note that the grid analysis tool needs to
# be able to construct your grid from the given inifile. If you have
# a custom grid construction method, you can use ANALYZE_GRID_COMMAND
# instead.
#
# .. cmake_param:: ANALYZE_GRID_COMMAND
# :multi:
# :argname: command
#
# Use this to pass a custom grid analysis command. This is necessary
# if you use a custom grid generation methdod. The inifile and the
# outputfile will be appended to this command. You can use the analysis code in
# dune/codegen/sumfact/analyzegrid.hh to write your own tool.
# Specifying this option will automatically set ANALYZE_GRID.
# #
function(dune_add_formcompiler_system_test) function(dune_add_formcompiler_system_test)
# parse arguments # parse arguments
set(OPTION DEBUG NO_TESTS ANALYZE_GRID) set(OPTION DEBUG NO_TESTS ANALYZE_GRID)
set(SINGLE INIFILE BASENAME SCRIPT UFLFILE SOURCE) set(SINGLE INIFILE BASENAME SCRIPT UFLFILE SOURCE CREATED_TARGETS)
set(MULTI CREATED_TARGETS DEPENDS) set(MULTI DEPENDS ANALYZE_GRID_COMMAND)
cmake_parse_arguments(SYSTEMTEST "${OPTION}" "${SINGLE}" "${MULTI}" ${ARGN}) cmake_parse_arguments(SYSTEMTEST "${OPTION}" "${SINGLE}" "${MULTI}" ${ARGN})
if(SYSTEMTEST_UNPARSED_ARGUMENTS) if(SYSTEMTEST_UNPARSED_ARGUMENTS)
...@@ -25,6 +99,10 @@ function(dune_add_formcompiler_system_test) ...@@ -25,6 +99,10 @@ function(dune_add_formcompiler_system_test)
if(SYSTEMTEST_ANALYZE_GRID) if(SYSTEMTEST_ANALYZE_GRID)
set(ANALYZE_GRID_STR "ANALYZE_GRID") set(ANALYZE_GRID_STR "ANALYZE_GRID")
endif() endif()
set(ANALYZE_GRID_COMMAND_STR "")
if(SYSTEMTEST_ANALYZE_GRID_COMMAND)
set(ANALYZE_GRID_COMMAND_STR "ANALYZE_GRID_COMMAND ${SYSTEMTEST_ANALYZE_GRID_COMMAND}")
endif()
# set a default for the script. call_executable.py just calls the executable. # set a default for the script. call_executable.py just calls the executable.
# There, it is also possible to hook in things depending on the inifile # There, it is also possible to hook in things depending on the inifile
...@@ -62,6 +140,7 @@ function(dune_add_formcompiler_system_test) ...@@ -62,6 +140,7 @@ function(dune_add_formcompiler_system_test)
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL
${SOURCE} ${SOURCE}
${ANALYZE_GRID_STR} ${ANALYZE_GRID_STR}
${ANALYZE_GRID_COMMAND_STR}
) )
# Enrich the target with preprocessor variables from the __static section # Enrich the target with preprocessor variables from the __static section
......
dune_cmake_sphinx_doc(MODULE_ONLY)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment