-
Notifications
You must be signed in to change notification settings - Fork 15
/
CMakeLists.txt
93 lines (76 loc) · 2.58 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(star-picoDst LANGUAGES CXX)
# Add to path in order to pick up the FindXXX.cmake files included in this project
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# By default build shared libraries but allow the user to change if desired
OPTION(BUILD_SHARED_LIBS "Global flag to cause add_library to create shared libraries if on" ON)
# Special treatment of linker options for MacOS X to get a linux-like behavior for gcc
if(APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -undefined dynamic_lookup")
endif()
# This project depends on ROOT
find_package(ROOT)
if( ${ROOT_CXX_FLAGS} MATCHES "-m32" )
message(STATUS "Found -m32 option in $ROOT_CXX_FLAGS (root-config). Will add it to $CMAKE_CXX_FLAGS")
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" )
endif()
find_package(STAR)
set(CMAKE_CXX_STANDARD 11)
add_definitions(-D__ROOT__)
include_directories(
${ROOT_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${STAR_INCLUDE_DIRS}
star-local/
)
add_library(
StPicoDstMaker
StPicoDstMaker/StPicoDstMaker.cxx
StPicoDstMaker/StPicoBbcFiller.cxx
StPicoDstMaker/StPicoEpdFiller.cxx
StPicoDstMaker/StPicoFmsFiller.cxx
StPicoDstMaker/StPicoUtilities.cxx
)
root_generate_dictionary(
StPicoEvent_dict
StPicoEvent/StPicoBTowHit.h
StPicoEvent/StPicoBTofHit.h
StPicoEvent/StPicoBTofPidTraits.h
StPicoEvent/StPicoBEmcPidTraits.h
StPicoEvent/StPicoEmcTrigger.h
StPicoEvent/StPicoEvent.h
StPicoEvent/StPicoFmsHit.h
StPicoEvent/StPicoMtdHit.h
StPicoEvent/StPicoMtdPidTraits.h
StPicoEvent/StPicoMtdTrigger.h
StPicoEvent/StPicoBbcHit.h
StPicoEvent/StPicoEpdHit.h
StPicoEvent/StPicoTrack.h
StarClassLibrary/StThreeVector.hh
LINKDEF StPicoEvent/LinkDef.h
)
add_library(
StPicoEvent
StPicoEvent/StPicoArrays.cxx
StPicoEvent/StPicoDst.cxx
StPicoEvent/StPicoBTowHit.cxx
StPicoEvent/StPicoBTofHit.cxx
StPicoEvent/StPicoBTofPidTraits.cxx
StPicoEvent/StPicoBEmcPidTraits.cxx
StPicoEvent/StPicoCommon.cxx
StPicoEvent/StPicoEmcTrigger.cxx
StPicoEvent/StPicoEvent.cxx
StPicoEvent/StPicoFmsHit.cxx
StPicoEvent/StPicoMtdHit.cxx
StPicoEvent/StPicoMtdPidTraits.cxx
StPicoEvent/StPicoMtdTrigger.cxx
StPicoEvent/StPicoBbcHit.cxx
StPicoEvent/StPicoEpdHit.cxx
StPicoEvent/StPicoTrack.cxx
StPicoEvent_dict.cxx
)
install(TARGETS StPicoDstMaker StPicoEvent
LIBRARY DESTINATION "${STAR_ADDITIONAL_INSTALL_PREFIX}/lib" OPTIONAL
ARCHIVE DESTINATION "${STAR_ADDITIONAL_INSTALL_PREFIX}/lib" OPTIONAL)