forked from SCIInstitute/ShapeWorks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add devenv scripts; remove unnecessary stuff from shapeworks python m…
…odule
- Loading branch information
Showing
7 changed files
with
70 additions
and
77 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
rem | ||
rem Configures developer environment such that: | ||
rem - PATH and PYTHONPATH point to $BUILD/bin | ||
rem - PYTHONPATH points to each module in $SOURCE/Python | ||
rem | ||
rem Example when build directory is inside source: | ||
rem (shapeworks) ~/code/ShapeWorks$ source ./devenv.sh `pwd` `pwd`/build_debug | ||
rem | ||
rem After sourcing this, processes in the environment will use executables from | ||
rem the given build and import modules from the developer's source (including the | ||
rem compiled portion of the Python bindings). | ||
rem | ||
|
||
set argC=0 | ||
for %%x in (%*) do Set /A argC+=1 | ||
echo %argC% | ||
|
||
if not %argC%==2 ( | ||
echo Must call using "devenv SOURCE_DIR BUILD_DIR" | ||
goto :eof | ||
) | ||
|
||
set SOURCE=%~1 | ||
set BUILD=%~2 | ||
echo source: %SOURCE% | ||
echo build: %BUILD% | ||
|
||
set PATH=%BUILD%\bin;%PATH% | ||
set PYTHONPATH=%BUILD%\bin;%PYTHONPATH% | ||
|
||
rem add each module in ${SOURCE}/Python to the PYTHONPATH | ||
for /d %%D in ("%SOURCE%\Python\*") DO for /d %%M in ("%%D\*") DO call set PYTHONPATH=%%M;%%PYTHONPATH%% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# | ||
# Configures developer environment such that: | ||
# - PATH and PYTHONPATH point to $BUILD/bin | ||
# - PYTHONPATH points to each module in $SOURCE/Python | ||
# | ||
# Example when build directory is inside source: | ||
# (shapeworks) ~/code/ShapeWorks$ source ./devenv.sh `pwd` `pwd`/build_debug | ||
# | ||
# After sourcing this, processes in the environment will use executables from | ||
# the given build and import modules from the developer's source (including the | ||
# compiled portion of the Python bindings). | ||
# | ||
|
||
(return 0 2>/dev/null) && sourced=1 || sourced=0 | ||
|
||
if [[ "$sourced" == "0" ]]; then | ||
echo "ERROR: must call this script using \"source ./devenv.sh <source_dir> <build_dir>\"" | ||
exit 1 | ||
fi | ||
|
||
if [[ "$#" -ne 2 ]]; then | ||
echo "ERROR: must pass both SOURCE_DIR and BUILD_DIR" | ||
exit 1 | ||
fi | ||
|
||
SOURCE=$1 | ||
BUILD=$2 | ||
|
||
export PATH=${BUILD}/bin:$PATH | ||
export PYTHONPATH=${BUILD}/bin:$PYTHONPATH | ||
|
||
# add each module in ${SOURCE}/Python to the PYTHONPATH | ||
for M in ${SOURCE}/Python/*/; do | ||
export PYTHONPATH=${M}:$PYTHONPATH | ||
done |