Re: [vmtk-users] Missing INSTALL target in winx64 and python problems
Brought to you by:
davidsteinman,
lucantiga
From: Luca A. <luc...@gm...> - 2013-01-26 13:47:55
|
Hi Brian, I got sidetracked on this one, but I finally committed your changes to the repository. Now we generate a vmtk_startup.bat file on Windows and a vmtk_env.sh file on Unix (Mac and Linux). On Windows one can just double-click the file, while on Unix one goes source vmtk_env.sh or . vmtk_env.sh and the scripts are available at the command line. Thanks a lot for the contributions, it would be great if you could double check that everything works correctly on Windows. Luca PS: I'm launching pypepad from the .bat file now, while I saw you were starting idle. Maybe it would be good to generate two files, one for pypepad and one for idle? On Jan 7, 2013, at 10:01 PM, Brian Davis wrote: > 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 > vmt...@li... > https://lists.sourceforge.net/lists/listinfo/vmtk-users |