diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..a60fac1f827e21d999cba013b7533ed073351cac --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,5 @@ + +SET ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ) +find_package( PystencilsSfg REQUIRED ) + +add_subdirectory( include ) diff --git a/cmake/FindPystencilsSfg.cmake b/cmake/FindPystencilsSfg.cmake new file mode 100644 index 0000000000000000000000000000000000000000..a5e7b11d09ddb55da6802291a28be77d6a44f4f6 --- /dev/null +++ b/cmake/FindPystencilsSfg.cmake @@ -0,0 +1,31 @@ +set( PystencilsSfg_FOUND OFF CACHE BOOL "pystencils source file generator found" ) + +mark_as_advanced( PystencilsSfg_FOUND ) + +find_package( Python COMPONENTS Interpreter REQUIRED ) + +# Try to find pystencils-sfg in the python environment + +execute_process(COMMAND ${Python_EXECUTABLE} -m pystencilssfg version --no-newline + RESULT_VARIABLE _PystencilsSfgFindResult OUTPUT_VARIABLE PystencilsSfg_VERSION ) + +if(${_PystencilsSfgFindResult} EQUAL 0) + set( PystencilsSfg_FOUND ON ) +endif() + +if(DEFINED PystencilsSfg_FIND_REQUIRED) + if(NOT ${PystencilsSfg_FOUND}) + message( FATAL_ERROR "Could not find pystencils-sfg in current Python environment." ) + endif() +endif() + +if(${PystencilsSfg_FOUND}) + message( STATUS "Found pystencils Source File Generator (Version ${PystencilsSfg_VERSION})") + + execute_process(COMMAND ${Python_EXECUTABLE} -m pystencilssfg cmake modulepath --no-newline + OUTPUT_VARIABLE _PystencilsSfg_CMAKE_MODULE_PATH) + + set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${_PystencilsSfg_CMAKE_MODULE_PATH}) + include( PystencilsSfg ) +endif() + diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index b7a88800c4dd94976b20f5c50870a2c1b2fb8f31..411190808a5a13f689f554c688057bced8baf089 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -2,9 +2,11 @@ add_library( sfg_walberla INTERFACE ) target_sources( sfg_walberla - INTERFACE GenericHbbBoundary.hpp GenericHbbBoundary.ipp + INTERFACE GenericHbbBoundary.hpp ) +target_include_directories( sfg_walberla INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) + target_link_libraries( sfg_walberla INTERFACE diff --git a/include/GenericHbbBoundary.hpp b/include/GenericHbbBoundary.hpp index cf9e954ab824fdd29404ecb3c05f7b983a1a5159..f68d5e12cbd304db15203ff9acc3ad878d5eeca3 100644 --- a/include/GenericHbbBoundary.hpp +++ b/include/GenericHbbBoundary.hpp @@ -124,5 +124,3 @@ void GenericHbbBoundary< Stencil_T >::fillFromFlagField(IBlock& block, ConstBloc } // namespace sfg } // namespace walberla - -#include "GenericHbbBoundary.ipp" diff --git a/include/GenericHbbBoundary.ipp b/include/GenericHbbBoundary.ipp deleted file mode 100644 index 6f70f09beec2219624baeca92e2cd7deaa104fb4..0000000000000000000000000000000000000000 --- a/include/GenericHbbBoundary.ipp +++ /dev/null @@ -1 +0,0 @@ -#pragma once