Fixes for object target dependencies
[u/mrichter/AliRoot.git] / LHAPDF / lhapdf5.5.1 / CMakeLists.txt
CommitLineData
6f2f7765 1# **************************************************************************
2# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
3# * *
4# * Author: The ALICE Off-line Project. *
5# * Contributors are mentioned in the code where appropriate. *
6# * *
7# * Permission to use, copy, modify and distribute this software and its *
8# * documentation strictly for non-commercial purposes is hereby granted *
9# * without fee, provided that the above copyright notice appears in all *
10# * copies and that both the copyright notice and this permission notice *
11# * appear in the supporting documentation. The authors make no claims *
12# * about the suitability of this software for any purpose. It is *
13# * provided "as is" without express or implied warranty. *
14# **************************************************************************
15
16# Module
17set(MODULE lhapdf)
18
19# Module include folder
20include_directories(${AliRoot_SOURCE_DIR}/LHAPDF/lhapdf5.5.1
21 ${AliRoot_SOURCE_DIR}/LHAPDF/lhapdf5.5.1/include
22 ${AliRoot_SOURCE_DIR}/LHAPDF/lhapdf5.5.1/src
23 )
24
25# Additional include folders in alphabetical order
26include_directories(
27 )
28
29# Sources in alphabetical order
30set(SRCS
31 ${AliRoot_SOURCE_DIR}/LHAPDF/AliStructFuncType.cxx
32 src/version.cxx
33 src/getdatapath.cxx
34 )
35
36# Headers
37set(HDRS
38 ${AliRoot_SOURCE_DIR}/LHAPDF/AliStructFuncType.h
39 )
40
41# C sources
42set(CSRCS
43 src/binreloc.c
44 )
45
46# Fortran sources
47set(FSRCS
48 src/alphas.f
49 src/commoninit.f
50 src/description.f
51 src/eks98.f
52 src/eksarp.f
53 src/eps08.f
54 src/eps09.f
55 src/EVLCTEQ.f
56 src/evolution.f
57 src/inputPDF.f
58 src/LHpdflib.F
59 src/parameter.f
60 src/QCDNUM.f
61 src/QCDparams.f
62 src/Sqcdnum.f
63 src/wrapa02.f
64 src/wrapa02m.f
65 src/wrapabfkwpi.f
66 src/wrapacfgpg.f
67 src/wrapcteq5.f
68 src/wrapcteq6.f
69 src/wrapcteq6lg.f
70 src/wrapdgg.f
71 src/wrapdog.f
72 src/wrapEVLCTEQ.f
73 src/wrapevolve.f
74 src/wrapgrv.f
75 src/wrapgrvg.f
76 src/wrapgrvpi.f
77 src/wrapgsg96.f
78 src/wrapgsg.f
79 src/wraph1.f
80 src/wraplacg.f
81 src/wrapowpi.f
82 src/wrapmrst.f
83 src/wrapQCDNUM3.f
84 src/wrapQCDNUM4.f
85 src/wrapQCDNUM.f
86 src/wrapsasg.f
87 src/wrapsmrspi.f
88 src/wrapwhitg.f
89 src/wrapzeus.f
90 src/lhaglue.f
91 src/wrapUSER.f
92 )
93
94# Generate the dictionary
95# It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
96get_directory_property(incdirs INCLUDE_DIRECTORIES)
97generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
98
99# Generate the ROOT map
100# Dependecies
101set(LIBDEPS Core)
102generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
103
104# Add a library to the project using the specified source files
105add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx ${CSRCS} ${FSRCS})
106add_definitions(-DDEFAULTPREFIXPATH="NONE" -DDEFAULTLHAPATH="${AliRoot_SOURCE_DIR}/LHAPDF/PDFsets")
107
108# Additional compilation and linking flags
109set(CMAKE_C_FLAGS "-ansi ${CMAKE_C_FLAGS}")
110set(CMAKE_Fortran_FLAGS "-cpp")
68aeb13b 111set(MODULE_COMPILE_FLAGS "")
6f2f7765 112set(MODULE_LINK_FLAGS)
113
114# System dependent: Modify the way the library is build
115if(${CMAKE_SYSTEM} MATCHES Darwin)
116 set(MODULE_LINK_FLAGS "-undefined dynamic_lookup ${MODULE_LINK_FLAGS}")
117endif(${CMAKE_SYSTEM} MATCHES Darwin)
118
119# Target properties
120set_target_properties(${MODULE} PROPERTIES FORTRAN_FLAGS "")
121set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}")
122set_target_properties(${MODULE} PROPERTIES Fortran_FORMAT FREE)
123set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
124
125# Installation
126install(TARGETS ${MODULE}
127 ARCHIVE DESTINATION lib
128 LIBRARY DESTINATION lib)
129install(FILES ${HDRS} DESTINATION include)