Add generation of a setup-package.sh script for creating PyPI-packages

This commit is contained in:
Gaute Lindkvist
2020-06-16 13:06:10 +02:00
parent 9ed75f030b
commit cbd23e71ef
2 changed files with 25 additions and 0 deletions

View File

@@ -358,6 +358,11 @@ if (OPM_ENABLE_PYTHON)
DESTINATION ${PROJECT_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
configure_file(python/setup-package.sh.in tmp/setup-package.sh)
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-package.sh
DESTINATION ${PROJECT_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
configure_file(python/setup-test.sh.in tmp/setup-test.sh)
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-test.sh
DESTINATION ${PROJECT_BINARY_DIR}

View File

@@ -0,0 +1,20 @@
#!/bin/bash
# This cmake template file can be used to create a small shell script which can
# be used to generate a
# script setup-build.sh from this templated file - that script can be used to
# run the python setup.py process without going through cmake.
#
# The script in question is purely a convenience for Python development, it is
# fully optional to use it, and it is not used by the main cmake based build
# system.
cp -r @PROJECT_SOURCE_DIR@/python @PROJECT_BINARY_DIR@
cd @PROJECT_BINARY_DIR@/python
rm -rf opm/libopmcommon_python*
export CC=@CMAKE_CXX_COMPILER@
@PYTHON_EXECUTABLE@ setup.py sdist bdist_wheel build_ext \
--library-dirs=@_setup_lib_dirs@ \
@_rpath_arg@ \
--include-dirs=@_setup_include_dirs@