IAP GITLAB

Commit 5292e114 authored by Colin Baus's avatar Colin Baus

fixed problem in flags for fortran objects and added rpaths for installed files

git-svn-id: https://devel-ik.fzk.de/svn/mc/crmc/trunk@2875 c7a5e08c-de06-0410-9364-b41cf42a0b17
parent 237a51ee
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
PROJECT (crmc)
# The version number.
SET (CRMC_VERSION_MAJOR 0)
SET (CRMC_VERSION_MINOR 1)
#hotfix for lxbatch not sure why he selects wrong compiler
#SET (CMAKE_Fortran_COMPILER gfortran)
#comprehensible compiler languages (default c cxx)
ENABLE_LANGUAGE (Fortran)
######################################ONLY EDIT THIS######################################
SET (CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR})
# Enable/Disble models to be built
OPTION (__QGSJET01__ "Build with model" ON)
......@@ -19,6 +13,36 @@ OPTION (__SIBYLL__ "Build with model" ON)
OPTION (__QGSJETII__ "Build with model" ON)
OPTION (CRMC_USE_BOOST "Build with boost and compression capability" ON)
######################################ONLY EDIT THIS######################################
# The version number
SET (CRMC_VERSION_MAJOR 0)
SET (CRMC_VERSION_MINOR 1)
# hotfix for lxbatch not sure why he selects wrong compiler
#SET (CMAKE_Fortran_COMPILER gfortran)
# comprehensible compiler languages (default c cxx)
ENABLE_LANGUAGE (Fortran)
## RPATH (where to find library)
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system directory
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
ENDIF("${isSystemDir}" STREQUAL "-1")
## find packages
SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules" CACHE PATH "Module Path" FORCE)
......@@ -40,45 +64,46 @@ CONFIGURE_FILE (
INCLUDE_DIRECTORIES ("${PROJECT_SOURCE_DIR}/src")
ADD_SUBDIRECTORY (src/epos)
SET (EXTRA_MODELS ${EXTRA_MODELS} Epos)
SET (CMAKE_Fortran_FLAGS "-D __EPOS__ ")
SET (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -D __EPOS__")
IF (__QGSJET01__)
ADD_SUBDIRECTORY ("${PROJECT_SOURCE_DIR}/src/qgsjet")
SET (EXTRA_MODELS ${EXTRA_MODELS} Qgsjet01)
SET (CMAKE_Fortran_FLAGS "-D __QGSJET01__ ")
SET (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -D __QGSJET01__")
ENDIF (__QGSJET01__)
IF (__GHEISHA__)
ADD_SUBDIRECTORY ("${PROJECT_SOURCE_DIR}/src/gheisha")
SET (EXTRA_MODELS ${EXTRA_MODELS} Gheisha)
SET (CMAKE_Fortran_FLAGS "-D __GHEISHA__ ")
SET (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -D __GHEISHA__")
ENDIF (__GHEISHA__)
IF (__PYTHIA__)
ADD_SUBDIRECTORY ("${PROJECT_SOURCE_DIR}/src/pythia")
SET (EXTRA_MODELS ${EXTRA_MODELS} Pythia)
SET (CMAKE_Fortran_FLAGS "-D __PYTHIA__ ")
SET (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -D __PYTHIA__")
ENDIF (__PYTHIA__)
IF (__HIJING__)
ADD_SUBDIRECTORY ("${PROJECT_SOURCE_DIR}/src/hijing")
SET (EXTRA_MODELS ${EXTRA_MODELS} Hijing)
SET (CMAKE_Fortran_FLAGS "-D __HIJING__ ")
SET (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -D __HIJING__")
ENDIF (__HIJING__)
IF (__SIBYLL__)
ADD_SUBDIRECTORY ("${PROJECT_SOURCE_DIR}/src/sibyll")
SET (EXTRA_MODELS ${EXTRA_MODELS} Sibyll)
SET (CMAKE_Fortran_FLAGS "-D __SIBYLL__ ")
SET (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -D __SIBYLL__")
ENDIF (__SIBYLL__)
IF (__QGSJETII__)
ADD_SUBDIRECTORY ("${PROJECT_SOURCE_DIR}/src/qgsjetII")
SET (EXTRA_MODELS ${EXTRA_MODELS} QgsjetII)
SET (CMAKE_Fortran_FLAGS "-D __QGSJETII__ ")
SET (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -D __QGSJETII__")
ENDIF (__QGSJETII__)
# add the executable
INCLUDE_DIRECTORIES ("${PROJECT_BINARY_DIR}/src") #cmake config file
INCLUDE_DIRECTORIES ("${HepMC_INCLUDE_DIRS}")
......@@ -86,14 +111,13 @@ INCLUDE_DIRECTORIES ("${Boost_INCLUDE_DIRS}")
INCLUDE_DIRECTORIES ("${ROOT_INCLUDE_DIR}")
ADD_EXECUTABLE(Crmc src/crmchep.cc src/crmctrapfpe.c src/crmc-aaa.f src/models.F)
# linking of modules
TARGET_LINK_LIBRARIES (Crmc ${HepMC_LIBRARIES})
TARGET_LINK_LIBRARIES (Crmc ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES (Crmc ${ROOT_LIBRARIES})
TARGET_LINK_LIBRARIES (Crmc ${EXTRA_MODELS})
## installation
SET (CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR})
# configure the parameter file
install(CODE "SET (CRMCROOT \"${PROJECT_BINARY_DIR}\")")
install(CODE "CONFIGURE_FILE (\"${PROJECT_SOURCE_DIR}/src/crmc.param.in\" \"${PROJECT_BINARY_DIR}/crmc.param\" @ONLY IMMEDIATE)")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment