# Create a library called "libCbmBase" 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} ${CBMROOT_SOURCE_DIR}/geobase ${CBMROOT_SOURCE_DIR}/base ${CBMROOT_SOURCE_DIR}/cbmbase ${CBMROOT_SOURCE_DIR}/cbmdata ${CBMROOT_SOURCE_DIR}/cbmdata/sts ${CBMROOT_SOURCE_DIR}/cbmdata/much ${CBMROOT_SOURCE_DIR}/cbmdata/rich /misc/friese/cbm/ROC/trunk/roclib ) include_directories( ${INCLUDE_DIRECTORIES}) set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ${CMAKE_SOURCE_DIR}/base ) link_directories( ${LINK_DIRECTORIES}) set(CBMBASE_SRCS CbmDigiManager.cxx CbmPrimaryGenerator.cxx CbmPropagator.cxx CbmTrdTrackFinder.cxx CbmTrdTrackFitter.cxx CbmStsTrackFinder.cxx CbmStsTrackFitter.cxx CbmMuchTrackFinder.cxx CbmRichRingFinder.cxx CbmRichRingFitter.cxx CbmRichTrackExtrapolation.cxx CbmRichRingTrackAssign.cxx CbmRichRingSelect.cxx CbmGlobalTrackFitter.cxx CbmPrimaryVertexFinder.cxx CbmRichMerger.cxx CbmTofMerger.cxx CbmTrackMerger.cxx CbmTbReceiver.cxx CbmTbDaqMap.cxx ) # Add definition to the compile statements, which is needed on Linux # systems according to the old Makefile of libLMD ADD_DEFINITIONS(-DFILEONLY) if(RULE_CHECKER_FOUND) CHECK_RULES("${CBMBASE_SRCS}" "${INCLUDE_DIRECTORIES}" CBMBASE_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 CBMBASE_HEADERS "${CBMBASE_SRCS}") SET(CBMBASE_HEADERS ${CBMBASE_HEADERS} CbmDetectorList.h) set(CBMBASE_LINKDEF CbmBaseLinkDef.h) set(CBMBASE_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/CbmBaseDict.cxx) # The header files for the lmd handling contain macro constructs which # cannot be handled by the CINT preprocessor. Therefore we have to use # the compiler's preprocessor. This is done by adding the flag "-p" in # the rootcint call. This feature is not forseen in the normal CMake # macro, so all the rootcint stuff is done explicitly here. set(_INCLUDE_DIRS) foreach (_current_FILE ${INCLUDE_DIRECTORIES}) set(_INCLUDE_DIRS ${_INCLUDE_DIRS} -I${_current_FILE}) endforeach (_current_FILE ${INCLUDE_DIRECTORIES}) STRING(REGEX REPLACE "^(.*)\\.(.*)$" "\\1.h" bla "${TESTBEAM_DICTIONARY}") SET (OUTFILES ${CBMBASE_DICTIONARY} ${bla}) if (CMAKE_SYSTEM_NAME MATCHES Linux) ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES} COMMAND LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR} ROOTSYS=${ROOTSYS} ${ROOT_CINT_EXECUTABLE} ARGS -f ${CBMBASE_DICTIONARY} -c -p -DHAVE_CONFIG_H ${_INCLUDE_DIRS} ${CBMBASE_HEADERS} ${CBMBASE_LINKDEF} DEPENDS ${CBMBASE_HEADERS} ${CBMBASE_LINKDEF}) else (CMAKE_SYSTEM_NAME MATCHES Linux) if (CMAKE_SYSTEM_NAME MATCHES Darwin) ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES} COMMAND DYLD_LIBRARY_PATH=${ROOT_LIBRARY_DIR} ROOTSYS=${ROOTSYS} ${ROOT_CINT_EXECUTABLE} ARGS -f ${CBMBASE_DICTIONARY} -c -p -DHAVE_CONFIG_H ${_INCLUDE_DIRS} ${CBMBASE_HEADERS} ${CBMBASE_LINKDEF} DEPENDS ${CBMBASE_HEADERS} ${CBMBASE_LINKDEF}) endif (CMAKE_SYSTEM_NAME MATCHES Darwin) endif (CMAKE_SYSTEM_NAME MATCHES Linux) SET(CBMBASE_SRCS ${CBMBASE_SRCS} ${CBMBASE_DICTIONARY}) add_library(CbmBase SHARED ${CBMBASE_SRCS}) target_link_libraries(CbmBase ${ROOT_LIBRARIES}) set_target_properties(CbmBase PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES}) ################ install ################### install(TARGETS CbmBase DESTINATION ${CMAKE_BINARY_DIR}/lib)