Commit 43accd00 authored by Martin Bauer's avatar Martin Bauer

CMake waLBerla_python_file_generates: no need to add header files any more

parent d4cfddab
......@@ -263,13 +263,20 @@ endfunction ( waLBerla_add_executable )
# Function to tell CMake which C/C++/CUDA files are generated by a python file
#
# Example:
# waLBerla_python_file_generates(MyPythonCodeGenScript.py Sweep1.cpp Sweep1.h Sweep2.h Sweep2.cu)
# waLBerla_python_file_generates(MyPythonCodeGenScript.py Sweep1.cpp Sweep2.cu)
#
#
#######################################################################################################################
function( waLBerla_python_file_generates pythonFile )
set(generatedFiles "")
foreach(element ${ARGN})
string(REGEX REPLACE "\\.[^.]*$" "" elementWithoutExtension ${element})
list(APPEND generatedFiles ${element})
list(APPEND generatedFiles "${elementWithoutExtension}.h")
endforeach()
list(REMOVE_DUPLICATES generatedFiles)
get_filename_component(pythonFileAbsolutePath ${pythonFile} ABSOLUTE)
set( "WALBERLA_CODEGEN_INFO_${pythonFileAbsolutePath}" ${ARGN}
set( "WALBERLA_CODEGEN_INFO_${pythonFileAbsolutePath}" ${generatedFiles}
CACHE INTERNAL "Files generated by python script ${pythonFile}" FORCE)
endfunction(waLBerla_python_file_generates)
......
......@@ -38,8 +38,5 @@ waLBerla_compile_test( FILES CudaMPI DEPENDS blockforest timeloop gui )
waLBerla_compile_test( FILES AlignmentTest.cpp DEPENDS blockforest timeloop )
waLBerla_python_file_generates(codegen/MicroBenchmarkGpuLbm.py
MicroBenchmarkStreamKernel.cu MicroBenchmarkStreamKernel.h
MicroBenchmarkCopyKernel.cu MicroBenchmarkCopyKernel.h)
waLBerla_python_file_generates(codegen/MicroBenchmarkGpuLbm.py MicroBenchmarkStreamKernel.cu MicroBenchmarkCopyKernel.cu)
waLBerla_compile_test( FILES codegen/MicroBenchmarkGpuLbm.cpp codegen/MicroBenchmarkGpuLbm.py)
......@@ -60,11 +60,8 @@ endif( WALBERLA_BUILD_WITH_MPI )
# CodeGen Tests
waLBerla_python_file_generates(codegen/JacobiKernel.py
JacobiKernel2D.cpp JacobiKernel2D.h
JacobiKernel3D.cpp JacobiKernel3D.h)
waLBerla_compile_test( FILES codegen/CodegenJacobiCPU.cpp codegen/JacobiKernel.py
DEPENDS gui timeloop )
waLBerla_python_file_generates(codegen/JacobiKernel.py JacobiKernel2D.cpp JacobiKernel3D.cpp )
waLBerla_compile_test( FILES codegen/CodegenJacobiCPU.cpp codegen/JacobiKernel.py DEPENDS gui timeloop )
waLBerla_execute_test( NAME CodegenJacobiCPU )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment