Skip to content

Commit

Permalink
FYPP: make fypp install/export optional
Browse files Browse the repository at this point in the history
  • Loading branch information
awnawab authored and wdeconinck committed Feb 23, 2024
1 parent a92be06 commit 54feb73
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 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,14 +136,18 @@ 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 )

set( install_permissions OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE )
install( FILES tools/fctest-generate-runner.py DESTINATION libexec PERMISSIONS ${install_permissions} )
install( FILES tools/fckit-eval.sh DESTINATION libexec PERMISSIONS ${install_permissions} )
install( FILES contrib/fypp-3.0-7895a7e-20200112/bin/fypp DESTINATION libexec RENAME fckit-fypp.py PERMISSIONS ${install_permissions} )
if( NOT FYPP )
install( FILES contrib/fypp-3.0-7895a7e-20200112/bin/fypp DESTINATION libexec RENAME fckit-fypp.py PERMISSIONS ${install_permissions} )
endif()

ecbuild_install_project( NAME fckit )

0 comments on commit 54feb73

Please sign in to comment.