Commit b5dd590a authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[CHANGE] - version information now gets written to header and included during...

[CHANGE] - version information now gets written to header and included during build, this makes revision text file obsolete as well as the walnut script.
parent 176c991d
......@@ -24,6 +24,9 @@ syntax: regexp
^src/tags
^src/cscope.out
# files geneterated by build system
^src/version.h
# local vim rc
^lvimrc
......
#!/bin/sh
# get path of this script
BINDIR=`dirname "$0"`
# assume that this script is in the bin dir
# go there to ensure walnuts working directory is set correctly
cd "$BINDIR"
#run walnut
echo "OpenWalnut built from: $(cat ./revision)"
./walnut-bin $@
......@@ -12,7 +12,6 @@ echo run $@ > $PARAM_FILENAME
cd "$BINDIR"
# run walnut
echo "OpenWalnut built from: $(cat ./revision)"
gdb ./walnut-bin -command=$PARAM_FILENAME
gdb ./walnut -command=$PARAM_FILENAME
rm $PARAM_FILENAME
......@@ -12,6 +12,5 @@ PARAMS="$*"
echo "Parameters: $PARAMS"
# run walnut
echo "OpenWalnut built from: $(cat ./revision)"
kdbg -a "$PARAMS" walnut-bin
kdbg -a "$PARAMS" walnut
......@@ -141,8 +141,18 @@ ADD_SUBDIRECTORY( gui )
ADD_SUBDIRECTORY( kernel )
ADD_SUBDIRECTORY( common )
ADD_SUBDIRECTORY( modules )
ADD_EXECUTABLE( walnut-bin OpenWalnut.cpp )
TARGET_LINK_LIBRARIES( walnut-bin OWkernel OWdataHandler OWgui OWguiqt4 OWcommon OWge ${Boost_LIBRARIES} )
#-------------------------------------------------------------------------------------------------------------
# Writes information about the revision of the current code to the file version.h which then gets included by OpenWalnut.cpp
add_custom_command( OUTPUT ${PROJECT_SOURCE_DIR}/version.h
MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/../.hg/dirstate
COMMAND hg parents --template '\#define W_VERSION \"{node|short} {rev} {branches} {tags}\"' > ${PROJECT_SOURCE_DIR}/version.h
COMMENT "Creating version.h"
)
# finally, build walnut
ADD_EXECUTABLE( walnut OpenWalnut.cpp version.h )
TARGET_LINK_LIBRARIES( walnut OWkernel OWdataHandler OWgui OWguiqt4 OWcommon OWge ${Boost_LIBRARIES} )
#---------- Shaders -------------
option( OW_COPY_SHADERS "This enables copying shaders with every make call." ON )
......@@ -267,14 +277,6 @@ ADD_CUSTOM_TARGET( stylecheck
COMMENT "Check if code complies to CodingStandard"
)
#-------------------------------------------------------------------------------------------------------------
# Writes information about the revision of the current code to a file
ADD_CUSTOM_TARGET( identify
ALL
COMMAND hg identify --cwd ${PROJECT_SOURCE_DIR} -n -i -b -t > ${PROJECT_BINARY_DIR}/bin/revision
COMMENT "Write information about the revision of the current code to a file"
)
#-------------------------------------------------------------------------------------------------------------
# Prints the verbose output of the test runners, so you may identify the source of error early, if any
ADD_CUSTOM_TARGET( vtest
......
......@@ -29,6 +29,8 @@
#include "gui/qt4/WQt4Gui.h"
#include "version.h" // this header gets created by our build system.
/**
* \mainpage OpenWalnut Inline Documentation
* \par
......@@ -43,7 +45,8 @@
*/
int main( int argc, char** argv )
{
std::cout << "OpenWalnut ( http://www.openwalnut.org )\n"
std::cout << "OpenWalnut ( http://www.openwalnut.org )" << std::endl <<
"Build from: " << W_VERSION << std::endl << std::endl <<
"Copyright (C) 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS\n"
"For more information see http://www.openwalnut.org/copying\n"
"This program comes with ABSOLUTELY NO WARRANTY.\n"
......
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