# Create a library called "libTATOFEvent" 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}/TATOFEvent ) 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 TATOFEvent_SRCS ${CMAKE_CURRENT_SOURCE_DIR} *.cxx) # List of source files set(TATOFEvent_SRCS TATOFaction.cxx TATOFdata.cxx TATOFdataDsc.cxx TATOFEvent.cxx TATOFeventId.cxx TATOFnamed.cxx TATOFobject.cxx TATOFpara.cxx TATOFparaDsc.cxx TATOFparMap.cxx TATOFroot.cxx TATOFrunInfo.cxx ) if(RULE_CHECKER_FOUND) CHECK_RULES("${TATOFEvent_SRCS}" "${INCLUDE_DIRECTORIES}" TATOFEvent_RULES) endif(RULE_CHECKER_FOUND) # fill list of header files from list of source files # by exchanging the file extension CHANGE_FILE_EXTENSION(*.cxx *.h TATOFEvent_HEADERS "${TATOFEvent_SRCS}") # Add *.h without *.cxx set(TATOFEvent_HEADERS "${TATOFEvent_HEADERS}") # fill list of header files from list of source files # by exchanging the file extension # set everything needed for the root dictionary and create the # dictionary set(TATOFEvent_LINKDEF TATOFEvent.LinkDef.h ) #set(TATOFEvent_LINKDEF # TATOFaction.h # TATOFdata.LinkDef.h # TATOFdataDsc.LinkDef.h # TATOFEvent.LinkDef.h # TATOFeventId.LinkDef.h # TATOFnamed.LinkDef.h # TATOFobject.LinkDef.h # TATOFpara.LinkDef.h # TATOFparaDsc.LinkDef.h # TATOFparMap.LinkDef.h # TATOFroot.LinkDef.h # TATOFrunInfo.LinkDef.h # ) set(TATOFEvent_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/TATOFEventDict.cxx) ROOT_GENERATE_DICTIONARY("${TATOFEvent_HEADERS}" "${TATOFEvent_LINKDEF}" "${TATOFEvent_DICTIONARY}" "${INCLUDE_DIRECTORIES}") # add the dictionary to the list of source files SET(TATOFEvent_SRCS ${TATOFEvent_SRCS} ${TATOFEvent_DICTIONARY}) ############### build the library ##################### add_library(TATOFEvent SHARED ${TATOFEvent_SRCS}) target_link_libraries(TATOFEvent ${ROOT_LIBRARIES}) set_target_properties(TATOFEvent PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES}) ############### install the library ################### install(TARGETS TATOFEvent DESTINATION ${CMAKE_BINARY_DIR}/lib)