Commit 738da63d authored by Harry van Haaren's avatar Harry van Haaren

-Updated CMake, version auto-generated. Fixes #69

parent abff10a0
......@@ -3,9 +3,11 @@ cmake_minimum_required (VERSION 2.6)
project (LUPPP)
set (LUPPP_VERSION_MAJOR 1)
set (LUPPP_VERSION_MINOR 0)
set(LUPPP_VERSION_MAJOR "1")
set(LUPPP_VERSION_MINOR "0")
set(LUPPP_VERSION_PATCH "1")
set(LUPPP_VERSION "${LUPPP_VERSION_MAJOR}.${LUPPP_VERSION_MINOR}.${LUPPP_VERSION_PATCH}")
option(BUILD_TESTS "Build test version" OFF)
......@@ -17,4 +19,13 @@ option(BUILD_TESTS "Build test version" OFF)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
#execute_process(COMMAND "date +\"%d-%m-%Y\"` `git log --pretty=format:\"%h\" | head -n1`"
#execute_process(COMMAND "git log --pretty=format:\"%h\" | head -n1"
execute_process(COMMAND git log --oneline -n1
OUTPUT_VARIABLE _output OUTPUT_STRIP_TRAILING_WHITESPACE)
file(WRITE src/version.hxx "#define GIT_VERSION \"${_output}\"")
add_subdirectory (src)
......@@ -46,7 +46,7 @@ ENDIF(RELEASE_BUILD)
FILE(GLOB sources *.cxx avtk/*.cxx cjson/*.c controller/*.cxx dsp/*.cxx observer/*.cxx state/*.cxx tests/*.cxx)
# Compile binary
add_executable (luppp ${sources} )
add_executable (luppp version.hxx ${sources} )
# Linking
......
......@@ -58,7 +58,7 @@ static void gui_static_loadSession_cb(void* inst)
int main(int argc, char** argv)
{
LUPPP_NOTE("%s", GIT_VERSION );
LUPPP_NOTE("Git: %s", GIT_VERSION );
bool runTests;
if ( runTests ){} // remove unused warning if not built with BUILD_TESTS
......
#!/bin/bash
# this file writes src/version.h from the git commit
echo "
#ifndef GIT_VERSION
#define GIT_VERSION \"`date +\"%d-%m-%Y\"` `git log --pretty=format:"%h" | head -n1`\"
#endif" > src/version.hxx
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment