#101318: Patch for various problems in AliROOT
[u/mrichter/AliRoot.git] / cmake / FindDATE.cmake
CommitLineData
6db31708 1# AliRoot Build System Module to find and configure DATE
2#
3# Author: Johny Jose (johny.jose@cern.ch)
4# Port of previous Makefile build to cmake
5
575bfc03 6cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
6db31708 7
8find_program(DATE_CONFIG date-config)
9message(STATUS "Check for Date : ${DATE_CONFIG}")
10if(DATE_CONFIG)
11 set(DATE_FOUND TRUE)
12 set(DATE_ROOT $ENV{DATE_ROOT})
13 set(DATE_COMMON_DEFS $ENV{DATE_COMMON_DEFS})
14 set(DATE_MONITOR_DIR $ENV{DATE_MONITOR_DIR})
15 execute_process(COMMAND date-config --cflags OUTPUT_VARIABLE DATEFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
575bfc03 16 string(REGEX REPLACE "\"" "'" DATEFLAGS ${DATEFLAGS})
17 set(DATEFLAGS "-DALI_DATE ${DATEFLAGS}")
769f99cf 18 execute_process(COMMAND date-config --monitorlibs=dyn OUTPUT_VARIABLE DMONLIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
6db31708 19else()
20 set(DATEFLAGS "-D${CMAKE_SYSTEM_NAME} -DDATE_SYS=${CMAKE_SYSTEM_NAME} -Dlong32='int' -Dlong64='long long' -DdatePointer='long'")
21endif(DATE_CONFIG)
575bfc03 22