CMake
- added sha1 of git commit to task diag
This commit is contained in:
@@ -4,6 +4,13 @@ include (CheckFunctionExists)
|
|||||||
project (task)
|
project (task)
|
||||||
set (PROJECT_VERSION "1.9.4")
|
set (PROJECT_VERSION "1.9.4")
|
||||||
|
|
||||||
|
if (EXISTS .git/index)
|
||||||
|
set (HAVE_COMMIT true)
|
||||||
|
execute_process (COMMAND git log -1 --pretty=format:%h
|
||||||
|
OUTPUT_VARIABLE COMMIT)
|
||||||
|
endif (EXISTS .git/index)
|
||||||
|
|
||||||
|
|
||||||
set (PACKAGE "${PROJECT_NAME}")
|
set (PACKAGE "${PROJECT_NAME}")
|
||||||
set (VERSION "${PROJECT_VERSION}")
|
set (VERSION "${PROJECT_VERSION}")
|
||||||
set (PACKAGE_BUGREPORT "support@taskwarrior.org")
|
set (PACKAGE_BUGREPORT "support@taskwarrior.org")
|
||||||
|
|||||||
@@ -9,6 +9,10 @@
|
|||||||
#define PACKAGE_VERSION "${PACKAGE_VERSION}"
|
#define PACKAGE_VERSION "${PACKAGE_VERSION}"
|
||||||
#define PACKAGE_STRING "${PACKAGE_STRING}"
|
#define PACKAGE_STRING "${PACKAGE_STRING}"
|
||||||
|
|
||||||
|
/* git information */
|
||||||
|
#cmakedefine HAVE_COMMIT
|
||||||
|
#define COMMIT "${COMMIT}"
|
||||||
|
|
||||||
/* Compiling platform */
|
/* Compiling platform */
|
||||||
#cmakedefine LINUX
|
#cmakedefine LINUX
|
||||||
#cmakedefine DARWIN
|
#cmakedefine DARWIN
|
||||||
|
|||||||
@@ -133,6 +133,9 @@ void handleDiagnostics (std::string& outs)
|
|||||||
std::cout << "[1mBuild Features[0m\n"
|
std::cout << "[1mBuild Features[0m\n"
|
||||||
// Build date.
|
// Build date.
|
||||||
<< " Built: " << __DATE__ << " " << __TIME__ << "\n"
|
<< " Built: " << __DATE__ << " " << __TIME__ << "\n"
|
||||||
|
#ifdef HAVE_COMMIT
|
||||||
|
<< " Commit: " << COMMIT << "\n"
|
||||||
|
#endif
|
||||||
<< " Caps:"
|
<< " Caps:"
|
||||||
#ifdef HAVE_LIBPTHREAD
|
#ifdef HAVE_LIBPTHREAD
|
||||||
<< " +pthreads"
|
<< " +pthreads"
|
||||||
|
|||||||
Reference in New Issue
Block a user