Skip to content
Snippets Groups Projects
Commit 09f800c1 authored by Dominic Kempf's avatar Dominic Kempf Committed by Andreas Dedner
Browse files

Add a DEPENDS option to dune_python_install_package

parent 481de635
Branches
Tags
1 merge request!960refactor the way python is used in dune
......@@ -24,7 +24,10 @@ add_subdirectory(share)
# if Python bindings are enabled, include necessary sub directories.
if(DUNE_ENABLE_PYTHONBINDINGS)
add_subdirectory(python)
dune_python_install_package(PATH "python")
dune_python_install_package(
PATH "python"
DEPENDS _common _typeregistry
)
endif()
# finalize the dune project, e.g. generating config.h etc.
......
......@@ -14,6 +14,12 @@
#
# Parameters to add to any :code:`pip install` call (appended).
#
# .. cmake_param:: DEPENDS
# :multi:
# :argname: dep
#
# Other CMake targets that the installation of this target depends on.
#
# This function installs the python package located at the given path. It
#
# * installs it to the location specified with :ref:`DUNE_PYTHON_INSTALL_LOCATION` during
......@@ -38,8 +44,11 @@ include_guard(GLOBAL)
function(dune_python_install_package)
# Parse Arguments
set(MULTI ADDITIONAL_PIP_PARAMS)
cmake_parse_arguments(PYINST "" "PATH" "${MULTI}" ${ARGN})
set(OPTION)
set(SINGLE PATH)
set(MULTI ADDITIONAL_PIP_PARAMS DEPENDS)
include(CMakeParseArguments)
cmake_parse_arguments(PYINST "${OPTION}" "${SINGLE}" "${MULTI}" ${ARGN})
if(PYINST_UNPARSED_ARGUMENTS)
message(WARNING "Unparsed arguments in dune_python_install_package: This often indicates typos!")
endif()
......@@ -110,7 +119,7 @@ function(dune_python_install_package)
ALL
COMMAND ${DUNE_PYTHON_VIRTUALENV_EXECUTABLE} ${INSTALL_CMDLINE}
COMMENT "Installing Python package at ${PYINST_FULLPATH} into Dune virtual environment..."
DEPENDS _common _typeregistry
DEPENDS ${PYINST_DEPENDS}
)
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment