# Create a library called "libTLANDEvent" 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}/LAND/LandUnpack ${CMAKE_SOURCE_DIR}/CommonStruct/TRootEvent ) include_directories( ${INCLUDE_DIRECTORIES}) set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ) link_directories( ${LINK_DIRECTORIES}) add_subdirectory (STA) # Really lazy version to get the list of source files # Take all source file in the given source dir #FILE(GLOB TLANDEvent_SRCS ${CMAKE_CURRENT_SOURCE_DIR} *.cxx) # List of source files set(TLANDEvent_SRCS TLANDEventV.cxx ) # list of header files set(TLANDEvent_HEADERS TLANDEventV.h ) if(RULE_CHECKER_FOUND) CHECK_RULES("${TLANDEvent_SRCS}" "${INCLUDE_DIRECTORIES}" TLANDEvent_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 TLANDEvent_HEADERS "${TLANDEvent_SRCS}") # set everything needed for the root dictonary and create the # dictionary set(TLANDEvent_LINKDEF TLANDEventLinkDef.h ) set(TLANDEvent_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/TLANDEventDict.cxx) ROOT_GENERATE_DICTIONARY("${TLANDEvent_HEADERS}" "${TLANDEvent_LINKDEF}" "${TLANDEvent_DICTIONARY}" "${INCLUDE_DIRECTORIES}") # add the dictionary to the list of source files SET(TLANDEvent_SRCS ${TLANDEvent_SRCS} ${TLANDEvent_DICTIONARY}) ############### build the library ##################### add_library(TLANDEvent SHARED ${TLANDEvent_SRCS}) target_link_libraries(TLANDEvent ${ROOT_LIBRARIES}) set_target_properties(TLANDEvent PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES}) ############### install the library ################### install(TARGETS TLANDEvent DESTINATION ${CMAKE_BINARY_DIR}/lib)