# Create a library called "libCbmKolkataDetector" 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}/KolkataDetector ) include_directories( ${INCLUDE_DIRECTORIES}) set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ) link_directories( ${LINK_DIRECTORIES}) set(CBMKOLKATADETECTOR_SRCS #Put here your sourcefiles CbmKolkataDetector.cxx CbmKolkataDetectorContFact.cxx CbmKolkataDetectorGeo.cxx CbmKolkataDetectorGeoPar.cxx CbmKolkataDetectorPoint.cxx ) # fill list of header files from list of source files # by exchanging the file extension CHANGE_FILE_EXTENSION(*.cxx *.h CBMKOLKATADETECTOR_HEADERS "${CBMKOLKATADETECTOR_SRCS}") set(CBMKOLKATADETECTOR_LINKDEF CbmKolkataDetectorLinkDef.h) set(CBMKOLKATADETECTOR_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/CbmKolkataDetectorDict.cxx) ROOT_GENERATE_DICTIONARY("${CBMKOLKATADETECTOR_HEADERS}" "${CBMKOLKATADETECTOR_LINKDEF}" "${CBMKOLKATADETECTOR_DICTIONARY}" "${INCLUDE_DIRECTORIES}") set(CBMKOLKATADETECTOR_SRCS ${CBMKOLKATADETECTOR_SRCS} ${CBMKOLKATADETECTOR_DICTIONARY}) add_library(CbmKolkataDetector SHARED ${CBMKOLKATADETECTOR_SRCS}) target_link_libraries(CbmKolkataDetector ${ROOT_LIBRARIES}) set_target_properties(CbmKolkataDetector PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES}) ################ install ################### install(TARGETS CbmKolkataDetector DESTINATION ${CMAKE_BINARY_DIR}/lib)