[all] be smarter about getting the git version

This commit is contained in:
Geoffrey McRae
2020-10-09 02:17:20 +11:00
parent 76710ef201
commit e6c88a4af3
12 changed files with 71 additions and 39 deletions

View File

@@ -50,20 +50,19 @@ pkg_check_modules(PKGCONFIG_OPT
xi
)
execute_process(
COMMAND cat ../VERSION
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE BUILD_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
find_package(GMP)
add_definitions(-D BUILD_VERSION='"${BUILD_VERSION}"')
add_definitions(-D ATOMIC_LOCKING)
add_definitions(-D GL_GLEXT_PROTOTYPES)
get_filename_component(PROJECT_TOP "${PROJECT_SOURCE_DIR}/.." ABSOLUTE)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/version.c
${CMAKE_BINARY_DIR}/_version.c
COMMAND ${CMAKE_COMMAND} -P
${PROJECT_TOP}/version.cmake
)
include_directories(
${PROJECT_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/include
@@ -80,6 +79,7 @@ link_libraries(
)
set(SOURCES
${CMAKE_BINARY_DIR}/version.c
src/main.c
src/app.c
src/config.c

View File

@@ -50,6 +50,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include "common/event.h"
#include "common/ivshmem.h"
#include "common/time.h"
#include "common/version.h"
#include "utils.h"
#include "kb.h"
@@ -1672,7 +1673,7 @@ int main(int argc, char * argv[])
return -1;
}
DEBUG_INFO("Looking Glass (" BUILD_VERSION ")");
DEBUG_INFO("Looking Glass (%s)", BUILD_VERSION);
DEBUG_INFO("Locking Method: " LG_LOCK_MODE);
if (!installCrashHandler("/proc/self/exe"))