Skip to content

Commit

Permalink
FYPP: optionally use fypp exported by fckit
Browse files Browse the repository at this point in the history
  • Loading branch information
awnawab committed May 8, 2024
1 parent 41bfa99 commit ab10679
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ set(LIBNAME field_api)
ecbuild_find_package(OpenMP COMPONENTS Fortran REQUIRED)

## find fypp
find_program(FYPP fypp HINTS ${fypp_ROOT})
if( NOT FYPP)
ecbuild_find_package( fckit )
find_program( FYPP fypp )

if( fckit_FOUND )
set( FYPP ${FCKIT_VENV_EXE} -m fypp )
elseif( NOT fypp_FOUND )
include(cmake/field_api_fetchcontent_fypp.cmake)
set(FYPP ${fypp_SOURCE_DIR}/bin/fypp)
set(fypp_ROOT ${fypp_SOURCE_DIR}/bin PARENT_SCOPE)
ecbuild_info("fypp downloaded to: ${FYPP}")
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/field_api_fetchcontent_fypp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ FetchContent_Declare(
GIT_REPOSITORY https://github.com/aradi/fypp
GIT_TAG 3.1
)
FetchContent_Populate(fypp)

FetchContent_MakeAvailable(fypp)

0 comments on commit ab10679

Please sign in to comment.