# Create a library called "libBase" 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}/base ${CMAKE_SOURCE_DIR}/parbase ${CMAKE_SOURCE_DIR}/trackbase ) include_directories( ${INCLUDE_DIRECTORIES}) set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ) link_directories( ${LINK_DIRECTORIES}) set(TRKBASE_SRCS CbmTrackPar.cxx CbmTrackParH.cxx CbmTrackParP.cxx ) # fill list of header files from list of source files # by exchanging the file extension CHANGE_FILE_EXTENSION(*.cxx *.h TRKBASE_HEADERS "${TRKBASE_SRCS}") set(TRKBASE_LINKDEF TrackBaseLinkDef.h) set(TRKBASE_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/TrackBaseDict.cxx) ROOT_GENERATE_DICTIONARY("${TRKBASE_HEADERS}" "${TRKBASE_LINKDEF}" "${TRKBASE_DICTIONARY}" "${INCLUDE_DIRECTORIES}") set(TRKBASE_SRCS ${TRKBASE_SRCS} ${TRKBASE_DICTIONARY}) add_library(TrkBase SHARED ${TRKBASE_SRCS}) target_link_libraries(TrkBase ${ROOT_LIBRARIES}) set_target_properties(TrkBase PROPERTIES VERSION 0.0.1 SOVERSION 0 ) ################ install ################### install(TARGETS TrkBase DESTINATION ${CMAKE_BINARY_DIR}/lib)