-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.CMakeLists.txt
105 lines (90 loc) · 3.45 KB
/
common.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
####################################################################
# CMake common setting.
#
# Project independent setting.
#
# Optional Variables:
#
# SET(GENERATE_DOXYFILE TRUE)
# Generate doxyfile from doxyfile.in
#
# SET(ENABLE_GTKDOC TRUE)
# SET(GTKDOC_OUTPUT_DIR <path>)
# Enable gtk-doc
#
# SET(GENERATE_UPLOADPKG_BATCH TRUE)
# Generate UploadPkg.batch for Uploading to hosting host
#
####################################################################
INCLUDE(Version)
ADD_DEFINITIONS(-DPROJECT_NAME='"${PROJECT_NAME}"')
ADD_DEFINITIONS(-DPRJ_VERSION='"${PRJ_VER_FULL}"')
SET_ENV(PROJECT_DATADIR "${datadir}/${PROJECT_NAME}")
SET_ENV(PROJECT_DOCDIR "${docdir}/${PROJECT_NAME}-${PRJ_VER}")
SET_ENV(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${IS_64}")
# Load developer targets if DEVELOPER_SETTING_FILE exists
IF(EXISTS ${DEVELOPER_SETTING_FILE})
INCLUDE(Developer)
SETTING_FILE_GET_ATTRIBUTE(SSH_USER SSH_USER ${DEVELOPER_SETTING_FILE})
SETTING_FILE_GET_ATTRIBUTE(SSH_ARGS SSH_ARGS ${DEVELOPER_SETTING_FILE})
SETTING_FILE_GET_ATTRIBUTE(KOJI_CVS_PATH KOJI_CVS_PATH ${DEVELOPER_SETTING_FILE})
# Start next version
ADD_CUSTOM_TARGET(next_version
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/ChangeLog ${CMAKE_SOURCE_DIR}/ChangeLog.prev
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/SPECS/RPM-ChangeLog
${CMAKE_SOURCE_DIR}/SPECS/RPM-ChangeLog.prev
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/SPECS/RPM-RELEASE-NOTES.template
${CMAKE_SOURCE_DIR}/SPECS/RPM-RELEASE-NOTES.txt
)
ENDIF(EXISTS ${DEVELOPER_SETTING_FILE})
#==================================================================
# Configure files
#
IF (GENERATE_UPLOADPKG_BATCH)
CONFIGURE_FILE(UploadPkg.batch.in UploadPkg.batch)
ENDIF()
FILE(READ ${CMAKE_SOURCE_DIR}/ChangeLog.prev CHANGELOG_PREV)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/ChangeLog.in ${CMAKE_SOURCE_DIR}/ChangeLog)
FILE(READ ${CMAKE_SOURCE_DIR}/SPECS/RPM-ChangeLog.prev RPM_CHANGELOG_PREV)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/SPECS/RPM-ChangeLog.in ${CMAKE_SOURCE_DIR}/SPECS/RPM-ChangeLog)
#==================================================================
# Make uninstall
#
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
)
#====================================================================
# Package handling
#
SET(CPACK_PACKAGE_VENDOR "Red Hat, APAC, Inc.")
SET(CPACK_PACKAGE_VERSION ${PRJ_VER})
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(SOURCE_TARBALL_OUTPUT_DIR "${CMAKE_BINARY_DIR}/SOURCES")
SET(MY_IGNORE_FILES "/BUILDROOT/")
SET(CPACK_PACKAGE_IGNORE_FILES ${MY_IGNORE_FILES})
SET(CPACK_SOURCE_IGNORE_FILES ${MY_IGNORE_FILES})
IF(EXISTS ${DEVELOPER_SETTING_FILE})
INCLUDE(FedoraDeveloper)
ELSE(EXISTS ${DEVELOPER_SETTING_FILE})
INCLUDE(RPM)
ENDIF(EXISTS ${DEVELOPER_SETTING_FILE})
#====================================================================
# Doxygen Document generation
#
IF (GENERATE_DOXYFILE)
CONFIGURE_FILE(Doxyfile.in Doxyfile)
ENDIF()
IF (EXISTS Doxyfile)
FIND_PACKAGE(Doxygen)
ADD_CUSTOM_TARGET(doxygen
COMMAND "${DOXYGEN}" "Doxyfile"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
INSTALL(DIRECTORY doc/html
DESTINATION "${docdir}/${PROJECT_NAME}-${PRJ_VER}"
)
ENDIF()