Skip to content
Snippets Groups Projects
Commit 69299c59 authored by Adrien Matta's avatar Adrien Matta :skull_crossbones:
Browse files

* Simpler Root.cmake

        - Less libraries are loaded
        - nicer flag to load the libraries
        - comply with the rpath method of linking
parent 11c45095
No related branches found
No related tags found
No related merge requests found
add_custom_command(OUTPUT NPOnlineDict.cxx COMMAND ../scripts/build_dict.sh NPOnline.h NPOnlineDict.cxx NPOnline.rootmap libNPCore.dylib NPOnlineLinkDef.h DEPENDS NPOnline.h)
add_library(NPOnline SHARED NPOnline.cxx NPOnlineDict.cxx )
target_link_libraries(NPOnline ${ROOT_LIBRARIES} -lGui -lGpad -lThread -lGraf -lHist -lMatrix NPCore)
target_link_libraries(NPOnline ${ROOT_LIBRARIES} Net Thread NPCore)
install(FILES NPOnline.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
......@@ -4,10 +4,10 @@ add_custom_command(OUTPUT TInitialConditionsDict.cxx COMMAND ../scripts/build_di
add_custom_command(OUTPUT TInteractionCoordinatesDict.cxx COMMAND ../scripts/build_dict.sh TInteractionCoordinates.h TInteractionCoordinatesDict.cxx TInteractionCoordinates.rootmap libNPInteractionCoordinates.so DEPENDS TInteractionCoordinates.h)
add_library(NPPhysics SHARED NPBeam.cxx NPEnergyLoss.cxx NPFunction.cxx NPNucleus.cxx NPReaction.cxx NPReactionDict.cxx NPEnergyLossDict.cxx )
target_link_libraries(NPPhysics ${ROOT_LIBRARIES} NPCore)
target_link_libraries(NPPhysics ${ROOT_LIBRARIES} Physics NPCore)
add_library(NPInitialConditions SHARED TInitialConditions.cxx TInitialConditionsDict.cxx )
target_link_libraries(NPInitialConditions ${ROOT_LIBRARIES} NPCore)
target_link_libraries(NPInitialConditions ${ROOT_LIBRARIES} )
add_library(NPInteractionCoordinates SHARED TInteractionCoordinates.cxx TInteractionCoordinatesDict.cxx)
target_link_libraries(NPInteractionCoordinates ${ROOT_LIBRARIES} )
......
......@@ -34,27 +34,9 @@ endif()
## Collect the different information ##
# Lib
exec_program(${NPTOOL_ROOT_CONFIG} ARGS "--glibs" OUTPUT_VARIABLE ROOT_LIBRARIES)
# Remove unnecessary dependencies from the list return by root
# This actually improve slightly performances
string(REPLACE "-lGui" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
#string(REPLACE "-lCore" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
#string(REPLACE "-lRIO" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
#string(REPLACE "-lNet" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
#string(REPLACE "-lHist" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
string(REPLACE "-lGraf " " " ROOT_LIBRARIES "${ROOT_LIBRARIES}")
string(REPLACE "-lGraf3d" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
#string(REPLACE "-lGpad" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
#string(REPLACE "-lTree" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
string(REPLACE "-lRint" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
string(REPLACE "-lPostscript" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
string(REPLACE "-lMatrix" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
#string(REPLACE "-lPhysics" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
#string(REPLACE "-lMathCore" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
string(REPLACE "-lThread" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
string(REPLACE "-lpthread" "" ROOT_LIBRARIES "${ROOT_LIBRARIES}")
# List of Root dependencies
#set(ROOT_LIBRARIES dl Gui Core RIO Net Hist Gpad Tree Physics MathCore Thread )
set(ROOT_LIBRARIES dl Gui Core Gpad Hist Physics Tree )
# Lib directories
exec_program(${NPTOOL_ROOT_CONFIG} ARGS "--libdir" OUTPUT_VARIABLE ROOT_LIBRARY_DIR)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment