-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (63 loc) · 2.7 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# **************************************************************************
# * Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
# * *
# * Author: The ALICE Off-line Project. *
# * Contributors are mentioned in the code where appropriate. *
# * *
# * Permission to use, copy, modify and distribute this software and its *
# * documentation strictly for non-commercial purposes is hereby granted *
# * without fee, provided that the above copyright notice appears in all *
# * copies and that both the copyright notice and this permission notice *
# * appear in the supporting documentation. The authors make no claims *
# * about the suitability of this software for any purpose. It is *
# * provided "as is" without express or implied warranty. *
# **************************************************************************
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
project(DPMJET)
enable_language(Fortran)
# Set by default DEBUG build type
# The optimisation affects the initialisation of COMMON blocks
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE DEBUG)
endif(NOT CMAKE_BUILD_TYPE)
cmake_policy(SET CMP0042 NEW)
# Use cmake ... -DFLUPRO=<directory containing libflukahp.a> ...
# if you want to build DPMJEt with Fluka support
if(FLUPRO)
link_directories(${FLUPRO})
set ( FSRCS dpmjet3.0-5F.f phojet1.12-35c4.f user3.0-5F.f openfile.f)
else(FLUPRO)
set ( FSRCS dpmjet3.0-5.f phojet1.12-35c3.f user3.0-5.f openfile.f)
endif(FLUPRO)
# Add specific version of PYTHIA6 files to the library
set(FSRCS ${FSRCS}
pythia6_common_block_address.F
tpythia6_called_from_cc.F
pythia6115dpm3.f
pdf_alice.F
pydummy.f
)
# Additional C sources needed by PYTHIA6
set(CSRCS
main.c
pythia6_common_address.c
)
# Add a library to the project using the specified source files
add_library(${PROJECT_NAME} SHARED ${FSRCS} ${CSRCS})
if(FLUPRO)
target_link_libraries(${PROJECT_NAME} flukahp)
endif(FLUPRO)
# System dependent: Modify the way the library is build
if(${CMAKE_SYSTEM} MATCHES Darwin)
set(CMAKE_Fortran_FLAGS "-undefined dynamic_lookup")
endif(${CMAKE_SYSTEM} MATCHES Darwin)
# Installation
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
# Install data files
install(FILES nuclear.bin DESTINATION data)
install(FILES fitpar.dat DESTINATION data)
install(FILES dpmjet.dat DESTINATION data)
install(DIRECTORY inp DESTINATION data FILES_MATCHING PATTERN "*.dat")
install(DIRECTORY doc DESTINATION .)