diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b54ae29c..663eba656 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,8 @@ execute_process( COMMAND "${get_version_script}" ${get_version_enterprise} "${MEMGRAPH_OVERRIDE_VERSION}" "${MEMGRAPH_OVERRIDE_VERSION_SUFFIX}" + "--memgraph-root-dir" + "${CMAKE_SOURCE_DIR}" ) if(MEMGRAPH_VERSION_RESULT AND NOT MEMGRAPH_VERSION_RESULT EQUAL 0) message(FATAL_ERROR "Unable to get Memgraph version.") @@ -89,6 +91,8 @@ execute_process( --variant deb "${MEMGRAPH_OVERRIDE_VERSION}" "${MEMGRAPH_OVERRIDE_VERSION_SUFFIX}" + "--memgraph-root-dir" + "${CMAKE_SOURCE_DIR}" ) if(MEMGRAPH_VERSION_DEB_RESULT AND NOT MEMGRAPH_VERSION_DEB_RESULT EQUAL 0) message(FATAL_ERROR "Unable to get Memgraph DEB version.") @@ -104,6 +108,8 @@ execute_process( --variant rpm "${MEMGRAPH_OVERRIDE_VERSION}" "${MEMGRAPH_OVERRIDE_VERSION_SUFFIX}" + "--memgraph-root-dir" + "${CMAKE_SOURCE_DIR}" ) if(MEMGRAPH_VERSION_RPM_RESULT AND NOT MEMGRAPH_VERSION_RPM_RESULT EQUAL 0) message(FATAL_ERROR "Unable to get Memgraph RPM version.") diff --git a/release/get_version.py b/release/get_version.py index 1d5865837..a3956d433 100755 --- a/release/get_version.py +++ b/release/get_version.py @@ -3,6 +3,7 @@ import argparse import re import subprocess import sys +import os # This script is used to determine the current version of Memgraph. The script @@ -161,8 +162,17 @@ parser.add_argument( parser.add_argument( "--variant", choices=("binary", "deb", "rpm"), default="binary", help="which variant of the version string should be generated") +parser.add_argument( + "--memgraph-root-dir", help="The root directory of the checked out " + "Memgraph repository.", default=".") args = parser.parse_args() +if not os.path.isdir(args.memgraph_root_dir): + raise Exception("The root directory ({}) is not a valid directory".format( + args.memgraph_root_dir)) + +os.chdir(args.memgraph_root_dir) + offering = "enterprise" if args.enterprise else "community" # Check whether the version was manually supplied.