diff --git a/CMakeLists.txt b/CMakeLists.txt index f11f632..2346226 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -217,7 +217,7 @@ else() SET(ASAN_L_FLAGS "") endif() -add_custom_target( version ALL "${PROJECT_SOURCE_DIR}/get_version.sh" "\"${PROJECT_SOURCE_DIR}\"" ) +add_custom_target( version ALL "${PROJECT_SOURCE_DIR}/get_version.sh" -- "\"${PROJECT_SOURCE_DIR}/\"" ) link_directories( ${X11_LIBRARY_DIRS} ${PANGOCAIRO_LIBRARY_DIRS} diff --git a/get_version.sh b/get_version.sh index 2b73fd3..0b50561 100755 --- a/get_version.sh +++ b/get_version.sh @@ -33,10 +33,10 @@ then fi VERSION=$(git describe --exact-match 2>/dev/null || echo "$MAJOR-git$(git show -s --pretty=format:%ci | cut -d ' ' -f 1 | tr -d '-').$(git show -s --pretty=format:%h)")$DIRTY else - VERSION=$( (head -n 1 ChangeLog || head -n 1 ../ChangeLog) | cut -d ' ' -f 2) - if [ "$VERSION" = "master" ] + VERSION=$(head -n 1 ${2}ChangeLog | cut -d ' ' -f 2) + if [ $VERSION = "master" ] then - VERSION=$VERSION-$( (head -n 1 ChangeLog || head -n 1 ../ChangeLog) | cut -d ' ' -f 1) + VERSION=$VERSION-$(head -n 1 ${2}ChangeLog | cut -d ' ' -f 1) fi fi diff --git a/packaging/make_ubuntu.sh b/packaging/make_ubuntu.sh index 4603cdc..60f8f26 100755 --- a/packaging/make_ubuntu.sh +++ b/packaging/make_ubuntu.sh @@ -14,7 +14,7 @@ else fi # Get version (and check that the repository is clean) -VERSION=$(../get_version.sh --strict) +VERSION=$(../get_version.sh --strict ../) if [ ! $? -eq 0 ] then echo >&2 "Error: get_version.sh failed!"