Skip to content

Commit

Permalink
Merge pull request alisw#259 from dberzano/root-daq-nojson
Browse files Browse the repository at this point in the history
Disable JSON when ROOT HTTP is not available
  • Loading branch information
alibuild authored Jun 15, 2017
2 parents 82dc44e + 6d3e0da commit 7791cca
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
18 changes: 13 additions & 5 deletions STAT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ include_directories(${AliRoot_SOURCE_DIR}/${MODULE})
include_directories(${ROOT_INCLUDE_DIR}
${AliRoot_SOURCE_DIR}/STEER/STEERBase
)

# Sources in alphabetical order
set(SRCS
AliTMinuitToolkit.cxx
Expand All @@ -36,12 +37,21 @@ set(SRCS
AliNDLocalRegression.cxx
AliExternalInfo.cxx
AliFFTsmoother.cxx
AliTreePlayer.cxx
AliTreeTrending.cxx
AliNDFormulaBrowser.cxx
AliDrawStyle.cxx
AliElasticSearchRoot.cxx
)
AliElasticSearchRoot.cxx)

# Dependencies (libraries)
set(LIBDEPS Gui STEERBase Graf Tree TreePlayer GeomBuilder)

if(ROOT_HASHTTP)
# ROOT's HTTP library contains the JSON parser required by AliTreePlayer.
# Definition is for the LinkDef.
list(APPEND SRCS "AliTreePlayer.cxx")
list(APPEND LIBDEPS "RHTTP")
add_definitions("-DROOT_HAS_HTTP")
endif()

# Headers from sources
string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
Expand All @@ -52,8 +62,6 @@ get_directory_property(incdirs INCLUDE_DIRECTORIES)
generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")

# Generate the ROOT map
# Dependecies
set(LIBDEPS Gui STEERBase Graf Tree TreePlayer GeomBuilder RHTTP)
generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")

# Create an object to be reused in case of static libraries
Expand Down
7 changes: 5 additions & 2 deletions STAT/STATLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
#pragma link C++ class AliTMinuitToolkit+;
#pragma link C++ class AliNDLocalRegression+;

#pragma link C++ class AliExternalInfo+;
#ifdef ROOT_HAS_HTTP
#pragma link C++ class AliTreePlayer+;
#endif

#pragma link C++ class AliExternalInfo+;
#pragma link C++ class AliTreeTrending+;
#pragma link C++ class AliNDFormulaBrowser+;
#pragma link C++ class AliNDFormulaBrowser+;
#pragma link C++ class AliDrawStyle+;
#pragma link C++ class AliElasticSearchRoot++;

Expand Down
23 changes: 20 additions & 3 deletions cmake/FindROOT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
# - ROOT_HASXML - ROOT was built with XML support
# - ROOT_HASMONALISA - ROOT was built with MonAlisa support - needed by SHUTTLE
# - ROOT_HASLDAP - ROOT was built with ldap support - needed by SHUTTLE
# - ROOT_HASHTTP - ROOT was built with HTTP support
# - ROOT_FORTRAN - fortran compiler

set(ROOT_FOUND FALSE)
Expand Down Expand Up @@ -292,7 +293,7 @@ if(ROOTSYS)
# Checking for Vc from Root
execute_process(COMMAND ${ROOT_CONFIG} --has-vc OUTPUT_VARIABLE ROOT_HASVC ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
message(FATAL_ERROR "Error checking if ROOT was built with VCt: ${error}")
message(FATAL_ERROR "Error checking if ROOT was built with VC: ${error}")
endif(error)

if(ROOT_HASVC)
Expand All @@ -304,6 +305,23 @@ if(ROOTSYS)
endif()
endif()

execute_process(COMMAND ${ROOT_CONFIG} --has-http
OUTPUT_VARIABLE _root_feature
ERROR_VARIABLE _root_feature_error
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(_root_feature_error)
message(FATAL_ERROR "Error checking for ROOT feature --has-http: ${_root_feature_error}")
endif()
if(_root_feature)
if(_root_feature MATCHES "yes")
set(ROOT_HASHTTP TRUE)
else()
set(ROOT_HASHTTP FALSE)
endif()
endif()
unset(_root_feature)
unset(_root_feature_error)

# Checking for fortran compiler
execute_process(COMMAND ${ROOT_CONFIG} --f77 OUTPUT_VARIABLE ROOT_FORTRAN ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
Expand Down Expand Up @@ -351,8 +369,7 @@ if(ROOTSYS)
file(GLOB _extraroot "${ROOTSYS}/montercarlo/vmc/src/*.o"
"${ROOTSYS}/tree/treeplayer/src/*.o"
"${ROOTSYS}/io/xmlparser/src/*.o"
"${ROOTSYS}/math/minuit2/src/*.o"
"${ROOTSYS}/net/http/src/*.o")
"${ROOTSYS}/math/minuit2/src/*.o")
add_library(RootExtra STATIC ${_extraroot})
set_target_properties(RootExtra PROPERTIES
COMPILE_FLAGS "${LIBXML2_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR}")
Expand Down

0 comments on commit 7791cca

Please sign in to comment.