Converting HIJING to native cmake
authorhristov <Peter.Hristov@cern.ch>
Fri, 14 Nov 2014 13:56:14 +0000 (14:56 +0100)
committeragrigora <alina.grigoras@cern.ch>
Mon, 15 Dec 2014 12:51:55 +0000 (13:51 +0100)
CMakeLists.txt
HIJING/CMakeLists.txt
HIJING/CMakelibhijing.pkg [deleted file]
HIJING/HIJINGLinkDef.h [moved from HIJING/hijingLinkDef.h with 100% similarity]

index b6656af..432bcd7 100644 (file)
@@ -123,6 +123,7 @@ if(CMAKE_Fortran_COMPILER)
   add_subdirectory(TEPEMGEN)
   add_subdirectory(THbtp)
   add_subdirectory(THijing)
+  add_subdirectory(HIJING)
 endif(CMAKE_Fortran_COMPILER)
 
 add_subdirectory(EVGEN)
index 493d447..3227cd1 100644 (file)
@@ -1,10 +1,67 @@
-# AliRoot Build System CMakeLists for HIJING
-#
-# Author: Johny Jose m(johny.jose@cern.ch)
-#         Port of previous Makefile build to cmake
+# **************************************************************************
+# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+# *                                                                        *
+# * Author: The ALICE Off-line Project.                                    *
+# * Contributors are mentioned in the code where appropriate.              *
+# *                                                                        *
+# * Permission to use, copy, modify and distribute this software and its   *
+# * documentation strictly for non-commercial purposes is hereby granted   *
+# * without fee, provided that the above copyright notice appears in all   *
+# * copies and that both the copyright notice and this permission notice   *
+# * appear in the supporting documentation. The authors make no claims     *
+# * about the suitability of this software for any purpose. It is          *
+# * provided "as is" without express or implied warranty.                  *
+# **************************************************************************
 
-cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
+# Module
+set(MODULE HIJING)
 
-file(GLOB PACKAGES CMake*.pkg)
+# Module include folder
+include_directories(${AliRoot_SOURCE_DIR}/${MODULE}
+                   )
 
-ALICE_BuildModule()
+# Additional include folders in alphabetical order except ROOT
+include_directories(${ROOT_INCLUDE_DIRS}
+                    ${AliRoot_SOURCE_DIR}/HIJING/hijing
+                   )
+
+# Sources
+set(SRCS
+  AliHijingRndm.cxx
+)
+
+set(FSRCS
+hijing1_36/ar3jet.F hijing1_36/aran9.F hijing1_36/arorie.F hijing1_36/atrobo.F hijing1_36/attflv.F hijing1_36/attrad.F hijing1_36/bk.F hijing1_36/crsjet.F hijing1_36/fgp1.F hijing1_36/fgp2.F hijing1_36/fgp3.F hijing1_36/fhin.F hijing1_36/fjet.F hijing1_36/fjetrig.F hijing1_36/flap.F hijing1_36/flap1.F hijing1_36/flap2.F hijing1_36/fnjet.F hijing1_36/fnkick.F hijing1_36/fnkick2.F hijing1_36/fnstru.F hijing1_36/fnstrum.F hijing1_36/fnstrus.F hijing1_36/ftot.F hijing1_36/ftotjet.F hijing1_36/ftotrig.F hijing1_36/g.F hijing1_36/gauss1.F hijing1_36/gauss2.F hijing1_36/gauss3.F hijing1_36/gauss4.F hijing1_36/ghvq.F hijing1_36/gmin.F hijing1_36/gmre.F hijing1_36/gphoton.F hijing1_36/hiboost.F hijing1_36/hidata.F hijing1_36/hifun.F hijing1_36/hijcrs.F hijing1_36/hijcsc.F hijing1_36/hijels.F hijing1_36/hijflv.F hijing1_36/hijfrg.F hijing1_36/hijhrd.F hijing1_36/hijing.F hijing1_36/hijini.F hijing1_36/hijset.F hijing1_36/hijsft.F hijing1_36/hijsrt.F hijing1_36/hijwds.F hijing1_36/hiptdi.F hijing1_36/hirnd.F hijing1_36/hirnd2.F hijing1_36/jetini.F hijing1_36/omg0.F hijing1_36/parton.F hijing1_36/profile.F hijing1_36/quench.F hijing1_36/romg.F hijing1_36/rwdsax.F hijing1_36/sgmin.F hijing1_36/subcrs1.F hijing1_36/subcrs2.F hijing1_36/subcrs3.F hijing1_36/subcrs4.F hijing1_36/subcrs5.F hijing1_36/subcrs6.F hijing1_36/subcrs7.F hijing1_36/title.F hijing1_36/vegas.F hijing1_36/wdsax.F hijing1_36/wdsax1.F hijing1_36/wdsax2.F hipyset1_35/hirobo.F hipyset1_35/klu_hijing.F hipyset1_35/lu1ent_hijing.F hipyset1_35/lu2ent_hijing.F hipyset1_35/lu3ent_hijing.F hipyset1_35/lu4ent_hijing.F hipyset1_35/luboei_hijing.F hipyset1_35/lucell_hijing.F hipyset1_35/luchge_hijing.F hipyset1_35/luclus_hijing.F hipyset1_35/lucomp_hijing.F hipyset1_35/ludata_hijing.F hipyset1_35/ludecy_hijing.F hipyset1_35/luedit_hijing.F hipyset1_35/lueevt_hijing.F hipyset1_35/luerrm_hijing.F hipyset1_35/luexec_hijing.F hipyset1_35/lufowo_hijing.F hipyset1_35/lugive_hijing.F hipyset1_35/luhepc_hijing.F hipyset1_35/luindf_hijing.F hipyset1_35/lujmas_hijing.F hipyset1_35/lujoin_hijing.F hipyset1_35/lukfdi_hijing.F hipyset1_35/lulist_hijing.F hipyset1_35/luname_hijing.F hipyset1_35/luonia_hijing.F hipyset1_35/luprep_hijing.F hipyset1_35/luptdi_hijing.F hipyset1_35/luradk_hijing.F hipyset1_35/lurobo_hijing.F hipyset1_35/lushow_hijing.F hipyset1_35/lusphe_hijing.F hipyset1_35/lustrf_hijing.F hipyset1_35/lutabu_hijing.F hipyset1_35/lutest_hijing.F hipyset1_35/luthru_hijing.F hipyset1_35/luupda_hijing.F hipyset1_35/lux3jt_hijing.F hipyset1_35/lux4jt_hijing.F hipyset1_35/luxdif_hijing.F hipyset1_35/luxjet_hijing.F hipyset1_35/luxkfl_hijing.F hipyset1_35/luxtot_hijing.F hipyset1_35/luzdis_hijing.F hipyset1_35/plu_hijing.F hipyset1_35/pydata_hijing.F hipyset1_35/pydiff_hijing.F hipyset1_35/pyfram_hijing.F hipyset1_35/pygamm_hijing.F hipyset1_35/pyi3au_hijing.F hipyset1_35/pyinit_hijing.F hipyset1_35/pyinki_hijing.F hipyset1_35/pyinre_hijing.F hipyset1_35/pykcut_hijing.F hipyset1_35/pyklim_hijing.F hipyset1_35/pykmap_hijing.F hipyset1_35/pymaxi_hijing.F hipyset1_35/pymult_hijing.F hipyset1_35/pyovly_hijing.F hipyset1_35/pyrand_hijing.F hipyset1_35/pyremn_hijing.F hipyset1_35/pyresd_hijing.F hipyset1_35/pyscat_hijing.F hipyset1_35/pysigh_hijing.F hipyset1_35/pyspen_hijing.F hipyset1_35/pyspli_hijing.F hipyset1_35/pysspa_hijing.F hipyset1_35/pystat_hijing.F hipyset1_35/pystfe_hijing.F hipyset1_35/pystfu_hijing.F hipyset1_35/pytest_hijing.F hipyset1_35/pythia_hijing.F hipyset1_35/pyw1au_hijing.F hipyset1_35/pyw2au_hijing.F hipyset1_35/pywidt_hijing.F hipyset1_35/pyxtot_hijing.F hipyset1_35/ulalps_hijing.F hipyset1_35/ulangl_hijing.F hipyset1_35/ulmass_hijing.F
+)
+
+# Headers from sources
+string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
+
+# Generate the dictionary
+# It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
+get_directory_property(incdirs INCLUDE_DIRECTORIES)
+generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
+
+# Generate the ROOT map
+# Dependecies
+set(LIBDEPS )
+generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
+
+# Add a library to the project using the specified source files
+add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx ${FSRCS})
+
+# Additional compilation flags
+set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+
+# System dependent: Modify the way the library is build
+if(${CMAKE_SYSTEM} MATCHES Darwin)
+    set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
+endif(${CMAKE_SYSTEM} MATCHES Darwin)
+
+# Installation
+install(TARGETS ${MODULE}
+  ARCHIVE DESTINATION lib
+  LIBRARY DESTINATION lib)
+install(FILES ${HDRS} DESTINATION include)
+
+message(STATUS "${MODULE} enabled")
diff --git a/HIJING/CMakelibhijing.pkg b/HIJING/CMakelibhijing.pkg
deleted file mode 100644 (file)
index 7f37d97..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#--------------------------------------------------------------------------------#
-# Package File for hijing                                                        #
-# Author : Johny Jose (johny.jose@cern.ch)                                       #
-# Variables Defined :                                                            #
-#                                                                                #
-# SRCS - C++ source files                                                        #
-# HDRS - C++ header files                                                        #
-# DHDR - ROOT Dictionary Linkdef header file                                     #
-# CSRCS - C source files                                                         #
-# CHDRS - C header files                                                         #
-# EINCLUDE - Include directories                                                 #
-# EDEFINE - Compiler definitions                                                 #
-# ELIBS - Extra libraries to link                                                #
-# ELIBSDIR - Extra library directories                                           #
-# PACKFFLAGS - Fortran compiler flags for package                                #
-# PACKCXXFLAGS - C++ compiler flags for package                                  #
-# PACKCFLAGS - C compiler flags for package                                      #
-# PACKSOFLAGS - Shared library linking flags                                     #
-# PACKLDFLAGS - Module linker flags                                              #
-# PACKBLIBS - Libraries to link (Executables only)                               #
-# EXPORT - Header files to be exported                                           #
-# CINTHDRS - Dictionary header files                                             #
-# CINTAUTOLINK - Set automatic dictionary generation                             #
-# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
-# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
-#--------------------------------------------------------------------------------#
-
-set ( SRCS AliHijingRndm.cxx)
-
-string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
-
-set ( DHDR hijingLinkDef.h)
-
-set ( EXPORT )
-
-set ( FSRCS  hijing1_36/ar3jet.F hijing1_36/aran9.F hijing1_36/arorie.F hijing1_36/atrobo.F hijing1_36/attflv.F hijing1_36/attrad.F hijing1_36/bk.F hijing1_36/crsjet.F hijing1_36/fgp1.F hijing1_36/fgp2.F hijing1_36/fgp3.F hijing1_36/fhin.F hijing1_36/fjet.F hijing1_36/fjetrig.F hijing1_36/flap.F hijing1_36/flap1.F hijing1_36/flap2.F hijing1_36/fnjet.F hijing1_36/fnkick.F hijing1_36/fnkick2.F hijing1_36/fnstru.F hijing1_36/fnstrum.F hijing1_36/fnstrus.F hijing1_36/ftot.F hijing1_36/ftotjet.F hijing1_36/ftotrig.F hijing1_36/g.F hijing1_36/gauss1.F hijing1_36/gauss2.F hijing1_36/gauss3.F hijing1_36/gauss4.F hijing1_36/ghvq.F hijing1_36/gmin.F hijing1_36/gmre.F hijing1_36/gphoton.F hijing1_36/hiboost.F hijing1_36/hidata.F hijing1_36/hifun.F hijing1_36/hijcrs.F hijing1_36/hijcsc.F hijing1_36/hijels.F hijing1_36/hijflv.F hijing1_36/hijfrg.F hijing1_36/hijhrd.F hijing1_36/hijing.F hijing1_36/hijini.F hijing1_36/hijset.F hijing1_36/hijsft.F hijing1_36/hijsrt.F hijing1_36/hijwds.F hijing1_36/hiptdi.F hijing1_36/hirnd.F hijing1_36/hirnd2.F hijing1_36/jetini.F hijing1_36/omg0.F hijing1_36/parton.F hijing1_36/profile.F hijing1_36/quench.F hijing1_36/romg.F hijing1_36/rwdsax.F hijing1_36/sgmin.F hijing1_36/subcrs1.F hijing1_36/subcrs2.F hijing1_36/subcrs3.F hijing1_36/subcrs4.F hijing1_36/subcrs5.F hijing1_36/subcrs6.F hijing1_36/subcrs7.F hijing1_36/title.F hijing1_36/vegas.F hijing1_36/wdsax.F hijing1_36/wdsax1.F hijing1_36/wdsax2.F hipyset1_35/hirobo.F hipyset1_35/klu_hijing.F hipyset1_35/lu1ent_hijing.F hipyset1_35/lu2ent_hijing.F hipyset1_35/lu3ent_hijing.F hipyset1_35/lu4ent_hijing.F hipyset1_35/luboei_hijing.F hipyset1_35/lucell_hijing.F hipyset1_35/luchge_hijing.F hipyset1_35/luclus_hijing.F hipyset1_35/lucomp_hijing.F hipyset1_35/ludata_hijing.F hipyset1_35/ludecy_hijing.F hipyset1_35/luedit_hijing.F hipyset1_35/lueevt_hijing.F hipyset1_35/luerrm_hijing.F hipyset1_35/luexec_hijing.F hipyset1_35/lufowo_hijing.F hipyset1_35/lugive_hijing.F hipyset1_35/luhepc_hijing.F hipyset1_35/luindf_hijing.F hipyset1_35/lujmas_hijing.F hipyset1_35/lujoin_hijing.F hipyset1_35/lukfdi_hijing.F hipyset1_35/lulist_hijing.F hipyset1_35/luname_hijing.F hipyset1_35/luonia_hijing.F hipyset1_35/luprep_hijing.F hipyset1_35/luptdi_hijing.F hipyset1_35/luradk_hijing.F hipyset1_35/lurobo_hijing.F hipyset1_35/lushow_hijing.F hipyset1_35/lusphe_hijing.F hipyset1_35/lustrf_hijing.F hipyset1_35/lutabu_hijing.F hipyset1_35/lutest_hijing.F hipyset1_35/luthru_hijing.F hipyset1_35/luupda_hijing.F hipyset1_35/lux3jt_hijing.F hipyset1_35/lux4jt_hijing.F hipyset1_35/luxdif_hijing.F hipyset1_35/luxjet_hijing.F hipyset1_35/luxkfl_hijing.F hipyset1_35/luxtot_hijing.F hipyset1_35/luzdis_hijing.F hipyset1_35/plu_hijing.F hipyset1_35/pydata_hijing.F hipyset1_35/pydiff_hijing.F hipyset1_35/pyfram_hijing.F hipyset1_35/pygamm_hijing.F hipyset1_35/pyi3au_hijing.F hipyset1_35/pyinit_hijing.F hipyset1_35/pyinki_hijing.F hipyset1_35/pyinre_hijing.F hipyset1_35/pykcut_hijing.F hipyset1_35/pyklim_hijing.F hipyset1_35/pykmap_hijing.F hipyset1_35/pymaxi_hijing.F hipyset1_35/pymult_hijing.F hipyset1_35/pyovly_hijing.F hipyset1_35/pyrand_hijing.F hipyset1_35/pyremn_hijing.F hipyset1_35/pyresd_hijing.F hipyset1_35/pyscat_hijing.F hipyset1_35/pysigh_hijing.F hipyset1_35/pyspen_hijing.F hipyset1_35/pyspli_hijing.F hipyset1_35/pysspa_hijing.F hipyset1_35/pystat_hijing.F hipyset1_35/pystfe_hijing.F hipyset1_35/pystfu_hijing.F hipyset1_35/pytest_hijing.F hipyset1_35/pythia_hijing.F hipyset1_35/pyw1au_hijing.F hipyset1_35/pyw2au_hijing.F hipyset1_35/pywidt_hijing.F hipyset1_35/pyxtot_hijing.F hipyset1_35/ulalps_hijing.F hipyset1_35/ulangl_hijing.F hipyset1_35/ulmass_hijing.F)
-
-set ( EINCLUDE  HIJING/hijing)
-
-if( ALICE_TARGET STREQUAL "macosxicc")
-       
-       string(REGEX REPLACE "-O[^ ]*" "" PACKFFLAGS "${FFLAGS}")
-
-endif( ALICE_TARGET STREQUAL "macosxicc")