Skip to content

Commit be69648

Browse files
authored
GeneratorParam (#6)
* GeneratorParam ported from AliRoot * Copyright notice added * cleanup * format corrections
1 parent f0879f2 commit be69648

12 files changed

+7775
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ add_subdirectory(TEPEMGEN)
88

99
add_subdirectory(GeneratorCosmics)
1010

11+
add_subdirectory(GeneratorParam)
12+
1113
if (DEFINED ENV{HIJING_ROOT})
1214
add_subdirectory(THijing)
1315
endif (DEFINED ENV{HIJING_ROOT})

GeneratorParam/CMakeLists.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
2+
project(GeneratorParam)
3+
4+
# You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
5+
# - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
6+
# - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
7+
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
8+
9+
#---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
10+
find_package(ROOT REQUIRED COMPONENTS EG)
11+
12+
#---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
13+
include(${ROOT_USE_FILE})
14+
15+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/.)
16+
17+
set(HEADERS GeneratorParam.h GeneratorParamLibBase.h GeneratorParamMUONlib.h PythiaDecayerConfig.h)
18+
19+
ROOT_GENERATE_DICTIONARY(G__GeneratorParam ${HEADERS} LINKDEF GeneratorParamLinkDef.h)
20+
21+
#---Create a shared library with geneated dictionary
22+
add_library(GeneratorParam SHARED GeneratorParam.cxx GeneratorParamLibBase.cxx GeneratorParamMUONlib.cxx PythiaDecayerConfig.cxx G__GeneratorParam.cxx)
23+
target_link_libraries(GeneratorParam ${ROOT_LIBRARIES})
24+
25+
26+
set_target_properties(GeneratorParam
27+
PROPERTIES
28+
PUBLIC_HEADER "${HEADERS}" )
29+
30+
31+
install(TARGETS GeneratorParam
32+
LIBRARY DESTINATION lib
33+
PUBLIC_HEADER DESTINATION include)
34+
35+
if (${ROOT_VERSION} VERSION_GREATER "6.0")
36+
install(
37+
FILES
38+
${CMAKE_CURRENT_BINARY_DIR}/libGeneratorParam_rdict.pcm
39+
${CMAKE_CURRENT_BINARY_DIR}/libGeneratorParam.rootmap
40+
DESTINATION lib)
41+
endif (${ROOT_VERSION} VERSION_GREATER "6.0")
42+
43+
if(${CMAKE_SYSTEM} MATCHES Darwin)
44+
set_target_properties(GeneratorParam PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
45+
endif(${CMAKE_SYSTEM} MATCHES Darwin)

0 commit comments

Comments
 (0)