IAP GITLAB

Commit 1a8746d5 authored by Colin Baus's avatar Colin Baus

-added the heart of the build system. The only thing that is missing is to...

-added the heart of the build system. The only thing that is missing is to compine Root and Na61 output in crmchep.cc

git-svn-id: https://devel-ik.fzk.de/svn/mc/crmc/trunk@2860 c7a5e08c-de06-0410-9364-b41cf42a0b17
parent 51cf6f46
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)
# Enable/Disble models to be built
OPTION (__QGSJET01__ "Build with model" ON)
OPTION (__GHEISHA__ "Build with model" OFF)
OPTION (__PYTHIA__ "Build with model" OFF)
OPTION (__HIJING__ "Build with model" OFF)
OPTION (__SIBYLL__ "Build with model" ON)
OPTION (__QGSJETII__ "Build with model" ON)
OPTION (CRMC_USE_BOOST "Build with boost and compression capability" ON)
## find packages
SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules" CACHE PATH "Module Path" FORCE)
FIND_PACKAGE (Root REQUIRED)
IF (CRMC_USE_BOOST)
FIND_PACKAGE (Boost REQUIRED COMPONENTS filesystem iostreams)
ELSE (CRMC_USE_BOOST)
FIND_PACKAGE (Boost REQUIRED COMPONENTS filesystem iostreams)
ENDIF (CRMC_USE_BOOST)
FIND_PACKAGE (HepMC REQUIRED COMPONENTS HepMC HepMCfio)
## configure a header file to pass some of the CMake settings to the source code
CONFIGURE_FILE (
"${PROJECT_SOURCE_DIR}/src/crmcconfig.h.in"
"${PROJECT_BINARY_DIR}/src/crmcconfig.h"
)
#add epos (must!)
INCLUDE_DIRECTORIES ("${PROJECT_SOURCE_DIR}/src")
ADD_SUBDIRECTORY (src/epos)
SET (EXTRA_MODELS ${EXTRA_MODELS} Epos)
SET (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__ ")
ENDIF (__QGSJET01__)
IF (__GHEISHA__)
ADD_SUBDIRECTORY ("${PROJECT_SOURCE_DIR}/src/gheisha")
SET (EXTRA_MODELS ${EXTRA_MODELS} Gheisha)
SET (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__ ")
ENDIF (__PYTHIA__)
IF (__HIJING__)
ADD_SUBDIRECTORY ("${PROJECT_SOURCE_DIR}/src/hijing")
SET (EXTRA_MODELS ${EXTRA_MODELS} Hijing)
SET (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__ ")
ENDIF (__SIBYLL__)
IF (__QGSJETII__)
ADD_SUBDIRECTORY ("${PROJECT_SOURCE_DIR}/src/qgsjetII")
SET (EXTRA_MODELS ${EXTRA_MODELS} QgsjetII)
SET (CMAKE_Fortran_FLAGS "-D __QGSJETII__ ")
ENDIF (__QGSJETII__)
# add the executable
INCLUDE_DIRECTORIES ("${PROJECT_BINARY_DIR}/src") #cmake config file
INCLUDE_DIRECTORIES ("${HepMC_INCLUDE_DIRS}")
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)
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)")
# install tabs
if(CMAKE_HOST_UNIX)
install(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_SOURCE_DIR}/tabs ${PROJECT_BINARY_DIR}/tabs)")
endif(CMAKE_HOST_UNIX)
# install executable
INSTALL (PROGRAMS ${PROJECT_SOURCE_DIR}/src/crmc.py DESTINATION bin)
INSTALL (PROGRAMS ${PROJECT_BINARY_DIR}/Crmc DESTINATION bin RENAME crmc)
# enable dashboard scripting
include (CTest)
ADD_TEST (CrmcRuns bin/crmc -s 123 -f ctest)
ADD_TEST (CrmcCheckFile md5sum "ctest")
SET_TESTS_PROPERTIES (CrmcCheckFile PROPERTIES PASS_REGULAR_EXPRESSION ".*13a1067a443279b3e397eab0e58e2e4e ctest")
ADD_TEST (CrmcRemoveFile rm "ctest")
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