diff --git a/.gitignore b/.gitignore index 56bb0fa9..4d2fd237 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index f385c95b..755aa5af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/build.h.in b/build.h.in new file mode 100644 index 00000000..a9f84112 --- /dev/null +++ b/build.h.in @@ -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 */ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 00add8f3..f392d478 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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