-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.CMakeLists.txt
58 lines (47 loc) · 1.57 KB
/
init.CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
####################################################################
# CMake init defintion.
#
# Definition that should run in front of everything else.
#
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
IF(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0005 OLD)
# CMAKE 2.6.3 and above have CMAKE_VERSION
IF (CMAKE_VERSION)
cmake_policy(SET CMP0011 OLD)
ENDIF(CMAKE_VERSION)
ENDIF(COMMAND cmake_policy)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake_modules)
SET(ENV{LC_ALL} "C")
INCLUDE(BasicMacros)
###==================================================================
# Find parameters configuration
#
# Note: CMake 2.4 does not support STRING(STRIP ..)
DATE_FORMAT(DATE "+%a %b %d %Y")
DATE_FORMAT(DATE_SHORT "+%Y%m%d")
#MESSAGE("DATE=${DATE}|")
#MESSAGE("DATE_SHORT=${DATE_SHORT}|")
###==================================================================
# Directories
#
ADD_DEFINITIONS(-DCMAKE_INSTALL_PREFIX='"${CMAKE_INSTALL_PREFIX}"')
SET_ENV(datadir ${CMAKE_INSTALL_PREFIX}/share "DATADIR")
SET_ENV(docdir ${CMAKE_INSTALL_PREFIX}/share/doc "DOCDIR")
SET_ENV(LIBEXEC_DIR ${CMAKE_INSTALL_PREFIX}/libexec)
SET_ENV(SYSCONF_INSTALL_DIR /etc "SYSCONFDIR")
IF(NOT DEFINED IS_64)
IF( $ENV{MACHTYPE} MATCHES "64")
SET(IS_64 "64")
ELSE()
SET(IS_64 "")
ENDIF()
ENDIF()
ADD_DEFINITIONS(-DIS_64='"${IS64}"')
###==================================================================
# CPack Generator
# RPM and pack need them, so declare here.
#
SET(CPACK_GENERATOR "TGZ")
SET(CPACK_SOURCE_GENERATOR "TGZ")