mirror of https://github.com/ecmwf/eccodes.git
ECC-154: Install python module correctly
This commit is contained in:
parent
f431b22d6c
commit
d174d6a24b
|
@ -14,9 +14,10 @@ if( HAVE_PYTHON )
|
|||
#if( SWIG_FOUND AND PYTHONLIBS_FOUND )
|
||||
if( PYTHONLIBS_FOUND )
|
||||
|
||||
set(PYTHON_DEST "${INSTALL_LIB_DIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/eccodes" )
|
||||
set(PYTHON_DEST_ECCODES "${INSTALL_LIB_DIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/eccodes" )
|
||||
set(PYTHON_DEST_GRIBAPI "${INSTALL_LIB_DIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/gribapi" )
|
||||
|
||||
file( RELATIVE_PATH relative_rpath "${CMAKE_INSTALL_PREFIX}/${PYTHON_DEST}" "${${PNAME}_FULL_INSTALL_LIB_DIR}" )
|
||||
file( RELATIVE_PATH relative_rpath "${CMAKE_INSTALL_PREFIX}/${PYTHON_DEST_ECCODES}" "${${PNAME}_FULL_INSTALL_LIB_DIR}" )
|
||||
|
||||
# debug_var( relative_rpath )
|
||||
|
||||
|
@ -87,11 +88,14 @@ if( HAVE_PYTHON )
|
|||
add_custom_target(copy_swig_py ALL DEPENDS ${_swig_py})
|
||||
#######################
|
||||
|
||||
install(TARGETS _gribapi_swig DESTINATION ${PYTHON_DEST} )
|
||||
install(TARGETS _gribapi_swig DESTINATION ${PYTHON_DEST_GRIBAPI} )
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gribapi_swig.py DESTINATION ${PYTHON_DEST})
|
||||
install(FILES gribapi.py DESTINATION ${PYTHON_DEST})
|
||||
install(FILES eccodes.py DESTINATION ${PYTHON_DEST})
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gribapi_swig.py DESTINATION ${PYTHON_DEST_GRIBAPI})
|
||||
install(FILES gribapi.py DESTINATION ${PYTHON_DEST_GRIBAPI})
|
||||
install(FILES eccodes.py DESTINATION ${PYTHON_DEST_ECCODES})
|
||||
|
||||
install(FILES init_gribapi.py DESTINATION ${PYTHON_DEST_GRIBAPI} RENAME __init__.py)
|
||||
install(FILES init_eccodes.py DESTINATION ${PYTHON_DEST_ECCODES} RENAME __init__.py)
|
||||
|
||||
endif()
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
from .eccodes import *
|
||||
from .eccodes import __version__
|
|
@ -0,0 +1,2 @@
|
|||
from .gribapi import * # noqa
|
||||
from .gribapi import __version__
|
Loading…
Reference in New Issue