Converting DIME to native cmake
authorhristov <Peter.Hristov@cern.ch>
Tue, 18 Nov 2014 13:03:00 +0000 (14:03 +0100)
committeragrigora <alina.grigoras@cern.ch>
Mon, 15 Dec 2014 12:51:58 +0000 (13:51 +0100)
14 files changed:
CMakeLists.txt
DIME/CMakeLists.txt
DIME/CMakelibTDime.pkg [deleted file]
DIME/CMakelibdime.pkg [deleted file]
DIME/TDime/CMakeLists.txt [new file with mode: 0644]
DIME/TDime/DCommon.h [moved from DIME/DCommon.h with 100% similarity]
DIME/TDime/TDime.cxx [moved from DIME/TDime.cxx with 100% similarity]
DIME/TDime/TDime.h [moved from DIME/TDime.h with 100% similarity]
DIME/TDime/TDimeLinkDef.h [moved from DIME/TDimeLinkDef.h with 100% similarity]
DIME/dime/AliDimeRndm.cxx [moved from DIME/AliDimeRndm.cxx with 100% similarity]
DIME/dime/AliDimeRndm.h [moved from DIME/AliDimeRndm.h with 100% similarity]
DIME/dime/CMakeLists.txt [new file with mode: 0644]
DIME/dime/dimeLinkDef.h [moved from DIME/dimeLinkDef.h with 100% similarity]
DIME/dime/dimemcv1.05.f [moved from DIME/dimemcv1.05.f with 100% similarity]

index f35f7ba..d06a761 100644 (file)
@@ -146,6 +146,7 @@ if(CMAKE_Fortran_COMPILER)
   add_subdirectory(TPHIC)
   add_subdirectory(TUHKMgen)
   add_subdirectory(TAmpt)
+  add_subdirectory(DIME)
 endif(CMAKE_Fortran_COMPILER)
 
 # Enable SHUTTLE compilation
index 493d447..af57600 100644 (file)
@@ -1,10 +1,20 @@
-# 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)
+# Include the libraries
+add_subdirectory (dime)
+add_subdirectory (TDime)
 
-file(GLOB PACKAGES CMake*.pkg)
-
-ALICE_BuildModule()
+message(STATUS "DIME enabled")
diff --git a/DIME/CMakelibTDime.pkg b/DIME/CMakelibTDime.pkg
deleted file mode 100644 (file)
index c6e219a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-# -*- mode: CMake -*- 
-#--------------------------------------------------------------------------------#
-# Package File for THijing                                                       #
-# 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  TDime.cxx)
-
-string(REPLACE ".cxx" ".h" HDRS  "${SRCS}")
-
-set ( DHDR TDimeLinkDef.h)
-
-set ( EXPORT TDime.h)
-
-set ( EINCLUDE HIJING EVGEN STEER/STEER STEER/STEERBase )
diff --git a/DIME/CMakelibdime.pkg b/DIME/CMakelibdime.pkg
deleted file mode 100644 (file)
index 171711d..0000000
+++ /dev/null
@@ -1,43 +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 AliDimeRndm.cxx)
-
-string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
-
-set ( DHDR dimeLinkDef.h)
-
-set ( EXPORT )
-
-set ( FSRCS dimemcv1.05.f) 
-
-
-if( ALICE_TARGET STREQUAL "macosxicc")
-       
-       string(REGEX REPLACE "-O[^ ]*" "" PACKFFLAGS "${FFLAGS}")
-
-endif( ALICE_TARGET STREQUAL "macosxicc")
diff --git a/DIME/TDime/CMakeLists.txt b/DIME/TDime/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7c4a0f1
--- /dev/null
@@ -0,0 +1,59 @@
+# **************************************************************************
+# * 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.                  *
+# **************************************************************************/
+
+#Module
+set (MODULE TDime)
+
+# Module include folder
+include_directories(${AliRoot_SOURCE_DIR}/DIME/${MODULE})
+
+# Additional includes - alphabetical order except ROOT
+include_directories(${ROOT_INCLUDE_DIRS})
+
+# Sources - alphabetical order
+set(SRCS
+  TDime.cxx
+)
+
+# 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}")
+
+# Add a library to the project using the specified source files
+add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
+
+# Generate the ROOT map
+# Dependecies
+set(LIBDEPS dime EG)
+generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
+
+# Additional compilation flags
+set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+target_link_libraries(${MODULE})
+
+# 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)
similarity index 100%
rename from DIME/DCommon.h
rename to DIME/TDime/DCommon.h
similarity index 100%
rename from DIME/TDime.cxx
rename to DIME/TDime/TDime.cxx
similarity index 100%
rename from DIME/TDime.h
rename to DIME/TDime/TDime.h
similarity index 100%
rename from DIME/AliDimeRndm.h
rename to DIME/dime/AliDimeRndm.h
diff --git a/DIME/dime/CMakeLists.txt b/DIME/dime/CMakeLists.txt
new file mode 100644 (file)
index 0000000..bb882d2
--- /dev/null
@@ -0,0 +1,66 @@
+# **************************************************************************
+# * 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.                  *
+# **************************************************************************
+
+# Module
+set(MODULE dime)
+
+# Module include folder
+include_directories(${AliRoot_SOURCE_DIR}/DIME/${MODULE}
+                   )
+
+# Additional include folders in alphabetical order except ROOT
+include_directories(${ROOT_INCLUDE_DIRS}
+                   )
+
+# Sources
+set(SRCS
+  AliDimeRndm.cxx
+)
+
+set(FSRCS
+  dimemcv1.05.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 "-O0 -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")
similarity index 100%
rename from DIME/dimeLinkDef.h
rename to DIME/dime/dimeLinkDef.h
similarity index 100%
rename from DIME/dimemcv1.05.f
rename to DIME/dime/dimemcv1.05.f