diff --git a/mrv2/bin/python.sh.in b/mrv2/bin/python.sh.in new file mode 100644 index 000000000..0beaa3313 --- /dev/null +++ b/mrv2/bin/python.sh.in @@ -0,0 +1,38 @@ +#!/bin/bash + +if [[ $BASH_SOURCE != $0 ]]; then + dir=$BASH_SOURCE +else + dir=$0 +fi + + +symlink=`readlink ${dir}` + +if [ "$symlink" != "" ]; then + dir="$symlink" + dir=${dir%/*} +else +# Find directory where mrv2 bash script resides + dir=${dir%/*} +fi + +# If running from current directory, get full path +if [ "$dir" == '.' ]; then + dir=$PWD +fi + +source "$dir/environment.sh" + +params="" + +for param in "$@" +do + params="${params} \"${param}\"" +done + + +# +# Start up python +# +sh -c "${dir}/bin/python@MRV2_PYTHON_VERSION@ $params" diff --git a/mrv2/src/CMakeLists.txt b/mrv2/src/CMakeLists.txt index 84679af4e..216c16654 100644 --- a/mrv2/src/CMakeLists.txt +++ b/mrv2/src/CMakeLists.txt @@ -104,6 +104,10 @@ if ( APPLE ) install( FILES ${CMAKE_INSTALL_PREFIX}/bin/python${MRV2_PYTHON_VERSION} DESTINATION bin/ + PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE COMPONENT applications ) endif() @@ -119,6 +123,10 @@ elseif ( UNIX ) install( FILES ${CMAKE_INSTALL_PREFIX}/bin/python${MRV2_PYTHON_VERSION} DESTINATION bin/ + PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE COMPONENT applications ) endif() @@ -180,9 +188,14 @@ if ( NOT WIN32 ) configure_file(${CMAKE_SOURCE_DIR}/bin/environment.sh.in ${CMAKE_INSTALL_PREFIX}/bin/environment.sh @ONLY) + # Configure python.sh with python path + configure_file(${CMAKE_SOURCE_DIR}/bin/python.sh.in + ${CMAKE_INSTALL_PREFIX}/bin/python.sh @ONLY) + install( FILES ${CMAKE_SOURCE_DIR}/bin/mrv2.sh ${CMAKE_INSTALL_PREFIX}/bin/environment.sh + ${CMAKE_INSTALL_PREFIX}/bin/python.sh DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE