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

[!298] [cmake] Give a meaningful error message if not cloned recursively

Merge branch 'feature/check-for-submodule-existence' into 'master'

See merge request [extensions/dune-codegen!298]

  [extensions/dune-codegen!298]: Noneextensions/dune-codegen/merge_requests/298
parents 3022036d 5b0a774e
No related branches found
No related tags found
No related merge requests found
install(FILES deplist.py
dune-codegen_sourcepath.py
DuneCodegenMacros.cmake
DuneSubmoduleChecker.cmake
GeneratedSystemtest.cmake
DESTINATION ${DUNE_INSTALL_MODULEDIR})
......@@ -160,3 +160,4 @@ function(add_generated_executable)
endfunction()
include(GeneratedSystemtests)
include(DuneSubmoduleChecker)
# A CMake module to check for the existence of submodules!
#
# .. cmake_function:: dune_check_submodule
#
# .. cmake_param:: PATH
# :required:
#
# The relative path to the submodule directory
#
# .. cmake_param:: INDICATOR
# :required:
#
# A filename (like setup.py) that indicates a correctly cloned submodule
#
function(dune_check_submodule)
# Parse Arguments
include(CMakeParseArguments)
cmake_parse_arguments(SUBMODULE "" "PATH;INDICATOR" "" ${ARGN})
if(SUBMODULE_UNPARSED_ARGUMENTS)
message(WARNING "Unparsed arguments in dune_check_submodule: This often indicates typos!")
endif()
if(NOT SUBMODULE_PATH)
message(FATAL_ERROR "PATH argument not given to dune_check_submodule!")
endif()
if(NOT SUBMODULE_INDICATOR)
message(FATAL_ERROR "INDICATOR argument not given to dune_check_submodule!")
endif()
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${SUBMODULE_PATH}/${SUBMODULE_INDICATOR})
message(FATAL_ERROR "No git submodule found at location ${CMAKE_CURRENT_SOURCE_DIR}/${SUBMODULE_PATH}. You should clone this repository with the --recursive flag! It is described in the README!")
endif()
endfunction()
# Check that the submodules have been checked out!
dune_check_submodule(PATH pytools INDICATOR setup.py)
dune_check_submodule(PATH cgen INDICATOR setup.py)
dune_check_submodule(PATH pymbolic INDICATOR setup.py)
dune_check_submodule(PATH loopy INDICATOR setup.py)
dune_check_submodule(PATH ufl INDICATOR setup.py)
# Install all the external packages that we have as submodules
dune_python_install_package(PATH pytools)
dune_python_install_package(PATH cgen)
......
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