Skip to content
Snippets Groups Projects
Commit a75c34aa authored by Frederik Hennig's avatar Frederik Hennig
Browse files

Add CMakeLists.txt at project root; find SFG, specify interface target and include dirs there.

parent 525954b2
No related merge requests found
SET ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
find_package( PystencilsSfg REQUIRED )
add_subdirectory( include )
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()
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
add_library( sfg_walberla INTERFACE ) add_library( sfg_walberla INTERFACE )
target_sources( sfg_walberla 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( target_link_libraries(
sfg_walberla sfg_walberla
INTERFACE INTERFACE
......
...@@ -124,5 +124,3 @@ void GenericHbbBoundary< Stencil_T >::fillFromFlagField(IBlock& block, ConstBloc ...@@ -124,5 +124,3 @@ void GenericHbbBoundary< Stencil_T >::fillFromFlagField(IBlock& block, ConstBloc
} // namespace sfg } // namespace sfg
} // namespace walberla } // namespace walberla
#include "GenericHbbBoundary.ipp"
#pragma once
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