Skip to content
Snippets Groups Projects
Unverified Commit 8b3139ca authored by René Fritze's avatar René Fritze
Browse files

[cmake] add a 'license' target

which executes pylicense with all configs matching
"PROJECT_ROOT/.pylicense*.cfg"
parent 7b3d2e56
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,7 @@ endif()
add_format(${CMAKE_CURRENT_SOURCE_DIR})
add_tidy(${CMAKE_CURRENT_SOURCE_DIR})
add_pylicense()
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
......
......@@ -201,3 +201,18 @@ macro(make_dependent_modules_sys_included)
endif(${_mod}_INCLUDE_DIRS)
endforeach(_mod DEPENDENCIES)
endmacro(make_dependent_modules_sys_included)
macro(add_pylicense)
file(GLOB configs ${PROJECT_SOURCE_DIR}/.pylicense*.cfg )
foreach(cfg ${configs})
string(REGEX REPLACE ".*/([^/]*)" "\\1" cfg_target ${cfg})
string(REPLACE ${PROJECT_SOURCE_DIR} "" cfg_target ${cfg_target})
string(REGEX REPLACE "(.*)/[^/]*" "\\1" cfg_target ${cfg_target})
string(REGEX REPLACE "/" "_" cfg_target ${cfg_target})
list(APPEND cfg_targets ${cfg_target})
add_custom_target(${cfg_target} ${CMAKE_BINARY_DIR}/dune-env pylicense
"--cfg=${cfg}" "${PROJECT_SOURCE_DIR}"
VERBATIM USES_TERMINAL)
endforeach(cfg ${configs})
add_custom_target(license DEPENDS ${cfg_targets})
endmacro(add_pylicense)
......@@ -21,7 +21,7 @@ setup(name='dune.xt.common',
author_email='dune-xt-dev@listserv.uni-muenster.de',
url='https://github.com/dune-community/dune-xt-common',
packages=['dune.xt'],
install_requires=['binpacking==1.3', 'cython', 'jinja2', 'docopt'],
install_requires=['binpacking==1.3', 'cython', 'jinja2', 'docopt', 'pylicense3'],
scripts=['./scripts/generate_compare_functions.py',
'./scripts/distribute_testing.py',
'./scripts/dxt_code_generation.py',
......
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