]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - CMakeLists.txt
Converting PWG/TRD to native cmake
[u/mrichter/AliRoot.git] / CMakeLists.txt
index 7e1ef779b0d1221d6317490a2ccf0cf86b32d121..36fdd9b06c5b1d6137e4a7ff0fbfc6f01595ca27 100644 (file)
@@ -22,12 +22,28 @@ cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
 project(AliRoot CXX C)
 
 # Path to additonal modules
-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
+set(CMAKE_MODULE_PATH "${AliRoot_SOURCE_DIR}/cmake")
+
+# AliRoot version extracted from Git repository
+# Sets 4 git variables
+#  - GIT_REFSPEC - complete name of the current reference
+#  - ALIROOT_BRANCH - name of the branch or tag extracted from the current reference
+#  - GIT_SHA1 - current hash in the long format
+#  - GIT_SHORT_SHA1 - current hash in the short format
+#  - ALIROOT_VERSION = ALIROOT_BRANCH
+#  - ALIROOT_REVISION = GIT_SHORT_SHA1
+include(CheckGitVersion)
 
 #       - CLANG_MAJOR.CLANG_MINOR or
 #       - GCC_MAJOR.GCC_MINOR.GCC_PATCH
 include(CheckCompiler)
 
+# You can change the build type using 
+# cmake -DCMAKE_BUILD_TYPE=DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL...
+if (NOT CMAKE_BUILD_TYPE)
+  set(CMAKE_BUILD_TYPE RELWITHDEBINFO)
+endif(NOT CMAKE_BUILD_TYPE)
+
 # ROOT dictionaries and maps
 include(CMakeALICE)
 
@@ -35,9 +51,14 @@ include(CMakeALICE)
 # in case ROOT Extra static library needs to be enabled
 
 # DATE
+# date-config needs DIMDIR and ODIR set
 if(DATE_CONFIG)
-    find_package(DATE)
-endif(DATE_CONFIG)
+    if(DIMDIR AND ODIR)
+        find_package(DATE)
+    else()
+        message(FATAL_ERROR "DATE enabled but no DIMDIR and ODIR set. Please set DIMDIR and ODIR")
+    endif()
+endif()
 
 # daqDA
 if(daqDA)
@@ -46,7 +67,11 @@ endif(daqDA)
 
 # AMORE
 if(AMORE_CONFIG)
-    find_package(AMORE)
+    if(ROOTSYS)
+        find_package(AMORE)
+    else()
+        message(FATAL_ERROR "AMORE enabled but no ROOTSYS defined")
+    endif()
 endif(AMORE_CONFIG)
 
 # DA is enabled
@@ -76,6 +101,12 @@ if(DA)
     message(STATUS "DAs enabled")
 endif(DA)
 
+# MDC rpm creation enables the static build
+if(MDCRPM)
+    set(ALIROOT_STATIC TRUE)
+    message(STATUS "AliMDC RPM enabled. AliRoot static build enabled")
+endif(MDCRPM)
+
 # ROOT configuration mandatory
 if(ROOTSYS)
     find_package(ROOT REQUIRED)
@@ -107,7 +138,6 @@ else()
     message(STATUS "No Fortran support. Disabling LHAPDF, PHYTIA6, MICROCERN, etc.")
 endif()
 
-
 # DATE
 if(DATE_CONFIG)
     find_package(DATE)
@@ -141,14 +171,6 @@ find_package(FASTJET)
 # ZEROMQ
 find_package(ZeroMQ)
 
-# AliRoot version extracted from Git repository
-# Sets 4 git variables
-#  - GIT_REFSPEC - complete name of the current reference
-#  - ALIROOT_BRANCH - name of the branch or tag extracted from the current reference
-#  - GIT_SHA1 - current hash in the long format
-#  - GIT_SHORT_SHA1 - current hash in the short format
-include(CheckGitVersion)
-
 message(STATUS "CMake platform: ${CMAKE_SYSTEM}")
 message(STATUS "Build folder: ${AliRoot_BINARY_DIR}")
 message(STATUS "Source folder: ${AliRoot_SOURCE_DIR}")
@@ -223,6 +245,10 @@ if(CMAKE_Fortran_COMPILER)
   add_subdirectory(TAmpt)
 endif(CMAKE_Fortran_COMPILER)
 
+# PWG libraries
+add_subdirectory(PWG)
+add_subdirectory(PWGUD)
+
 # Enable SHUTTLE compilation
 # Check if DIMDIR and ODIR are set
 if(SHUTTLE)