See comments to your comments below

> In reference to:
>
> >>>
>
> To do so, position yourself in the Install directory and create a file
> named, e.g. vmtk-startup.bat
> (the important part is the .bat extension) containing the following code:
>
> rem @echo off
> set VMTK_DIR=%~dp0
> set
> PATH=%VMTK_DIR%bin;%VMTK_DIR%lib\InsightToolkit;%VMTK_DIR%lib\Python;%PATH%
> set
> PYTHONPATH=%VMTK_DIR%lib\site-packages;%VMTK_DIR%lib\vtk-5.10;%VMTK_DIR%lib\vmtk
> cd %VMTK_DIR%
> python bin\vmtk-exe.py
>  <<<
>
> Sounds like some good stuff to put into a run_vmtk_python.txt file in the
> release of VMTK and run configure_file on,  this way people can get started
> with out having to create their own script (and burn time trying to figure
> out which paths and env vars vmtk needs to do it's magic) as I did in my
> source tree to do just this.
>
>
> Good point. Can you make a test before I do this?
> Can you please remove the two lines setting the environment variables (set
> PATH ... and set PYTHONPATH) and run the .bat file again?
> In theory the python launcher should set the environment variables
> automatically already, but let's see if this works on your system.
>
> I modified vmtk slightly by adding:

run_vmtk_python.txt - located with vmtk root path with CMakeLists.txt
>>

echo "python path is %PYTHONPATH%"

set PYTHON_VERSION=${PYTHON_MIN_MINOR}
set VTK_VERSION=${VTK_VERSION}
set PYTHON_ROOT_DIR=${PYTHON_ROOT_DIR_NATIVE}

set VMTKHOME=${VMTK_INSTALL_DIR_NATIVE}
set PATH=%VMTKHOME%\bin:%PATH%
set
DYLD_LIBRARY_PATH=%VMTKHOME%\lib\vtk-%VTK_VERSION%;%VMTKHOME%\lib\vmtk;%VMTKHOME%\lib\vmtk\vmtk;%DYLD_LIBRARY_PATH%
set
PYTHONPATH=%VMTKHOME%\bin;%VMTKHOME%\bin\Python;%VMTKHOME%\lib\vtk-%VTK_VERSION%;%VMTKHOME%\lib\vmtk;%VMTKHOME%\lib\vmtk\vmtk;%PYTHONPATH%
set PATH=%VMTKHOME%\bin;%DYLD_LIBRARY_PATH%;%PATH%


start "IDLE" ${PYTHON_ROOT_DIR}Lib\idlelib\idle.bat

<<

And modifying

SuperBuild.cmake by adding the following text to the end of the file

>>>
FIND_PACKAGE( PYTHONINTERP )
FIND_PACKAGE( PYTHONLIBS )


set( PYTHON_MAJORMINOR ${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} )

SET( VTK_VERSION 5.10 )

set( VMTK_INSTALL_DIR ${CMAKE_BINARY_DIR}/Install )
file( TO_NATIVE_PATH ${VMTK_INSTALL_DIR} VMTK_INSTALL_DIR_NATIVE )





message( STATUS ${PYTHON_LIBRARIES} )
message( STATUS ${PYTHON_LIBRARIES} )
message( STATUS ${PYTHON_MAJORMINOR} )
message( STATUS ${PYTHONLIBS_VERSION_STRING} )
message( STATUS ${PYTHON_LIBRARY} )

#find_path( PYTHON_ROOT_DIR  ${PYTHON_EXECUTABLE} )
#MESSAGE( STATUS ${PYTHON_ROOT_DIR} )


string( REGEX MATCH "[0-9][0-9]" PYTHON_MIN_MINOR ${PYTHON_EXECUTABLE}  )
string( REGEX MATCH "(.*[/])*" PYTHON_ROOT_DIR ${PYTHON_EXECUTABLE}  )
file( TO_NATIVE_PATH ${PYTHON_ROOT_DIR} PYTHON_ROOT_DIR_NATIVE )


message( STATUS ${PYTHON_MIN_MINOR} )

message( STATUS ${PYTHON_ROOT_DIR} )

configure_file( run_vmtk_python.txt ${VMTK_INSTALL_DIR}/run_vmtk_python.bat
)

<<<


FindPython does not seem to give back the variables I was expecting hence
the string regex call.  Anyway this worked for me.  Be sure to use
TO_NATIVE path when building .bat file not needed when creating sh or bash
scripts.

B
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
vmtk-users mailing list
vmtk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vmtk-users

Reply via email to