# 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} 
${GEANT3_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/geobase 
${CMAKE_SOURCE_DIR}/parbase 
${CMAKE_SOURCE_DIR}/base 
${CMAKE_SOURCE_DIR}/field 
${CMAKE_SOURCE_DIR}/mcstack
${CMAKE_SOURCE_DIR}/geane
${CMAKE_SOURCE_DIR}/trackbase
${CMAKE_SOURCE_DIR}/plane
${CMAKE_SOURCE_DIR}/geanepca
)

include_directories( ${INCLUDE_DIRECTORIES})

set(LINK_DIRECTORIES
${ROOT_LIBRARY_DIR}
)
 
link_directories( ${LINK_DIRECTORIES})

set(GEANEPCA_SRCS
CbmGeaneTrC.cxx
)

# fill list of header files from list of source files
# by exchanging the file extension
CHANGE_FILE_EXTENSION(*.cxx *.h GEANEPCA_HEADERS "${GEANEPCA_SRCS}")

set(GEANEPCA_LINKDEF GeanepcaLinkDef.h)
set(GEANEPCA_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/GeanepcaDict.cxx) 

ROOT_GENERATE_DICTIONARY("${GEANEPCA_HEADERS}" "${GEANEPCA_LINKDEF}" "${GEANEPCA_DICTIONARY}" "${INCLUDE_DIRECTORIES}")

SET(GEANEPCA_SRCS ${GEANEPCA_SRCS} ${GEANEPCA_DICTIONARY})

add_library(Geanepca SHARED ${GEANEPCA_SRCS})
target_link_libraries(Geanepca ${ROOT_LIBRARIES})
set_target_properties(Geanepca PROPERTIES VERSION 0.0.1 SOVERSION 0 )

################ install ###################
install(TARGETS Geanepca DESTINATION ${CMAKE_BINARY_DIR}/lib)
