]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
CMake: Find ApMon used for the Shuttle
authoragrigora <alina.grigoras@cern.ch>
Thu, 5 Feb 2015 15:51:14 +0000 (16:51 +0100)
committeragrigora <alina.grigoras@cern.ch>
Wed, 25 Feb 2015 12:10:31 +0000 (13:10 +0100)
Shuttle has mandatory requirement for ROOT to be build with ApMon support.
But ROOT does not point to the ApMon installation therefore we need
to provide the ApMon installation

ApMon

CMakeLists.txt
SHUTTLE/CMakeLists.txt
cmake/FindApMon.cmake [new file with mode: 0644]
cmake/FindROOT.cmake

index 0ece85984422a21a82dd4407b7bf29ce6fe105e5..1a464433fa306a20e51fd279346354e5f70a021b 100644 (file)
@@ -118,10 +118,12 @@ else()
     find_package(DIM)
   endif()
 
-  if(DIM_FOUND)
-    find_package(DATE)
-  else()
-    message(FATAL_ERROR "DATE enabled but no DIMDIR and ODIR set. Please set DIMDIR and ODIR")
+  if(DATE_CONFIG)
+    if(DIM_FOUND)
+      find_package(DATE)
+    else()
+      message(FATAL_ERROR "DATE enabled but no DIMDIR and ODIR set. Please set DIMDIR and ODIR")
+    endif()
   endif()
 
   # daqDA
@@ -131,7 +133,7 @@ else()
     find_package(daqDA)
   endif(daqDA)
 
-  # AMORE
+  # AMORE -> requires ROOT to be installed
   # Setting variables in cache to be accesible by ccmake
   set(AMORE_CONFIG CACHE STRING "amore-config script location")
   if(AMORE_CONFIG)
@@ -152,33 +154,33 @@ else()
     endif(NOT DA)
   endif(DARPM)
 
-    # DA is enabled
-    # Setting variables in cache to be accesible by ccmake
-    set(ALIROOT_STATIC CACHE STRING "ENABLE static building of AliRoot: ON")
-    if(DA)
-        if(NOT DIM_FOUND)
-            set(DA FALSE)
-            message(FATAL_ERROR "DAs enabled but no DIMDIR and ODIR set. Please set DIMDIR to DIM installation and ODIR to platform (default linux)")
-        endif()
-
-        if(NOT DATE_FOUND)
-            set(DA FALSE)
-            message(FATAL_ERROR "DAs enabled but no DATE support found. Please point to your date installation using \"DATE_CONFIG\" variable")
-        endif()
-
-        if(NOT daqDA_FOUND)
-            set(DA FALSE)
-            message(FATAL_ERROR "DAs enabled but no daqDA support found. Please point to your daqDA installation using \"daqDA\" variable")
-        endif()
-
-        if(NOT AMORE_FOUND)
-            set(DA FALSE)
-            message(FATAL_ERROR "DAs enabled but no AMORE support found. Please point to your AMORE installation using \"AMORE_CONFIG\" variable")
-        endif()
+  # DA is enabled
+  # Setting variables in cache to be accesible by ccmake
+  set(ALIROOT_STATIC CACHE STRING "ENABLE static building of AliRoot: ON")
+  if(DA)
+    if(NOT DIM_FOUND)
+      set(DA FALSE)
+      message(FATAL_ERROR "DAs enabled but no DIMDIR and ODIR set. Please set DIMDIR to DIM installation and ODIR to platform (default linux)")
+    endif()
+
+    if(NOT DATE_FOUND)
+      set(DA FALSE)
+      message(FATAL_ERROR "DAs enabled but no DATE support found. Please point to your date installation using \"DATE_CONFIG\" variable")
+    endif()
+
+    if(NOT daqDA_FOUND)
+      set(DA FALSE)
+      message(FATAL_ERROR "DAs enabled but no daqDA support found. Please point to your daqDA installation using \"daqDA\" variable")
+    endif()
+
+    if(NOT AMORE_FOUND)
+      set(DA FALSE)
+      message(FATAL_ERROR "DAs enabled but no AMORE support found. Please point to your AMORE installation using \"AMORE_CONFIG\" variable")
+    endif()
       
-        # Enable static libraries
-        set(ALIROOT_STATIC TRUE)
-        message(STATUS "DAs enabled")
+    # Enable static libraries
+    set(ALIROOT_STATIC TRUE)
+    message(STATUS "DAs enabled")
   endif(DA)
 
   # MDC rpm creation enables the static build
@@ -319,6 +321,12 @@ else()
   # # Setting variables in cache to be accesible by ccmake
   set(SHUTTLE CACHE STRING "Enable SHUTTLE build : ON")
   if(SHUTTLE)
+    if(NOT ROOT_HASMONALISA)
+        message(FATAL_ERROR "ROOT was not build with MonAlisa support")
+    endif()
+
+    find_package(ApMon)
+
     if(ROOT_HASALIEN STREQUAL "no")
       message(FATAL_ERROR "Shuttle needs ROOT build with AliEn support. Please build ROOT with AliEn support. Do not forget to set ALIEN to your AliEn installation")
     endif()
index 779f35c6ed456e4f71eb9a8236ca59ace9a6ca11..034c344d65098dbc9690956d897f328e7da98979 100644 (file)
@@ -27,6 +27,9 @@ include_directories(${AliRoot_SOURCE_DIR}/STEER/CDB
 # DIM include folder and libraries folder
 include_directories(${DIM_INCLUDE_DIR})
 
+# Include ApMon.h needed by ROOT monalisa interface
+include_directories(${ApMon_INCLUDE_DIR})
+
 # Sources in alphabetical order
 set(SRCS
     AliEmptyPreprocessor.cxx
@@ -51,9 +54,7 @@ generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
 # Generate the ROOT map
 # Dependecies
 set(LIBDEPS STEERBase CDB Core Eve Gui Hist Minuit2 Minuit Net ProofPlayer RIO Spectrum Thread TMVA)
-if(DIM_FOUND)
-    set(LIBDEPS ${LIBDEPS} ${DIM_LIBRARIES})
-endif()
+set(LIBDEPS ${LIBDEPS} ${DIM_LIBRARIES})
 
 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
 
diff --git a/cmake/FindApMon.cmake b/cmake/FindApMon.cmake
new file mode 100644 (file)
index 0000000..321dabb
--- /dev/null
@@ -0,0 +1,31 @@
+# Find for ApMon library
+# Setting:
+#       - ApMon_LIBRARIES
+#       - ApMon_INCLUDE_DIR
+
+set(ApMon_FOUND FALSE)
+
+if(ApMon)
+    # check for the existance of the ApMon library
+    find_library(ApMon_LIBRARIES NAMES apmoncpp PATHS ${ApMon}/lib NO_DEFAULT_PATH DOC "Path to ApMon library")
+    
+    if(NOT ApMon_LIBRARIES)
+        message(FATAL_ERROR "Could not locate ApMon library inside ${ApMon}/lib")
+    else()
+        message(STATUS "Found ApMon library: ${ApMon_LIBRARIES}")
+    endif()
+    
+    # check for the existance of the ApMin header
+    find_path(ApMon_INCLUDE_DIR NAMES ApMon.h PATHS ${ApMon}/include NO_DEFAULT_PATH  DOC "Path to ApMon header folder.")
+    
+    if(NOT ApMon_INCLUDE_DIR)
+        message(FATAL_ERROR "Could not find ApMon header inside ${ApMon}/include")
+    else()
+        message(STATUS "Found ApMon header folder: ${ApMon_INCLUDE_DIR}")
+    endif()
+
+    set(ApMon_FOUND TRUE)
+    mark_as_advanced(${ApMon_LIBRARIES} ${ApMon_INCLUDE_DI})
+else()
+    message(FATAL_ERROR "Please point to the ApMon installation using -DApMon=/install/point")
+endif(ApMon)
\ No newline at end of file
index 2d3121aa04acbb950696e1455bd2d940de2727cc..7b7902bb87fdcc362db460023e0daac269061d8a 100644 (file)
@@ -35,6 +35,7 @@
 # - ROOT_HASALIEN - ROOT was built with AliEn support
 # - ROOT_HASOPENGL - ROOT was built with OpenGL support
 # - ROOT_HASXML - ROOT was built with XML support
+# - ROOT_HASMONALISA - ROOT was built with MonAlisa support - needed by SHUTTLE
 # - ROOT_FORTRAN - fortran compiler
 
 set(ROOT_FOUND FALSE)
@@ -230,6 +231,22 @@ if(ROOTSYS)
         endif()
     endif(ROOT_HASXML)
 
+    # Checking for monalisa support
+    execute_process(COMMAND ${ROOT_CONFIG} --has-monalisa OUTPUT_VARIABLE ROOT_HASMONALISA ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+    if(error)
+        message(FATAL_ERROR "Error checking if ROOT was built with monalisa support: ${error}")
+    endif(error)
+    
+    # if defined
+    if(ROOT_HASMONALISA)
+        string(STRIP "${ROOT_HASMONALISA}" ROOT_HASMONALISA)
+        if(ROOT_HASMONALISA STREQUAL "yes")
+            set(ROOT_HASMONALISA TRUE)
+        else()
+            set(ROOT_HASMONALISA FALSE)
+        endif()
+    endif(ROOT_HASMONALISA)
+
     # Checking for OpenGL support
     execute_process(COMMAND ${ROOT_CONFIG} --has-opengl OUTPUT_VARIABLE ROOT_HASOPENGL ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
     if(error)