summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-12-12 18:40:04 -0500
committerAdam <Adam@anope.org>2010-12-12 18:40:04 -0500
commit7b7301eeffa22718588b118b53b80b6c5c139a29 (patch)
tree1bf8146dc94b4ee0b217574157077231c2f2f825
parent70d65376b7dea12ffbadbe5fbd6e616c00bc5733 (diff)
Made ./Config with a .git directory work ok if we are on a git tag
-rwxr-xr-xConfig9
-rw-r--r--include/CMakeLists.txt3
2 files changed, 10 insertions, 2 deletions
diff --git a/Config b/Config
index c647c8e54..fa35b2d43 100755
--- a/Config
+++ b/Config
@@ -166,8 +166,13 @@ if [ ! "$NO_INTRO" ] ; then
. $SOURCE_DIR/src/version.sh
if [ -d .git ] ; then
VERSION=`git describe --tags`
- echo "#define VERSION_BUILD `echo "$VERSION" | cut -d'-' -f2`" > include/version.h
- echo "#define VERSION_EXTRA \"-`echo "$VERSION" | cut -d'-' -f3`$VERSION_EXTRA\"" >> include/version.h
+ VERSION_BUILD=`echo "$VERSION" | cut -d'-' -f2`
+ VERSION_EXTRA=`echo "$VERSION" | cut -d'-' -f3`
+ if [ "$VERSION_BUILD" == "$VERSION_EXTRA" ] ; then
+ VERSION_EXTRA=""
+ fi
+ echo "#define VERSION_BUILD $VERSION_BUILD" > include/version.h
+ echo "#define VERSION_EXTRA \"$VERSION_EXTRA\"" >> include/version.h
fi
cat $SOURCE_DIR/.BANNER | sed "s/CURVER/$VERSION/" | sed "s@SOURCE_DIR@$SOURCE_DIR@" | $PAGER
echo ""
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index b12d03598..c484334c1 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -12,6 +12,9 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.h
# Add version to list of files for CPack to ignore
get_filename_component(version_BINARY ${version_BINARY} NAME)
add_to_cpack_ignored_files("${version_BINARY}$" TRUE)
+if(NOT WIN32)
+ add_to_cpack_ignored_files("version.h$" TRUE)
+endif(NOT WIN32)
# Add a custom target to the above file
add_custom_target(headers DEPENDS version ${CMAKE_CURRENT_BINARY_DIR}/version.h)