PMD module
[u/mrichter/AliRoot.git] / cmake / CMakeALICE.cmake
CommitLineData
fffaf6a5 1# General purpose functions
2
3# Generation of the dictionaries
4# @DNAME Dictionary name
5# @LDNAME LinkDef file name, ex: LinkDef.h
6# @DHDRS Dictionary headers
7# @DINCDIR Include folders that need to be passed to cint/cling
8macro(generate_dictionary DNAME LDNAME DHDRS DINCDIRS)
9 # Creating the INCLUDE path for cint/cling
10 foreach( dir ${DINCDIRS})
11 set(INCLUDE_PATH -I${dir} ${INCLUDE_PATH})
12 endforeach()
13
14 # Generate the dictionary
15 message(STATUS "Generating dictionary ${DNAME} for ${LDNAME}")
16
17# message(STATUS "${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx")
18# message(STATUS "${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.h")
19# message(STATUS "bbb${INCLUDE_PATH}bbb")
20# message(STATUS "${DHDRS} ${LDNAME}")
21# message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}")
22
23 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.h
24 COMMAND LD_LIBRARY_PATH=${ROOT_LIBDIR}:$ENV{LD_LIBRARY_PATH} ${ROOT_CINT}
25 ARGS -f ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx -c -p
26 ${INCLUDE_PATH}
27 ${DHDRS} ${LDNAME}
0224bae4 28 DEPENDS ${DHDRS} ${LDNAME} ${ROOT_CINT}
fffaf6a5 29 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
30 )
0224bae4 31endmacro(generate_dictionary)
32
33# Generate the ROOTmap files
34# @LIBNAME - library name: libAnalysis.so -> Analysis.rootmap
35# @LIBDEPS - library dependencies
36# @LINKDEF - LinkDef header
37macro(generate_rootmap LIBNAME LIBDEPS LINKDEF)
a0f34e87 38# message(STATUS "LIBNAME = ${LIBNAME}")
39# message(STATUS "LIBDEPS = ${LIBDEPS}")
40# message(STATUS "LINKDEF = ${LINKDEF}")
a0f34e87 41# message(STATUS "ROOT_LIBMAP=${ROOT_LIBMAP}")
0224bae4 42
a0f34e87 43 foreach(file ${LIBDEPS})
44 get_filename_component(ext ${file} EXT)
45 if(ext)
271875a7 46 set(LOCAL_DEPS ${LOCAL_DEPS} ${file})
0224bae4 47 else()
271875a7 48 set(LOCAL_DEPS ${LOCAL_DEPS} lib${file}.so)
0224bae4 49 endif()
50 endforeach()
51
52 message(STATUS "Generating ROOT map for ${LIBNAME}")
53 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lib${LIBNAME}.rootmap
54 COMMAND LD_LIBRARY_PATH=${ROOT_LIBDIR}:$ENV{LD_LIBRARY_PATH} ${ROOT_LIBMAP}
a0f34e87 55 ARGS -o ${CMAKE_CURRENT_BINARY_DIR}/lib${LIBNAME}.rootmap -l lib${LIBNAME}.so -d ${LOCAL_DEPS} -c ${LINKDEF}
0224bae4 56 DEPENDS ${LIBNAME}
57 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} VERBATIM
58 )
59 add_custom_target(lib${LIBNAME}.rootmap ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/lib${LIBNAME}.rootmap)
60 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${LIBNAME}.rootmap DESTINATION lib)
61
62endmacro(generate_rootmap)