From: Jonathan S. <jjs...@us...> - 2006-12-29 03:25:03
|
Update of /cvsroot/octaviz/octaviz/Scripts In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7422 Modified Files: CMakeLists.txt vtkGetDataRoot.m Log Message: make vtk_data path configurable Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/octaviz/octaviz/Scripts/CMakeLists.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- CMakeLists.txt 21 Sep 2004 22:50:43 -0000 1.1.1.1 +++ CMakeLists.txt 29 Dec 2006 03:24:59 -0000 1.2 @@ -2,6 +2,10 @@ # Remove prefix from scripts install dir STRING(REGEX REPLACE "${CMAKE_INSTALL_PREFIX}" "" M_INST_DIR ${M_INST_DIR_EXEC}) +# Insert VTK_DATA_ROOT given to cmake into vtkGetDataRoot.m +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/vtkGetDataRoot.m + ${CMAKE_CURRENT_BINARY_DIR}/vtkGetDataRoot.m) + EXEC_PROGRAM("pwd" OUTPUT_VARIABLE CURRENT_DIR_EXEC) IF(CURRENT_DIR_EXEC MATCHES "Scripts") SET(CURR_DIR "") Index: vtkGetDataRoot.m =================================================================== RCS file: /cvsroot/octaviz/octaviz/Scripts/vtkGetDataRoot.m,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- vtkGetDataRoot.m 21 Apr 2005 17:04:22 -0000 1.2 +++ vtkGetDataRoot.m 29 Dec 2006 03:24:59 -0000 1.3 @@ -2,6 +2,38 @@ ## I guess this is a locally set variable; should put this in documents ## f = "/usr/share/vtkdata"; - f = "/usr/local/share/vtk/VTKData-release-4-4"; + + f = ""; + + ## The file that marks the vtkdata/ directory + readme = "VTKData.readme"; + + ## check for a possible environmental variable + env_data_root = getenv("VTK_DATA_ROOT"); + + ## set at Octaviz's compile time + oct_data_root = ""; + + ## locally set path + local_data_root = "/usr/share/vtkdata"; + + data_root_path = [ env_data_root; local_data_root; oct_data_root ]; + + ## check where we have the readme file + if (! isempty(data_root_path)) + for i=[1:rows(data_root_path)] + filename = [data_root_path(i, :), '/', readme]; + if (! isempty(stat(filename))) + f = data_root_path(i,:); + break; + endif + endfor + else + error("Empty search path for VTK_DATA_ROOT!"); + endif + + if (isempty(f)) + error([readme, " not found! \n\t Did you install the vtkdata package?"]); + endif endfunction |