# Create a library called "libTCHIGridCsI" 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/TCHIGridCsI ) 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 TCHIGridCsI_SRCS ${CMAKE_CURRENT_SOURCE_DIR} *.cxx) # List of source files set(TCHIGridCsI_SRCS TCHIGridCsI.cc TCHIGraphCsI.cc TCHICsIEnergy.cc ) # list of header files set(TCHIGridCsI_HEADERS TCHIGridCsI.h TCHIResult.h TCHICsIEnergy.h ) if(RULE_CHECKER_FOUND) CHECK_RULES("${TCHIGridCsI_SRCS}" "${INCLUDE_DIRECTORIES}" TCHIGridCsI_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 TCHIGridCsI_HEADERS "${TCHIGridCsI_SRCS}") # set everything needed for the root dictonary and create the # dictionary set(TCHIGridCsI_LINKDEF TCHIGridCsILinkDef.h ) set(TCHIGridCsI_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/TCHIGridCsIDict.cxx) ROOT_GENERATE_DICTIONARY("${TCHIGridCsI_HEADERS}" "${TCHIGridCsI_LINKDEF}" "${TCHIGridCsI_DICTIONARY}" "${INCLUDE_DIRECTORIES}") # add the dictionary to the list of source files SET(TCHIGridCsI_SRCS ${TCHIGridCsI_SRCS} ${TCHIGridCsI_DICTIONARY}) ############### build the library ##################### add_library(TCHIGridCsI SHARED ${TCHIGridCsI_SRCS}) target_link_libraries(TCHIGridCsI ${ROOT_LIBRARIES}) set_target_properties(TCHIGridCsI PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES}) ############### install the library ################### install(TARGETS TCHIGridCsI DESTINATION ${CMAKE_BINARY_DIR}/lib)