Skip to content

Commit

Permalink
SlowNucleon Generator added (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
amorsch authored Nov 26, 2020
1 parent be69648 commit d5652e1
Show file tree
Hide file tree
Showing 10 changed files with 1,014 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ add_subdirectory(GeneratorCosmics)

add_subdirectory(GeneratorParam)

add_subdirectory(GeneratorSlowNucleons)

if (DEFINED ENV{HIJING_ROOT})
add_subdirectory(THijing)
endif (DEFINED ENV{HIJING_ROOT})
Expand Down
45 changes: 45 additions & 0 deletions GeneratorSlowNucleons/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(GeneratorSlowNucleons)

# You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
# - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
# - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})

#---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
find_package(ROOT REQUIRED COMPONENTS EG)

#---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
include(${ROOT_USE_FILE})

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/.)

set(HEADERS GeneratorSlowNucleons.h SlowNucleonModel.h SlowNucleonModelExp.h)

ROOT_GENERATE_DICTIONARY(G__GeneratorSlowNucleons ${HEADERS} LINKDEF GeneratorSlowNucleonsLinkDef.h)

#---Create a shared library with geneated dictionary
add_library(GeneratorSlowNucleons SHARED GeneratorSlowNucleons.cxx SlowNucleonModel.cxx SlowNucleonModelExp.cxx G__GeneratorSlowNucleons.cxx)
target_link_libraries(GeneratorSlowNucleons ${ROOT_LIBRARIES})


set_target_properties(GeneratorSlowNucleons
PROPERTIES
PUBLIC_HEADER "${HEADERS}" )


install(TARGETS GeneratorSlowNucleons
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include)

if (${ROOT_VERSION} VERSION_GREATER "6.0")
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/libGeneratorSlowNucleons_rdict.pcm
${CMAKE_CURRENT_BINARY_DIR}/libGeneratorSlowNucleons.rootmap
DESTINATION lib)
endif (${ROOT_VERSION} VERSION_GREATER "6.0")

if(${CMAKE_SYSTEM} MATCHES Darwin)
set_target_properties(GeneratorSlowNucleons PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif(${CMAKE_SYSTEM} MATCHES Darwin)
Loading

0 comments on commit d5652e1

Please sign in to comment.