Preliminary files for CMake
[u/mrichter/AliRoot.git] / TFluka / CMakeLists.txt
1 # -*- mode: cmake -*-
2 # Create a library called "lib<name>" which includes the source files given in
3 # the array .
4 # The extension is already found.  Any number of sources could be listed here.
5
6 set(INCLUDE_DIRECTORIES
7 ${CMAKE_SOURCE_DIR}/TFluka
8 ${CMAKE_SOURCE_DIR}/include 
9 ${ROOT_INCLUDE_DIR}
10 )
11
12 include_directories( ${INCLUDE_DIRECTORIES})
13
14 set(LINK_DIRECTORIES
15 ${ROOT_LIBRARY_DIR}
16
17
18 link_directories( ${LINK_DIRECTORIES})
19
20 SetModule()
21
22 set(TFluka_SRCS
23 TFluka.cxx
24 TFlukaMCGeometry.cxx
25 TFlukaCerenkov.cxx
26 TFlukaConfigOption.cxx
27 TFlukaScoringOption.cxx
28 magfld.cxx
29 source.cxx
30 mgdraw.cxx
31 bxdraw.cxx
32 eedraw.cxx
33 endraw.cxx
34 sodraw.cxx
35 usdraw.cxx
36 stupre.cxx
37 stuprf.cxx
38 abscff.cxx
39 dffcff.cxx
40 queffc.cxx
41 rflctv.cxx
42 rfrndx.cxx
43 )
44 set(TFluka_FSRCS
45 FLUKA_input.f
46 crnkvp.f
47 )
48
49 If(RULE_CHECKER_FOUND)
50   CHECK_RULES("${TFluka_SRCS}" "${INCLUDE_DIRECTORIES}" TFluka_RULES)
51 endIf(RULE_CHECKER_FOUND)
52
53 # fill list of header files from list of source files
54 # by exchanging the file extension
55 CHANGE_FILE_EXTENSION(*.cxx *.h TFluka_HEADERS "${TFluka_SRCS}")
56
57 set(TFluka_LINKDEF TFlukaLinkDef.h)
58 set(TFluka_DICTIONARY ${CMAKE_CURRENT_BINARY_DIR}/TFlukaDict.cxx) 
59
60 ROOT_GENERATE_DICTIONARY("${TFluka_HEADERS}" "${TFluka_LINKDEF}" "${TFluka_DICTIONARY}" "${INCLUDE_DIRECTORIES}")
61
62 set(TFluka_SRCS ${TFluka_SRCS} ${TFluka_DICTIONARY})
63
64 add_library(TFluka SHARED ${TFluka_SRCS}  ${TFluka_FSRCS})
65 target_link_libraries(TFluka ${ROOT_LIBRARIES})
66 #set_target_properties(TFluka PROPERTIES  ${CBMROOT_LIBRARY_PROPERTIES})
67 SET_TARGET_PROPERTIES(TFluka PROPERTIES LINKER_LANGUAGE CXX)
68
69 ################ install ###################
70 install(TARGETS TFluka DESTINATION ${CMAKE_BINARY_DIR}/lib)
71