From 2789354ec3b8af92beaa1df56fc714e09a8549d6 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Thu, 24 Jul 2014 13:00:36 +0000
Subject: [PATCH] DDG4/CMakeLists

Moved find_package calls to main cmakelists
moved include_directories to main cmakelists
only use dd4hep_generate_rootmap
---
 DDG4/CMakeLists.txt | 43 ++++---------------------------------------
 1 file changed, 4 insertions(+), 39 deletions(-)

diff --git a/DDG4/CMakeLists.txt b/DDG4/CMakeLists.txt
index f8d5e4aef..cbe16a848 100644
--- a/DDG4/CMakeLists.txt
+++ b/DDG4/CMakeLists.txt
@@ -1,35 +1,9 @@
-#---Find Geant4-------------------------------------------------------------------
-
-#find_package(Geant4 REQUIRED gdml ui_all vis_all)
-#if(NOT Geant4_clhep_FOUND)
-#  find_package(CLHEP REQUIRED)
-#  set(Geant4_INCLUDE_DIRS ${Geant4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS})
-#  set(Geant4_LIBRARIES ${Geant4_LIBRARIES} ${CLHEP_LIBRARIES})
-#endif()
-INCLUDE(${Geant4_USE_FILE})   # this also takes care of geant 4 definitions and include dirs
-
-include(DD4hep_XML_setup)
-
 #---Includedirs-------------------------------------------------------------------
 include_directories(${CMAKE_SOURCE_DIR}/DDCore/include
 	            ${CMAKE_SOURCE_DIR}/DDSegmentation/include	
-                    ${CMAKE_CURRENT_SOURCE_DIR}/include 
-                    ${ROOT_INCLUDE_DIR}
-                    ${CLHEP_INCLUDE_DIR}
-                    ${Geant4_INCLUDE_DIRS} ) #${LCIO_DIR}/include )
+                    ${CMAKE_CURRENT_SOURCE_DIR}/include )
 
 #---Add Library-------------------------------------------------------------------
-if(DD4HEP_USE_BOOST)
-  #fg:  canonical way of finding Boost w/ cmake uses 
-  #     -D Boost_DIR=_path_to_boost
-  #     and then FindBoost.cmake sets the variable Boost_INCLUDE_DIR
-  FIND_PACKAGE( Boost REQUIRED) 
-  include_directories( ${Boost_INCLUDE_DIR})
-  #list(APPEND include_directories ${BOOST_INCLUDE_DIR})
-  add_definitions(-DDD4HEP_USE_BOOST)
- #  MESSAGE( STATUS  "Boost_INCLUDE_DIR = ${Boost_INCLUDE_DIR} ")
- #  MESSAGE( STATUS  "include_directories= ${include_directories} ")
-endif()
 file(GLOB sources src/*.cpp)
 
 if(NOT DD4HEP_USE_XERCESC)
@@ -52,11 +26,7 @@ add_library(DD4hepG4Legacy SHARED ${legacy_sources})
 target_link_libraries(DD4hepG4Legacy DD4hepCore DD4hepG4 ${ROOT_LIBRARIES} Reflex ${Geant4_LIBRARIES})
 
 SET_TARGET_PROPERTIES(DD4hepG4Legacy PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION})
-if(APPLE)
-  dd4hep_generate_rootmap_apple(DD4hepG4Legacy)
-else()
-  dd4hep_generate_rootmap(DD4hepG4Legacy)
-endif()
+dd4hep_generate_rootmap(DD4hepG4Legacy)
 
 #---------------------------  New Plugin library for new simulation framework  -----
 file(GLOB plugins_sources plugins/*.cpp)
@@ -64,19 +34,13 @@ add_library(DD4hepG4Plugins SHARED ${plugins_sources})
 target_link_libraries(DD4hepG4Plugins DD4hepCore DD4hepG4 ${ROOT_LIBRARIES} Reflex ${Geant4_LIBRARIES})
 
 SET_TARGET_PROPERTIES(DD4hepG4Plugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION})
-if(APPLE)
-  dd4hep_generate_rootmap_apple(DD4hepG4Plugins)
-else()
-  dd4hep_generate_rootmap(DD4hepG4Plugins)
-endif()
+dd4hep_generate_rootmap(DD4hepG4Plugins)
 
 #---------------------------  LCIO Plugins for new simulation framework  -----------
 #if(LCIO_DIR)
 #  list(APPEND include_directories ${LCIO_DIR}/include)
 
 if(DD4HEP_USE_LCIO)
-  find_package(LCIO REQUIRED)
-  include_directories(  ${LCIO_INCLUDE_DIRS} )
 
   file(GLOB lcio_sources lcio/*.cpp)
   add_library(DD4hepG4LCIO SHARED ${lcio_sources})
@@ -85,6 +49,7 @@ if(DD4HEP_USE_LCIO)
 
   SET_TARGET_PROPERTIES(DD4hepG4LCIO PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION})
   dd4hep_generate_rootmap(DD4hepG4LCIO)
+
 endif()
 
 #-----------------------------------------------------------------------------------
-- 
GitLab