# Create a library called "" 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}/parbase ${CMAKE_SOURCE_DIR}/base ${CMAKE_SOURCE_DIR}/bfield ) include_directories( ${INCLUDE_DIRECTORIES}) set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ) link_directories( ${LINK_DIRECTORIES}) set(BFIELD_SRCS PandaFieldMapSim1.cxx ) # fill list of header files from list of source files # by exchanging the file extension CHANGE_FILE_EXTENSION(*.cxx *.h BFIELD_HEADERS "${BFIELD_SRCS}") set(BFIELD_LINKDEF BFieldLinkDef.h) set(BFIELD_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/BFieldDict.cxx) ROOT_GENERATE_DICTIONARY("${BFIELD_HEADERS}" "${BFIELD_LINKDEF}" "${BFIELD_DICTIONARY}" "${INCLUDE_DIRECTORIES}") SET(BFIELD_SRCS ${BFIELD_SRCS} ${BFIELD_DICTIONARY}) add_library(BField SHARED ${BFIELD_SRCS}) target_link_libraries(BField ${ROOT_LIBRARIES}) set_target_properties(BField PROPERTIES VERSION 0.0.1 SOVERSION 0 ) ################ install ################### install(TARGETS BField DESTINATION ${CMAKE_BINARY_DIR}/lib)