Skip to content

Commit

Permalink
fypp: use find_program(fypp) first
Browse files Browse the repository at this point in the history
  • Loading branch information
awnawab authored and wdeconinck committed Feb 27, 2024
1 parent dbe353a commit daf91d7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,18 @@ endif()
set( FCKIT_LIBRARIES fckit )

################################################################################################
# find fypp

find_program(FYPP fypp)
if( FYPP )
ecbuild_info("fckit found fypp: ${FYPP}")
endif()

# sources

set( FYPP ${CMAKE_CURRENT_SOURCE_DIR}/tools/fckit-eval.sh ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/fckit-fypp.py )
if( NOT FYPP )
set( FYPP ${CMAKE_CURRENT_SOURCE_DIR}/tools/fckit-eval.sh ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/fckit-fypp.py )
endif()
set( FCTEST_GENERATOR ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/fctest-generate-runner.py )
include( fckit_preprocess_fypp )
include( add_fctest )
Expand All @@ -127,7 +136,9 @@ if( ECBUILD_INSTALL_FORTRAN_MODULES )
endif()
if( NOT PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
set( FCTEST_GENERATOR ${FCTEST_GENERATOR} PARENT_SCOPE )
set( FYPP ${FYPP} PARENT_SCOPE )
if( NOT FYPP )
set( FYPP ${FYPP} PARENT_SCOPE )
endif()
endif()
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/add_fctest.cmake ADD_FCTEST)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/fckit_preprocess_fypp.cmake FCKIT_PREPROCESS_FYPP )
Expand Down

0 comments on commit daf91d7

Please sign in to comment.