# Create a library called "libTCAMACEvent" 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}/CAMAC ${CMAKE_SOURCE_DIR}/CAMAC/CamacUnpack ) 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 TCAMACEvent_SRCS ${CMAKE_CURRENT_SOURCE_DIR} *.cxx) # List of source files set(TCAMACEvent_SRCS TCAMACEvent.cxx ) # list of header files set(TCAMACEvent_HEADERS TCAMACEvent.h ) if(RULE_CHECKER_FOUND) CHECK_RULES("${TCAMACEvent_SRCS}" "${INCLUDE_DIRECTORIES}" TCAMACEvent_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 TCAMACEvent_HEADERS "${TCAMACEvent_SRCS}") # set everything needed for the root dictonary and create the # dictionary set(TCAMACEvent_LINKDEF TCAMACEventLinkDef.h ) set(TCAMACEvent_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/TCAMACEventDict.cxx) ROOT_GENERATE_DICTIONARY("${TCAMACEvent_HEADERS}" "${TCAMACEvent_LINKDEF}" "${TCAMACEvent_DICTIONARY}" "${INCLUDE_DIRECTORIES}") # add the dictionary to the list of source files SET(TCAMACEvent_SRCS ${TCAMACEvent_SRCS} ${TCAMACEvent_DICTIONARY}) ############### build the library ##################### add_library(TCAMACEvent SHARED ${TCAMACEvent_SRCS}) target_link_libraries(TCAMACEvent ${ROOT_LIBRARIES}) set_target_properties(TCAMACEvent PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES}) ############### install the library ################### install(TARGETS TCAMACEvent DESTINATION ${CMAKE_BINARY_DIR}/lib)