# Build ${libname} # Define all header and source files which are needed # to build the MathCore library Set(libname ) # Find all headers except the LinkDef file and copy # them to the include subdirectory of the build directory File(GLOB ${libname}Headers "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/inc/*.h" ) List(REMOVE_ITEM ${libname}Headers "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/inc/LinkDef.h" ) INSTALL_HEADERS("${libname}Headers") # Find all source files File(GLOB ${libname}Source "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cxx" ) List(REMOVE_ITEM ${libname}Source "${CMAKE_CURRENT_SOURCE_DIR}" ) # Define the LinkDef and the output file which are needed # to create the dictionary. # Definde the needed include directories and create the Dictionary Set(LinkDef ${CMAKE_CURRENT_SOURCE_DIR}/inc/LinkDef.h) Set(Dictionary ${CMAKE_CURRENT_BINARY_DIR}/G__${libname}.cxx) Set(INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/hist/hist/inc ${CMAKE_SOURCE_DIR}/cint/cint/include ${CMAKE_SOURCE_DIR}/cint/cint/stl ${CMAKE_SOURCE_DIR}/cint/cint/lib ) GENERATE_DICTIONARY("${${libname}Headers}" "${LinkDef}" "${Dictionary}" "${INCLUDE_DIRS}" "" ) Set(INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/inc # ${CMAKE_SOURCE_DIR}/hist/hist/inc # ${CMAKE_SOURCE_DIR}/core/meta/inc # ${CMAKE_SOURCE_DIR}/core/base/inc ${ROOT_INCLUDE_DIR} ) Set(DEPENDENCIES ) GENERATE_ROOTMAP("${LinkDef}" ${libname} ${DEPENDENCIES}) include_directories( ${INCLUDE_DIRECTORIES}) # Here all objects ar put together into one share library Add_Library(${libname} SHARED ${${libname}Source} ${Dictionary}) Target_Link_Libraries(${libname} ${DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT}) Set_Target_properties(${libname} PROPERTIES ${ROOT_LIBRARY_PROPERTIES}) Install(TARGETS ${libname} DESTINATION ${LIB_INSTALL_DIR}) # Define all the header files which should be installed when # doing a "make install" Install(FILES ${${libname}Headers} DESTINATION ${INCLUDE_INSTALL_DIR})