]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkConfigurationFile.cxx
re indent
[bbtk.git] / kernel / src / bbtkConfigurationFile.cxx
index 5731b70dcb5bacf40fe84ab85916515284d5f589..eaeca60440d756f923a2791230111a67359e8740 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkConfigurationFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/11/02 10:15:43 $
-  Version:   $Revision: 1.34 $
+  Date:      $Date: 2011/03/08 16:56:13 $
+  Version:   $Revision: 1.37 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
 #include "bbtkXML.h"
 #include "bbtkUtilities.h"
 
+#include "creaSystem.h"
+
 #if defined(WIN32)
 # include <direct.h> // for getcwd
 # include <windows.h>
 #endif
 
 
-
-
 namespace bbtk
 {
-
   //====================================================================
   /// Constructor
   ConfigurationFile::ConfigurationFile()
   {
-
-       mFile_separator = VALID_FILE_SEPARATOR;
+    mFile_separator = VALID_FILE_SEPARATOR;
 
     // ==> Set system paths
     mBin_path = Utilities::GetExecutablePath();
 
-
-
-
 /*     EED 23 Mars 2009
 #ifdef MACOSX
     mInstall_path = mBin_path + "/../../../..";
@@ -70,7 +65,6 @@ namespace bbtk
 #endif
 */
 #ifdef MACOSX
-
          std::string macPath("Contents/MacOS");
          int sbp = mBin_path.length();
          int smp = macPath.length();
@@ -78,12 +72,10 @@ namespace bbtk
          {
                  mBin_path = mBin_path + "/../../..";
          }
-
-
 #endif
-         mInstall_path = mBin_path + "/..";
-
 
+///\TODO : better use ??
+         mInstall_path = mBin_path + "/..";
 
     // The relative path to the doc folder (=BBTK_DOC_REL_PATH)
     //    mDoc_rel_path = BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH);
@@ -122,9 +114,6 @@ namespace bbtk
     bbtkMessage("config",1," ==> bbs    : '"<<mBbs_path<<"'"<<std::endl);
     bbtkMessage("config",1," ==> data   : '"<<mData_path<<"'"<<std::endl);
 
-
-
-
     // bbs_paths
     // always add "." (current working directory) at the begining
     mBbs_paths.push_back( "." );
@@ -155,6 +144,12 @@ namespace bbtk
     mPackage_paths.push_back(mBin_path);
     // add system lib path (for install tree)
     //EED    mPackage_paths.push_back(mInstall_path + mFile_separator + "lib");
+    
+    //mPackage_paths.push_back(mInstall_path + "/lib"); // JPR
+    //mPackage_paths.push_back(mInstall_path + "/lib64");// JPR
+    
+    ///\TODO : better use BBTK_PACKAGE_LIB_PATH  // JPR
+    
     mPackage_paths.push_back(mInstall_path + "/lib/creatools");
     mPackage_paths.push_back(mInstall_path + "/lib64/creatools");
 #ifdef WIN32
@@ -170,8 +165,6 @@ namespace bbtk
       Utilities::replace( mPackage_paths[iStrVec] , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
     }
 
-
-
     GetHelp(2);
 
     // ==> First we look for bbtk_config.xml in "."
@@ -248,7 +241,6 @@ namespace bbtk
                          + BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH) + "/";
                        Utilities::MakeValidFileName(doc_path);
 
-
                        std::ofstream f;
                        f.open(filename.c_str(), std::ios::out );
                        f << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD "
@@ -343,8 +335,9 @@ namespace bbtk
 
     // ------------------ create some usefull strings ----------------
     // installed bbtk_path
-    char bbtk_path[100];
-    strcpy(bbtk_path, "/usr/local/bin");
+    char bbtk_path[1000];
+    strcpy(bbtk_path, Utilities::GetExecutablePath().c_str());  // JPR
+    //strcpy(bbtk_path, "/usr/local/bin");
 
     // rootDirectory
     char rootDirectory[200];