# Create a library called "libSTA" 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 ${CMAKE_SOURCE_DIR}/fairtools ${CMAKE_SOURCE_DIR}/base ${CMAKE_SOURCE_DIR}/r3bbase ${CMAKE_SOURCE_DIR}/passive ${CMAKE_SOURCE_DIR}/mcstack ${CMAKE_SOURCE_DIR}/CommonStruct/TRootEvent ${CMAKE_SOURCE_DIR}/LAND/LandUnpack ${CMAKE_SOURCE_DIR}/asyeosdata ${CMAKE_SOURCE_DIR}/LAND/LandUnpack/STA ${CMAKE_SOURCE_DIR}/LAND/LandUnpack/STA/STA ${CMAKE_SOURCE_DIR}/parbase ${CMAKE_SOURCE_DIR}/geobase ) include_directories( ${INCLUDE_DIRECTORIES}) set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ) link_directories( ${LINK_DIRECTORIES}) set(STA_SRCS #Put here your sourcefiles STA/Vector.cxx STA/LandHit.cxx; STA/LandParticle.cxx; STA/LandEvent.cxx; STA/STA.cxx; StaLandAdapter.cxx; ) # fill list of header files from list of source files # by exchanging the file extension CHANGE_FILE_EXTENSION(*.cxx *.h STA_HEADERS "${STA_SRCS}") set(STA_LINKDEF STALinkDef.h) set(STA_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/STADict.cxx) ROOT_GENERATE_DICTIONARY("${STA_HEADERS}" "${STA_LINKDEF}" "${STA_DICTIONARY}" "${INCLUDE_DIRECTORIES}") set(STA_SRCS ${STA_SRCS} ${STA_DICTIONARY}) add_library(STA SHARED ${STA_SRCS}) target_link_libraries(STA ${ROOT_LIBRARIES}) set_target_properties(STA PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES}) ################ install ################### install(TARGETS STA DESTINATION ${CMAKE_BINARY_DIR}/lib)