Fixed a bug which caused build to fail on systems with DATE installed
[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)
e969a926 17Else(DATE_PROGRAM)
18 Set(DATE_FOUND NO)
19 Message(STATUS "DATE is not installed on this system")
20 If(UNIX)
21 Execute_process(
22 COMMAND uname
23 OUTPUT_VARIABLE _uname
24 OUTPUT_STRIP_TRAILING_WHITESPACE)
25 Else(UNIX)
26 Set(_uname "Unknown")
27 Endif(UNIX)
28 Set(DATEFLAGS "-D${_uname} -DDATE_SYS=${_uname} -Dlong32=\"int\" -Dlong64=\"long long\" -DdatePointer=\"long\"")
29Endif(DATE_PROGRAM)
30
31Set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${DATEFLAGS})
32
33