Fixed issue with DATE which caused SLC 4 builds to fail
[u/mrichter/AliRoot.git] / cmake / modules / FindDATE.cmake
CommitLineData
e969a926 1# -*- mode: cmake -*-
2
3# - Find the DATE system
4# Finds if the RuleChecker is installed and sets the following variables:
5#
6# DATE_FOUND = Boolean defining if DATE is installed
7#
8
9# Check if DATE is installed and in the path
10
44f1d74b 11Find_program( DATE_PROGRAM date-config )
e969a926 12
13If(DATE_PROGRAM)
14 Set(DATE_FOUND YES)
15 Message(STATUS "DATE is installed on this system")
1acfe552 16 Execute_process(COMMAND date-config --cflags OUTPUT_VARIABLE DATEFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
f180903d 17 string(REGEX REPLACE "\"" "'" DATEFLAGS ${DATEFLAGS})
18 #separate_arguments(DATEFLAGS)
19 execute_process(COMMAND date-config --monitorlibs=dyn OUTPUT_VARIABLE DMONLIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
20 separate_arguments(DMONLIBS)
21 set(DATE_COMMON_DEFS $ENV{DATE_COMMON_DEFS})
22 set(DATE_MONITOR_DIR $ENV{DATE_MONITOR_DIR})
e969a926 23Else(DATE_PROGRAM)
24 Set(DATE_FOUND NO)
25 Message(STATUS "DATE is not installed on this system")
26 If(UNIX)
27 Execute_process(
28 COMMAND uname
29 OUTPUT_VARIABLE _uname
30 OUTPUT_STRIP_TRAILING_WHITESPACE)
31 Else(UNIX)
32 Set(_uname "Unknown")
33 Endif(UNIX)
34 Set(DATEFLAGS "-D${_uname} -DDATE_SYS=${_uname} -Dlong32=\"int\" -Dlong64=\"long long\" -DdatePointer=\"long\"")
35Endif(DATE_PROGRAM)
f180903d 36set(__DATEFLAGS ${DATEFLAGS})
37separate_arguments(__DATEFLAGS)
e969a926 38Set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${DATEFLAGS})
39
40