if (USE_F2PY)
if (precision STREQUAL "r4")
find_package(F2PY2)
if (F2PY2_FOUND)
esma_add_f2py2_module(GFIO_ SOURCES GFIO_py.F90
DESTINATION lib/Python2
ONLY gfioopen gfiocreate gfiodiminquire gfioinquire
gfiogetvar gfiogetvart gfioputvar gfiogetbegdatetime
gfiointerpxy gfiointerpnn gfiocoordnn gfioclose
)
add_dependencies(GFIO_ ${this})
endif ()
endif()
endif ()
This moves the USE_F2PY up to each call for f2py as well as the need for a find_package call as well.
Also note that in the PR, esma_add_f2pyX_module() was updated so that it will actually run python -c 'import module' after building the module. This will only work for "simple" f2py modules that don't need other bits of GEOS (aka MAPL)
This PR essentially adds Python2 and Python3 versions of all the f2py and other Python bits in ESMA_cmake.
Note that this will require changes for anything that uses the macros. For example, before with, say, GFIO we had:
Now one would do:
This moves the
USE_F2PY
up to each call for f2py as well as the need for afind_package
call as well.Also note that in the PR,
esma_add_f2pyX_module()
was updated so that it will actually runpython -c 'import module'
after building the module. This will only work for "simple" f2py modules that don't need other bits of GEOS (aka MAPL)