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

Add necessary CMake script file

Install CMake scipt
parent 47745ae6
Branches
Tags
1 merge request!960refactor the way python is used in dune
......@@ -185,7 +185,8 @@ function(dune_python_install_package)
metadata_${targetname}
COMMAND ${CMAKE_COMMAND}
-Dmetadatafile=${metadatafile}
-DDEPS="${PROJECT_NAME}:${ALL_DEPENDENCIES}"
-DDEPS="${PROJECT_NAME};${ALL_DEPENDENCIES}"
-DDEPBUILDDIRS=${_export_builddirs}
-DMODULENAME=${PROJECT_NAME}
-DINSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-P ${scriptdir}/WritePythonCMakeMetadata.cmake
......
......@@ -25,8 +25,8 @@ if( DUNE_ENABLE_PYTHONBINDINGS )
include(DuneAddPybind11Module)
# Add a custom command that triggers the configuration of dune-py
add_custom_command(TARGET install_python POST_BUILD
COMMAND ${Python3_EXECUTABLE} -m dune configure
)
# add_custom_command(TARGET install_python POST_BUILD
# COMMAND ${Python3_EXECUTABLE} -m dune configure
# )
endif()
......@@ -11,6 +11,7 @@ install(FILES
pyversion.py
RunDoxygen.cmake
sphinx_cmake_dune.py
WritePythonCMakeMetadata.cmake
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dune/cmake/scripts)
# Install executable programs
......
file(
WRITE ${metadatafile}
"DEPBUILDDIRS=${DEPBUILDDIRS}\nDEPS=${DEPS}\nMODULENAME=${MODULENAME}\nINSTALL_PREFIX=${INSTALL_PREFIX}"
)
......@@ -5,9 +5,11 @@ set(DUNE_ENABLE_PYTHONBINDINGS ON)
set(CMAKE_PREFIX_PATH {{ install_prefix }})
{% for mod, dir in builddirs.items() %}
{% for mod, dir in builddirs.items() -%}
{% if dir != "" %}
set({{ mod }}_DIR {{ dir }})
{% endfor %}
{% endif %}
{%- endfor %}
if(NOT (dune-common_DIR OR dune-common_ROOT OR "${CMAKE_PREFIX_PATH}" MATCHES ".*dune-common.*"))
string(REPLACE ${CMAKE_PROJECT_NAME} dune-common dune-common_DIR ${PROJECT_BINARY_DIR})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment