# Create a library called "libTMBALLEvent" 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}/MBALL/MBallUnpack ) 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 TMBALLEvent_SRCS ${CMAKE_CURRENT_SOURCE_DIR} *.cxx) # List of source files set(TMBALLEvent_SRCS TMBALLEvent.cxx ) # list of header files set(TMBALLEvent_HEADERS TMBALLEvent.h ) if(RULE_CHECKER_FOUND) CHECK_RULES("${TMBALLEvent_SRCS}" "${INCLUDE_DIRECTORIES}" TMBALLEvent_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 TMBALLEvent_HEADERS "${TMBALLEvent_SRCS}") # set everything needed for the root dictonary and create the # dictionary set(TMBALLEvent_LINKDEF TMBALLEventLinkDef.h ) set(TMBALLEvent_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/TMBALLEventDict.cxx) ROOT_GENERATE_DICTIONARY("${TMBALLEvent_HEADERS}" "${TMBALLEvent_LINKDEF}" "${TMBALLEvent_DICTIONARY}" "${INCLUDE_DIRECTORIES}") # add the dictionary to the list of source files SET(TMBALLEvent_SRCS ${TMBALLEvent_SRCS} ${TMBALLEvent_DICTIONARY}) ############### build the library ##################### add_library(TMBALLEvent SHARED ${TMBALLEvent_SRCS}) target_link_libraries(TMBALLEvent ${ROOT_LIBRARIES}) set_target_properties(TMBALLEvent PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES}) ############### install the library ################### install(TARGETS TMBALLEvent DESTINATION ${CMAKE_BINARY_DIR}/lib)