# Create a library called "libCbmRutherford" 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} #put here all directories where header files are located ${CBMROOT_SOURCE_DIR}/fairtools ${CBMROOT_SOURCE_DIR}/base ${CBMROOT_SOURCE_DIR}/cbmbase ${CBMROOT_SOURCE_DIR}/cbmdata ${CBMROOT_SOURCE_DIR}/parbase ${CBMROOT_SOURCE_DIR}/geobase ${CBMROOT_SOURCE_DIR}/rutherford_example ) include_directories( ${INCLUDE_DIRECTORIES}) set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ) link_directories( ${LINK_DIRECTORIES}) set(CBMRUTHERFORD_SRCS #Put here your sourcefiles CbmRutherford.cxx CbmRutherfordContFact.cxx CbmRutherfordGeo.cxx CbmRutherfordGeoPar.cxx CbmRutherfordPoint.cxx ) # fill list of header files from list of source files # by exchanging the file extension CHANGE_FILE_EXTENSION(*.cxx *.h CBMRUTHERFORD_HEADERS "${CBMRUTHERFORD_SRCS}") set(CBMRUTHERFORD_LINKDEF CbmRutherfordLinkDef.h) set(CBMRUTHERFORD_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/CbmRutherfordDict.cxx) ROOT_GENERATE_DICTIONARY("${CBMRUTHERFORD_HEADERS}" "${CBMRUTHERFORD_LINKDEF}" "${CBMRUTHERFORD_DICTIONARY}" "${INCLUDE_DIRECTORIES}") set(CBMRUTHERFORD_SRCS ${CBMRUTHERFORD_SRCS} ${CBMRUTHERFORD_DICTIONARY}) add_library(CbmRutherford SHARED ${CBMRUTHERFORD_SRCS}) target_link_libraries(CbmRutherford ${ROOT_LIBRARIES}) set_target_properties(CbmRutherford PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES}) ################ install ################### install(TARGETS CbmRutherford DESTINATION ${CMAKE_BINARY_DIR}/lib)