Generation of dictionaries and rootmaps with Root6
authorhristov <Peter.Hristov@cern.ch>
Fri, 16 Jan 2015 17:26:21 +0000 (18:26 +0100)
committerhristov <Peter.Hristov@cern.ch>
Fri, 16 Jan 2015 17:26:29 +0000 (18:26 +0100)
CMakeLists.txt
cmake/CMakeALICE.cmake
cmake/FindROOT.cmake

index f460730..8010e8f 100644 (file)
@@ -60,6 +60,18 @@ if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
   set(CMAKE_SHARED_LIBRARY_SUFFIX .so)
 endif (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
 
+# ROOT configuration mandatory
+if(ROOTSYS)
+    find_package(ROOT REQUIRED)
+
+    # ROOT must be build with XML2 support
+    if(NOT ROOT_HASXML)
+        message(FATAL_ERROR "ROOT was not build with xml2 support. Please reinstall or rebuild ROOT with xml2 support")
+    endif(NOT ROOT_HASXML)
+else()
+    message(FATAL_ERROR "ROOT installation not found!\nPlease point to the ROOT installation using -DROOTSYS=ROOT_INSTALL_DIR")
+endif(ROOTSYS)
+
 # ROOT dictionaries and maps
 include(CMakeALICE)
 
@@ -130,18 +142,6 @@ if(MDCRPM)
     message(STATUS "AliMDC RPM enabled. AliRoot static build enabled")
 endif(MDCRPM)
 
-# ROOT configuration mandatory
-if(ROOTSYS)
-    find_package(ROOT REQUIRED)
-
-    # ROOT must be build with XML2 support
-    if(NOT ROOT_HASXML)
-        message(FATAL_ERROR "ROOT was not build with xml2 support. Please reinstall or rebuild ROOT with xml2 support")
-    endif(NOT ROOT_HASXML)
-else()
-    message(FATAL_ERROR "ROOT installation not found!\nPlease point to the ROOT installation using -DROOTSYS=ROOT_INSTALL_DIR")
-endif(ROOTSYS)
-
 # If no Fortran, i.e on Windows
 # We need to specify ROOT fortran
 # (f95 comes before gfortran in default module)
index 5eb869c..8be6d34 100644 (file)
@@ -25,6 +25,7 @@
 # @DHDRS  Dictionary headers
 # @DINCDIR Include folders that need to be passed to cint/cling
 macro(generate_dictionary DNAME LDNAME DHDRS DINCDIRS)
+
     # Creating the INCLUDE path for cint/cling
     foreach( dir ${DINCDIRS})
         set(INCLUDE_PATH -I${dir} ${INCLUDE_PATH})
@@ -43,6 +44,7 @@ macro(generate_dictionary DNAME LDNAME DHDRS DINCDIRS)
     get_directory_property(tmpdirdefs DEFINITIONS)
     string(REPLACE " " ";" tmpdirdefs "${tmpdirdefs}")
 
+    if (ROOT_VERSION_MAJOR LESS 6)
     add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.h
                        COMMAND LD_LIBRARY_PATH=${ROOT_LIBDIR}:$ENV{LD_LIBRARY_PATH} ${ROOT_CINT}
                        ARGS -f ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx -c -p 
@@ -51,6 +53,21 @@ macro(generate_dictionary DNAME LDNAME DHDRS DINCDIRS)
                        DEPENDS ${DHDRS} ${LDNAME} ${ROOT_CINT}
                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
                       )
+    else (ROOT_VERSION_MAJOR LESS 6)
+    add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lib${DNAME}.rootmap ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx
+                       COMMAND
+                         LD_LIBRARY_PATH=${ROOT_LIBDIR}:$ENV{LD_LIBRARY_PATH} ${ROOT_CINT}
+                       ARGS
+                         -f ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx
+                         -rmf ${CMAKE_CURRENT_BINARY_DIR}/lib${DNAME}.rootmap -rml lib${DNAME}
+                         ${tmpdirdefs} ${INCLUDE_PATH} ${DHDRS} ${LDNAME}
+                       DEPENDS
+                         ${DHDRS} ${LDNAME} ${ROOT_CINT}
+                       WORKING_DIRECTORY
+                         ${CMAKE_CURRENT_BINARY_DIR}
+                      )
+    endif (ROOT_VERSION_MAJOR LESS 6)
+
 endmacro(generate_dictionary)
 
 # Generate the ROOTmap files
@@ -63,6 +80,8 @@ macro(generate_rootmap LIBNAME LIBDEPS LINKDEF)
 #    message(STATUS "LINKDEF = ${LINKDEF}")
 #    message(STATUS "ROOT_LIBMAP=${ROOT_LIBMAP}")
 
+if (ROOT_VERSION_MAJOR LESS 6)
+
     set(LOCAL_DEPS)
     foreach(file ${LIBDEPS})
         get_filename_component(ext ${file} EXT)
@@ -82,7 +101,9 @@ macro(generate_rootmap LIBNAME LIBDEPS LINKDEF)
                       )
     add_custom_target(lib${LIBNAME}.rootmap ALL DEPENDS  ${CMAKE_CURRENT_BINARY_DIR}/lib${LIBNAME}.rootmap)
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${LIBNAME}.rootmap DESTINATION lib)
-    
+
+endif (ROOT_VERSION_MAJOR LESS 6)
+
 endmacro(generate_rootmap)
 
 #########################
index e0c254a..6e0a09a 100644 (file)
@@ -50,7 +50,7 @@ if(ROOTSYS)
     endif(NOT ROOT_CONFIG)
 
     # Check for rlibmap
-    find_program(ROOT_LIBMAP NAMES rlibmap PATHS ${ROOTSYS}/bin NO_DEFAULT_PATH)
+    find_program(ROOT_LIBMAP NAMES rlibmap rootcling PATHS ${ROOTSYS}/bin NO_DEFAULT_PATH)
     if(ROOT_LIBMAP)
         message(STATUS "Found ${ROOT_LIBMAP}")
     else()