# Create a library called "libHades" which includes the source files given in # the array . # The extension is already found. Any number of sources could be listed here. set(INCLUDE_DIRECTORIES ${ROOT_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/geobase ${CMAKE_SOURCE_DIR}/parbase ${CMAKE_SOURCE_DIR}/base ${CMAKE_SOURCE_DIR}/hadsim ) include_directories( ${INCLUDE_DIRECTORIES}) set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ) link_directories( ${LINK_DIRECTORIES}) # Really lazy version to get the list of source files # Take all source file in the given source dir #FILE(GLOB HADES_SRCS ${CMAKE_CURRENT_SOURCE_DIR} *.cxx) # List of source files set(HADES_SRCS HadesCave.cxx HadesShower.cxx hgeoframes.cxx hgeosectors.cxx HadesMdc.cxx HadesShowerPoint.cxx hgeohit.cxx hgeoshower.cxx HadesMdcPoint.cxx HadesTof.cxx hgeomdc.cxx hgeoshowerhit.cxx HadesRich.cxx HadesTofPoint.cxx hgeomdchit.cxx hgeotarget.cxx HadesRichPoint.cxx hgeocave.cxx hgeorich.cxx hgeotof.cxx HadesSectors.cxx hgeocoils.cxx hgeorichhit.cxx hgeotofhit.cxx hmdctrackgfield.cxx HadesField.cxx HadesCoils.cxx HadesFrames.cxx HadesTarget.cxx ) set( HADES_HEADERS HadesCave.h HadesRichPoint.h HadesTofPoint.h hgeomdc.h hgeoshower.h HadesSectors.h hgeocave.h hgeomdchit.h hgeoshowerhit.h HadesMdc.h HadesShower.h hgeocoils.h hgeorich.h hgeotarget.h HadesMdcPoint.h HadesShowerPoint.h hgeoframes.h hgeorichhit.h hgeotof.h HadesRich.h HadesTof.h hgeohit.h hgeosectors.h hgeotofhit.h HadesField.h hmdctrackgfield.h HadesCoils.h HadesFrames.h HadesTarget.h ) if(RULE_CHECKER_FOUND) CHECK_RULES("${HADES_SRCS}" "${INCLUDE_DIRECTORIES}" HADES_RULES) endif(RULE_CHECKER_FOUND) # set everything needed for the root dictonary and create the # dictionary set(HADES_LINKDEF HadesLinkDef.h ) set(HADES_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/CbmHadesDict.cxx) ROOT_GENERATE_DICTIONARY("${HADES_HEADERS}" "${HADES_LINKDEF}" "${HADES_DICTIONARY}" "${INCLUDE_DIRECTORIES}") # add the dictionary to the list of source files SET(HADES_SRCS ${HADES_SRCS} ${HADES_DICTIONARY}) ############### build the library ##################### add_library(Hades SHARED ${HADES_SRCS}) target_link_libraries(Hades ${ROOT_LIBRARIES}) set_target_properties(Hades PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES}) ############### install the library ################### install(TARGETS Hades DESTINATION ${CMAKE_BINARY_DIR}/lib)