From f00719c68964c9e27466da7df8637efe20f9367a Mon Sep 17 00:00:00 2001
From: Riccardo Maria Bianchi <riccardo.maria.bianchi@cern.ch>
Date: Wed, 25 May 2016 11:57:48 +0200
Subject: [PATCH] removing dependency on libSM (x Window) which prevents
 compilation on Grid worker nodes, for ATLAS@Home. Details:
 https://its.cern.ch/jira/browse/ATLASVPONE-318 (VP1HEPVis-00-06-17)

2016-05-25  Riccardo Maria BIANCHI <Riccardo.Maria.Bianchi@cern.ch>
    * removing dependency on libSM (x Window)
	  which prevents compilation on Grid worker nodes,
	  for ATLAS@Home.
	  Details: https://its.cern.ch/jira/browse/ATLASVPONE-318
    * new tag: VP1HEPVis-00-06-17

2016-02-17 Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
	* Updated the package to build correctly with CMake.
	* Removed the executable flag from the source files.
	* Deleted the empty directories.
	* Added some includes that are needed when building the library
	  in unoptimised mode with CMake.
	* Tagging as VP1HEPVis-00-06-16
---
 graphics/VP1/VP1HEPVis/CMakeLists.txt         | 19 +++++++++++++++++++
 graphics/VP1/VP1HEPVis/VP1HEPVis/SbPlane.h    |  3 +++
 .../VP1/VP1HEPVis/VP1HEPVis/SbPolyhedron.h    |  1 +
 graphics/VP1/VP1HEPVis/VP1HEPVis/SbRotation.h |  3 +++
 .../VP1HEPVis/actions/SoGL2PSAction.h         |  1 +
 .../VP1/VP1HEPVis/VP1HEPVis/nodes/SoCons.h    |  1 +
 .../VP1HEPVis/VP1HEPVis/nodes/SoGenericBox.h  |  1 +
 .../VP1/VP1HEPVis/VP1HEPVis/nodes/SoLAr.h     |  1 +
 .../VP1/VP1HEPVis/VP1HEPVis/nodes/SoPcons.h   |  1 +
 .../VP1HEPVis/VP1HEPVis/nodes/SoPolyhedron.h  |  1 +
 .../VP1HEPVis/VP1HEPVis/nodes/SoTessellated.h |  1 +
 .../VP1HEPVis/nodes/SoTransparency.h          |  1 +
 .../VP1/VP1HEPVis/VP1HEPVis/nodes/SoTubs.h    |  1 +
 graphics/VP1/VP1HEPVis/cmt/requirements       |  6 +++++-
 graphics/VP1/VP1HEPVis/src/BooleanProcessor.h |  0
 .../VP1HEPVis/src/BooleanProcessor.h.original |  0
 .../VP1/VP1HEPVis/src/PolygonTriangulator.cxx |  0
 .../VP1/VP1HEPVis/src/PolygonTriangulator.h   |  0
 graphics/VP1/VP1HEPVis/src/SbMath.h           |  0
 graphics/VP1/VP1HEPVis/src/SbPolyhedron.cxx   |  0
 .../VP1/VP1HEPVis/src/SbStringHelpers.cxx     |  2 ++
 graphics/VP1/VP1HEPVis/src/SbStringHelpers.h  |  0
 graphics/VP1/VP1HEPVis/src/SoCons.cxx         |  0
 graphics/VP1/VP1HEPVis/src/SoLAr.cxx          |  0
 graphics/VP1/VP1HEPVis/src/SoPcons.cxx        |  0
 graphics/VP1/VP1HEPVis/src/SoPolyhedron.cxx   |  0
 graphics/VP1/VP1HEPVis/src/SoTubs.cxx         |  0
 graphics/VP1/VP1HEPVis/src/VP1HEPVisUtils.cxx |  1 +
 28 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 graphics/VP1/VP1HEPVis/CMakeLists.txt
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/VP1HEPVis/SbPolyhedron.h
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoCons.h
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoLAr.h
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoPcons.h
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoPolyhedron.h
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoTubs.h
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/cmt/requirements
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/src/BooleanProcessor.h
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/src/BooleanProcessor.h.original
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/src/PolygonTriangulator.cxx
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/src/PolygonTriangulator.h
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/src/SbMath.h
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/src/SbPolyhedron.cxx
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/src/SbStringHelpers.h
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/src/SoCons.cxx
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/src/SoLAr.cxx
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/src/SoPcons.cxx
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/src/SoPolyhedron.cxx
 mode change 100755 => 100644 graphics/VP1/VP1HEPVis/src/SoTubs.cxx

diff --git a/graphics/VP1/VP1HEPVis/CMakeLists.txt b/graphics/VP1/VP1HEPVis/CMakeLists.txt
new file mode 100644
index 000000000000..2e97b0b531b1
--- /dev/null
+++ b/graphics/VP1/VP1HEPVis/CMakeLists.txt
@@ -0,0 +1,19 @@
+################################################################################
+# Package: VP1HEPVis
+################################################################################
+# Author: Joe Boudreau (Importer)
+# Author: Riccardo Maria BIANCHI <rbianchi@cern.ch>
+################################################################################
+
+
+# Declare the package name:
+atlas_subdir( VP1HEPVis )
+
+# External dependencies:
+find_package( Coin3D )
+
+# Component(s) in the package:
+atlas_add_library( VP1HEPVis src/*.cxx
+   PUBLIC_HEADERS VP1HEPVis
+   INCLUDE_DIRS ${COIN3D_INCLUDE_DIRS}
+   LINK_LIBRARIES ${COIN3D_LIBRARIES} )
diff --git a/graphics/VP1/VP1HEPVis/VP1HEPVis/SbPlane.h b/graphics/VP1/VP1HEPVis/VP1HEPVis/SbPlane.h
index 032d8192425e..570ed9d208ff 100644
--- a/graphics/VP1/VP1HEPVis/VP1HEPVis/SbPlane.h
+++ b/graphics/VP1/VP1HEPVis/VP1HEPVis/SbPlane.h
@@ -1,3 +1,5 @@
+// Dear emacs, this is -*- c++ -*-
+
 /*
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
@@ -30,6 +32,7 @@
  * Used by the BooleanProcessor.
  */
 
+#include <Inventor/C/errors/debugerror.h>
 #include <Inventor/SbVec3d.h>
 
 namespace HEPVis {
diff --git a/graphics/VP1/VP1HEPVis/VP1HEPVis/SbPolyhedron.h b/graphics/VP1/VP1HEPVis/VP1HEPVis/SbPolyhedron.h
old mode 100755
new mode 100644
index 5bdee227c4e7..94472e5034da
--- a/graphics/VP1/VP1HEPVis/VP1HEPVis/SbPolyhedron.h
+++ b/graphics/VP1/VP1HEPVis/VP1HEPVis/SbPolyhedron.h
@@ -165,6 +165,7 @@
 // - added a new GetVertexFast(), from Guy Barrand.
 //
 
+#include <Inventor/C/errors/debugerror.h>
 #include <Inventor/SbLinear.h>
 
 
diff --git a/graphics/VP1/VP1HEPVis/VP1HEPVis/SbRotation.h b/graphics/VP1/VP1HEPVis/VP1HEPVis/SbRotation.h
index 0482d759c8c2..e8747bab698e 100644
--- a/graphics/VP1/VP1HEPVis/VP1HEPVis/SbRotation.h
+++ b/graphics/VP1/VP1HEPVis/VP1HEPVis/SbRotation.h
@@ -1,3 +1,5 @@
+// Dear emacs, this is -*- c++ -*-
+
 /*
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
@@ -23,6 +25,7 @@
 // Code taken from CoinGL/SbRotation but by using doubles instead of floats.
 // It is used by SbPolyhedron::Transform.
 
+#include <Inventor/C/errors/debugerror.h>
 #include <Inventor/SbVec4d.h>
 
 class SbVec3d;
diff --git a/graphics/VP1/VP1HEPVis/VP1HEPVis/actions/SoGL2PSAction.h b/graphics/VP1/VP1HEPVis/VP1HEPVis/actions/SoGL2PSAction.h
index 6b527edfacb8..0775abb8f35c 100644
--- a/graphics/VP1/VP1HEPVis/VP1HEPVis/actions/SoGL2PSAction.h
+++ b/graphics/VP1/VP1HEPVis/VP1HEPVis/actions/SoGL2PSAction.h
@@ -5,6 +5,7 @@
 #ifndef HEPVis_SoGL2PSAction_h
 #define HEPVis_SoGL2PSAction_h 
 
+#include <Inventor/C/errors/debugerror.h>
 #include <Inventor/actions/SoGLRenderAction.h>
 
 /**
diff --git a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoCons.h b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoCons.h
old mode 100755
new mode 100644
index ed8ae7215020..a5145a83af0e
--- a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoCons.h
+++ b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoCons.h
@@ -12,6 +12,7 @@
 #ifndef HEPVis_SoCons_h
 #define HEPVis_SoCons_h
 
+#include <Inventor/C/errors/debugerror.h>
 #include <Inventor/fields/SoSFFloat.h>
 #include <Inventor/fields/SoSFInt32.h>
 #include <Inventor/fields/SoSFNode.h>
diff --git a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoGenericBox.h b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoGenericBox.h
index 3932844f7f63..cd48549dea9f 100644
--- a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoGenericBox.h
+++ b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoGenericBox.h
@@ -18,6 +18,7 @@
 #ifndef SOGENERICBOX_H
 #define SOGENERICBOX_H
 
+#include <Inventor/C/errors/debugerror.h>
 #include <Inventor/fields/SoSFNode.h>
 #include <Inventor/fields/SoSFBool.h>
 #include <Inventor/nodes/SoShape.h>
diff --git a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoLAr.h b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoLAr.h
old mode 100755
new mode 100644
index 8003912c73ee..c2acc42e604c
--- a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoLAr.h
+++ b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoLAr.h
@@ -13,6 +13,7 @@
 #ifndef HEPVis_SoLAr_h
 #define HEPVis_SoLAr_h
 
+#include <Inventor/C/errors/debugerror.h>
 #include <Inventor/fields/SoSFFloat.h>
 #include <Inventor/fields/SoMFFloat.h>
 #include <Inventor/fields/SoSFInt32.h>
diff --git a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoPcons.h b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoPcons.h
old mode 100755
new mode 100644
index 16461f9ef289..c448291a8c7c
--- a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoPcons.h
+++ b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoPcons.h
@@ -15,6 +15,7 @@
 #ifndef HEPVis_SoPcons_h
 #define HEPVis_SoPcons_h
 
+#include <Inventor/C/errors/debugerror.h>
 #include <Inventor/fields/SoSFFloat.h>
 #include <Inventor/fields/SoMFFloat.h>
 #include <Inventor/fields/SoSFInt32.h>
diff --git a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoPolyhedron.h b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoPolyhedron.h
old mode 100755
new mode 100644
index 6378fbf851ec..58f489539a5c
--- a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoPolyhedron.h
+++ b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoPolyhedron.h
@@ -17,6 +17,7 @@
 #define HEPVis_SoPolyhedron_h
 
 // Inheritance :
+#include <Inventor/C/errors/debugerror.h>
 #include <Inventor/nodes/SoShape.h>
 #include <Inventor/fields/SoSFBool.h>
 
diff --git a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoTessellated.h b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoTessellated.h
index 2f57cf319945..3ed56eca2cfe 100644
--- a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoTessellated.h
+++ b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoTessellated.h
@@ -5,6 +5,7 @@
 #ifndef SOTESSELLATED_H
 #define SOTESSELLATED_H
 
+#include <Inventor/C/errors/debugerror.h>
 #include <Inventor/fields/SoSFNode.h>
 #include <Inventor/fields/SoSFBool.h>
 #include <Inventor/nodes/SoShape.h>
diff --git a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoTransparency.h b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoTransparency.h
index 7f715c3b409a..64dc88a7916e 100644
--- a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoTransparency.h
+++ b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoTransparency.h
@@ -12,6 +12,7 @@
 //                                                            //
 ////////////////////////////////////////////////////////////////
 
+#include <Inventor/C/errors/debugerror.h>
 #include <Inventor/fields/SoSFFloat.h>
 #include <Inventor/fields/SoSFBool.h>
 #include <Inventor/nodes/SoSubNode.h>
diff --git a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoTubs.h b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoTubs.h
old mode 100755
new mode 100644
index d9f1e32888c1..5d4e3e240fd6
--- a/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoTubs.h
+++ b/graphics/VP1/VP1HEPVis/VP1HEPVis/nodes/SoTubs.h
@@ -12,6 +12,7 @@
 #ifndef HEPVis_SoTubs_h
 #define HEPVis_SoTubs_h
 
+#include <Inventor/C/errors/debugerror.h>
 #include <Inventor/fields/SoSFFloat.h>
 #include <Inventor/fields/SoSFNode.h>
 #include <Inventor/fields/SoSFBool.h>
diff --git a/graphics/VP1/VP1HEPVis/cmt/requirements b/graphics/VP1/VP1HEPVis/cmt/requirements
old mode 100755
new mode 100644
index dab5d5fbcc7b..b43b04604d17
--- a/graphics/VP1/VP1HEPVis/cmt/requirements
+++ b/graphics/VP1/VP1HEPVis/cmt/requirements
@@ -18,7 +18,11 @@ macro VP1HEPVis_cppflags  " -ansi -D_REENTRANT -I/usr/X11R6/include" \
       target-darwin              " -ansi -D_REENTRANT"
 
 #Fixme: The linkopts (apart from the first) come from a run of coin-config --libs. We should call this instead of hardcoding!!
-macro VP1HEPVis_linkopts " -lVP1HEPVis -lGL  -lXext  -lSM -lICE -lX11  -ldl -lpthread  -lm" \
+# ORIGINAL
+#macro VP1HEPVis_linkopts " -lVP1HEPVis -lGL  -lXext  -lSM -lICE -lX11  -ldl -lpthread  -lm" \
+#      target-darwin             " -lVP1HEPVis -lpthread"
+# TEST
+macro VP1HEPVis_linkopts " -lVP1HEPVis -lGL  -lXext -lICE -lX11  -ldl -lpthread  -lm" \
       target-darwin             " -lVP1HEPVis -lpthread"
 
 macro VP1HEPVis_shlibflags_toBeAppended " -lGL " \
diff --git a/graphics/VP1/VP1HEPVis/src/BooleanProcessor.h b/graphics/VP1/VP1HEPVis/src/BooleanProcessor.h
old mode 100755
new mode 100644
diff --git a/graphics/VP1/VP1HEPVis/src/BooleanProcessor.h.original b/graphics/VP1/VP1HEPVis/src/BooleanProcessor.h.original
old mode 100755
new mode 100644
diff --git a/graphics/VP1/VP1HEPVis/src/PolygonTriangulator.cxx b/graphics/VP1/VP1HEPVis/src/PolygonTriangulator.cxx
old mode 100755
new mode 100644
diff --git a/graphics/VP1/VP1HEPVis/src/PolygonTriangulator.h b/graphics/VP1/VP1HEPVis/src/PolygonTriangulator.h
old mode 100755
new mode 100644
diff --git a/graphics/VP1/VP1HEPVis/src/SbMath.h b/graphics/VP1/VP1HEPVis/src/SbMath.h
old mode 100755
new mode 100644
diff --git a/graphics/VP1/VP1HEPVis/src/SbPolyhedron.cxx b/graphics/VP1/VP1HEPVis/src/SbPolyhedron.cxx
old mode 100755
new mode 100644
diff --git a/graphics/VP1/VP1HEPVis/src/SbStringHelpers.cxx b/graphics/VP1/VP1HEPVis/src/SbStringHelpers.cxx
index 25ab73e2e0fa..8f8ec574ad2c 100644
--- a/graphics/VP1/VP1HEPVis/src/SbStringHelpers.cxx
+++ b/graphics/VP1/VP1HEPVis/src/SbStringHelpers.cxx
@@ -3,6 +3,8 @@
 */
 
 // this :
+
+#include <Inventor/C/errors/debugerror.h>
 #define private public
 #include <Inventor/SbPList.h>//hack to work around numitems not initialised in coin
 #undef private
diff --git a/graphics/VP1/VP1HEPVis/src/SbStringHelpers.h b/graphics/VP1/VP1HEPVis/src/SbStringHelpers.h
old mode 100755
new mode 100644
diff --git a/graphics/VP1/VP1HEPVis/src/SoCons.cxx b/graphics/VP1/VP1HEPVis/src/SoCons.cxx
old mode 100755
new mode 100644
diff --git a/graphics/VP1/VP1HEPVis/src/SoLAr.cxx b/graphics/VP1/VP1HEPVis/src/SoLAr.cxx
old mode 100755
new mode 100644
diff --git a/graphics/VP1/VP1HEPVis/src/SoPcons.cxx b/graphics/VP1/VP1HEPVis/src/SoPcons.cxx
old mode 100755
new mode 100644
diff --git a/graphics/VP1/VP1HEPVis/src/SoPolyhedron.cxx b/graphics/VP1/VP1HEPVis/src/SoPolyhedron.cxx
old mode 100755
new mode 100644
diff --git a/graphics/VP1/VP1HEPVis/src/SoTubs.cxx b/graphics/VP1/VP1HEPVis/src/SoTubs.cxx
old mode 100755
new mode 100644
diff --git a/graphics/VP1/VP1HEPVis/src/VP1HEPVisUtils.cxx b/graphics/VP1/VP1HEPVis/src/VP1HEPVisUtils.cxx
index 6696df1a538f..d8cdf1297a0b 100644
--- a/graphics/VP1/VP1HEPVis/src/VP1HEPVisUtils.cxx
+++ b/graphics/VP1/VP1HEPVis/src/VP1HEPVisUtils.cxx
@@ -16,6 +16,7 @@
 
 #include "VP1HEPVis/VP1HEPVisUtils.h"
 
+#include <Inventor/C/errors/debugerror.h>
 #include <Inventor/nodes/SoSelection.h>
 #include <Inventor/nodes/SoSeparator.h>
 #include <Inventor/nodes/SoSwitch.h>
-- 
GitLab