# Create a library called "libTCHIEvent" 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}/CHIMERA/ChimeraUnpack/TCHIEvent ) 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 TCHIEvent_SRCS ${CMAKE_CURRENT_SOURCE_DIR} *.cxx) # List of source files set(TCHIEvent_SRCS TCHIEvent.cxx readpar_lex.cxx readpar.tab.cxx ) # list of header files set(TCHIEvent_HEADERS TCHIEvent.h global.h readpar.tab.h ) if(RULE_CHECKER_FOUND) CHECK_RULES("${TCHIEvent_SRCS}" "${INCLUDE_DIRECTORIES}" TCHIEvent_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 TCHIEvent_HEADERS "${TCHIEvent_SRCS}") # set everything needed for the root dictonary and create the # dictionary set(TCHIEvent_LINKDEF TCHIEventLinkDef.h ) set(TCHIEvent_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/TCHIEventDict.cxx) ROOT_GENERATE_DICTIONARY("${TCHIEvent_HEADERS}" "${TCHIEvent_LINKDEF}" "${TCHIEvent_DICTIONARY}" "${INCLUDE_DIRECTORIES}") # add the dictionary to the list of source files SET(TCHIEvent_SRCS ${TCHIEvent_SRCS} ${TCHIEvent_DICTIONARY}) ############### build the library ##################### add_library(TCHIEvent SHARED ${TCHIEvent_SRCS}) target_link_libraries(TCHIEvent ${ROOT_LIBRARIES}) set_target_properties(TCHIEvent PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES}) ############### install the library ################### install(TARGETS TCHIEvent DESTINATION ${CMAKE_BINARY_DIR}/lib)