FindROOT + dictionary generating macro
[u/mrichter/AliRoot.git] / cmake / CMakeALICE.cmake
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
8 macro(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}
28                        DEPENDS ${DHDRS} ${LDNAME}
29                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
30                       )
31 endmacro(generate_dictionary)