Implemented changes in the source code so as to be able to specify the
install dir of the documentation without relating that path to the
shared data path whatsoever.--- a/cmake/OpenMSBuildSystem_configh.cmake
+++ b/cmake/OpenMSBuildSystem_configh.cmake
@@ -8,6 +8,13 @@
 	set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX})
 endif()
 
+if ("${INSTALL_PREFIX}" STREQUAL ".")
+	set(CF_OPENMS_DOC_PATH ${PROJECT_SOURCE_DIR}/share/OpenMS CACHE INTERNAL "Path to the documentation of OpenMS.")
+	set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR})
+else()
+	set(CF_OPENMS_DOC_PATH "/usr/share/doc/openms-doc" CACHE INTERNAL "Path to the documentation of OpenMS.")
+	set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX})
+endif()
 
 
 set(CF_OPENMS_TEST_DATA_PATH ${PROJECT_SOURCE_DIR}/source/TEST/data/ CACHE INTERNAL "Path to the test data")
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -291,6 +291,11 @@
 include(cmake/OpenMSBuildSystem_testConfig.cmake)
 
 
+# At this point make a summary:
+
+message(STATUS "Info: CF_OPENMS_DATA_PATH: ${CF_OPENMS_DATA_PATH}")
+message(STATUS "Info: CF_OPENMS_DOC_PATH: ${CF_OPENMS_DOC_PATH}")
+
 
 ########################################################
 ###    Documentation                                 ###
--- a/include/OpenMS/SYSTEM/File.h
+++ b/include/OpenMS/SYSTEM/File.h
@@ -124,6 +124,9 @@
 			/// Returns the OpenMS data path (environment variable overwrites the default installation path)
 			static String getOpenMSDataPath();
 
+			/// Returns the OpenMS doc path (environment variable overwrites the default installation path)
+			static String getOpenMSDocPath();
+
       /// The current OpenMS temporary data path (for temporary files)
       static String getTempDirectory();
 
--- a/source/SYSTEM/File.C
+++ b/source/SYSTEM/File.C
@@ -300,6 +300,26 @@
 		return path;
   }
 
+  String File::getOpenMSDocPath()
+  {
+		String path;
+		if (getenv("OPENMS_DOC_PATH") != 0)
+		{
+			path = getenv("OPENMS_DOC_PATH");
+		}
+		else
+		{
+			path = OPENMS_DOC_PATH;
+		}
+		
+		if (!exists(path))
+		{ // now we're in big trouble as './share' is not were its supposed to be...
+			std::cerr << "OpenMS ERROR!\nExpected doc to be at '" << path << "'! OpenMS Help cannot function without it! To resolve this, set the environment variable 'OPENMS_DOC_PATH' to the OpenMS share directory.\n";
+    }
+		
+		return path;
+  }
+
 	String File::removeExtension(const OpenMS::String& file) 
 	{
 		if (!file.has('.')) return file;
--- a/include/OpenMS/config.h.in
+++ b/include/OpenMS/config.h.in
@@ -45,6 +45,9 @@
 // The path to the directory where OpenMS data is installed
 #define OPENMS_DATA_PATH "@CF_OPENMS_DATA_PATH@"
 
+// The path to the directory where OpenMS doc is installed
+#define OPENMS_DOC_PATH "@CF_OPENMS_DOC_PATH@"
+
 // The directory where OpenMS is build
 #define OPENMS_SOURCE_PATH "@PROJECT_SOURCE_DIR@"
 
--- a/source/VISUAL/APPLICATIONS/TOPPASBase.C
+++ b/source/VISUAL/APPLICATIONS/TOPPASBase.C
@@ -171,7 +171,7 @@
 		QAction* action = help->addAction("OpenMS website",this,SLOT(showURL()));
 		action->setData("http://www.OpenMS.de");
 		action = help->addAction("TOPPAS tutorial",this,SLOT(showURL()), Qt::Key_F1);
-    action->setData(String(File::getOpenMSDataPath() + "/../../doc/html/TOPPAS_tutorial.html").toQString());
+    action->setData(String(File::getOpenMSDocPath() + "/html/TOPPAS_tutorial.html").toQString());
 
 		help->addAction("&About",this,SLOT(showAboutDialog()));
 		
--- a/source/VISUAL/APPLICATIONS/TOPPViewBase.C
+++ b/source/VISUAL/APPLICATIONS/TOPPViewBase.C
@@ -280,7 +280,7 @@
           QAction* action = help->addAction("OpenMS website",this,SLOT(showURL()));
           action->setData("http://www.OpenMS.de");
           action = help->addAction("Tutorials and documentation",this,SLOT(showURL()), Qt::Key_F1);
-          action->setData(String(File::getOpenMSDataPath() + "/../../doc/html/index.html").toQString());
+          action->setData(String(File::getOpenMSDocPath() + "/html/index.html").toQString());
 
           help->addSeparator();
           help->addAction("&About",this,SLOT(showAboutDialog()));
