1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-29 05:29:11 +00:00

Handle build.h, too.

This commit is contained in:
Brenden Matthews 2009-12-07 11:51:00 -08:00
parent c5cbb3c38f
commit d80cacd4b7
4 changed files with 19 additions and 3 deletions

2
.gitignore vendored
View File

@ -33,8 +33,6 @@ src/config.h.in
src/conky
src/stamp-h1
src/.deps/
src/build.h
src/config.h
src/defconfig.h
src/*.o
src/*.gcda

View File

@ -21,8 +21,12 @@ execute_process(COMMAND
--since=${VERSION_MAJOR}-${VERSION_MINOR}-01 --pretty=oneline COMMAND
${APP_WC} -l COMMAND ${APP_GAWK} "{print $1}" RESULT_VARIABLE RETVAL
OUTPUT_VARIABLE COMMIT_COUNT OUTPUT_STRIP_TRAILING_WHITESPACE)
#BUILD_DATE=$(LANG=en_US LC_ALL=en_US LOCALE=en_US date)
#BUILD_ARCH="$(uname -sr) ($(uname -m))"
execute_process(COMMAND ${APP_DATE} RESULT_VARIABLE RETVAL OUTPUT_VARIABLE
BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${APP_UNAME} -srm RESULT_VARIABLE RETVAL OUTPUT_VARIABLE
BUILD_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-r${COMMIT_COUNT}")
set(COPYRIGHT "Copyright Brenden Matthews, et al, 2005-2009")
@ -45,8 +49,9 @@ include(ConkyBuildOptions)
# Do platform checks
include(ConkyPlatformChecks)
# setup our configuration header
# setup our configuration headers
configure_file(${CMAKE_SOURCE_DIR}/config.h.in ${CMAKE_BINARY_DIR}/config.h)
configure_file(${CMAKE_SOURCE_DIR}/build.h.in ${CMAKE_BINARY_DIR}/build.h)
add_subdirectory(src)
add_subdirectory(lua)

9
build.h.in Normal file
View File

@ -0,0 +1,9 @@
#ifndef __BUILD_H
#define __BUILD_H
/* Conky build info */
#define BUILD_DATE "@BUILD_DATE@"
#define BUILD_ARCH "@BUILD_ARCH@"
#endif /* __BUILD_H */

View File

@ -2,9 +2,13 @@
include_directories(${conky_includes})
# ensure build.h and config.h aren't in the way
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
message(FATAL_ERROR "You must remove the autotools generated file '${CMAKE_CURRENT_SOURCE_DIR}/config.h' in order to build with CMake.")
endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/build.h)
message(FATAL_ERROR "You must remove the autotools generated file '${CMAKE_CURRENT_SOURCE_DIR}/build.h' in order to build with CMake.")
endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/build.h)
set(conky_sources colours.c combine.c common.c conky.c core.c diskio.c
entropy.c exec.c fs.c mail.c mixer.c net_stat.c template.c timed_thread.c