Skip to content
Snippets Groups Projects
Commit 43accd00 authored by Martin Bauer's avatar Martin Bauer
Browse files

CMake waLBerla_python_file_generates: no need to add header files any more

parent d4cfddab
Branches
Tags
No related merge requests found
...@@ -263,13 +263,20 @@ endfunction ( waLBerla_add_executable ) ...@@ -263,13 +263,20 @@ endfunction ( waLBerla_add_executable )
# Function to tell CMake which C/C++/CUDA files are generated by a python file # Function to tell CMake which C/C++/CUDA files are generated by a python file
# #
# Example: # 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 ) 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) 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) CACHE INTERNAL "Files generated by python script ${pythonFile}" FORCE)
endfunction(waLBerla_python_file_generates) endfunction(waLBerla_python_file_generates)
......
...@@ -38,8 +38,5 @@ waLBerla_compile_test( FILES CudaMPI DEPENDS blockforest timeloop gui ) ...@@ -38,8 +38,5 @@ waLBerla_compile_test( FILES CudaMPI DEPENDS blockforest timeloop gui )
waLBerla_compile_test( FILES AlignmentTest.cpp DEPENDS blockforest timeloop ) waLBerla_compile_test( FILES AlignmentTest.cpp DEPENDS blockforest timeloop )
waLBerla_python_file_generates(codegen/MicroBenchmarkGpuLbm.py MicroBenchmarkStreamKernel.cu MicroBenchmarkCopyKernel.cu)
waLBerla_python_file_generates(codegen/MicroBenchmarkGpuLbm.py
MicroBenchmarkStreamKernel.cu MicroBenchmarkStreamKernel.h
MicroBenchmarkCopyKernel.cu MicroBenchmarkCopyKernel.h)
waLBerla_compile_test( FILES codegen/MicroBenchmarkGpuLbm.cpp codegen/MicroBenchmarkGpuLbm.py) waLBerla_compile_test( FILES codegen/MicroBenchmarkGpuLbm.cpp codegen/MicroBenchmarkGpuLbm.py)
...@@ -60,11 +60,8 @@ endif( WALBERLA_BUILD_WITH_MPI ) ...@@ -60,11 +60,8 @@ endif( WALBERLA_BUILD_WITH_MPI )
# CodeGen Tests # CodeGen Tests
waLBerla_python_file_generates(codegen/JacobiKernel.py waLBerla_python_file_generates(codegen/JacobiKernel.py JacobiKernel2D.cpp JacobiKernel3D.cpp )
JacobiKernel2D.cpp JacobiKernel2D.h waLBerla_compile_test( FILES codegen/CodegenJacobiCPU.cpp codegen/JacobiKernel.py DEPENDS gui timeloop )
JacobiKernel3D.cpp JacobiKernel3D.h)
waLBerla_compile_test( FILES codegen/CodegenJacobiCPU.cpp codegen/JacobiKernel.py
DEPENDS gui timeloop )
waLBerla_execute_test( NAME CodegenJacobiCPU ) waLBerla_execute_test( NAME CodegenJacobiCPU )
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