Skip to content

Commit

Permalink
Generation of dictionaries and rootmaps with Root6
Browse files Browse the repository at this point in the history
  • Loading branch information
hristov authored and hristov committed Jan 16, 2015
1 parent ab85051 commit a8a44b4
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 14 deletions.
24 changes: 12 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
23 changes: 22 additions & 1 deletion cmake/CMakeALICE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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)

#########################
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindROOT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a8a44b4

Please sign in to comment.