Skip to content

Commit

Permalink
temporarily use separate VERSION_CPP for CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
grlee77 committed Oct 31, 2023
1 parent 8937ab1 commit 9bb33ab
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cmake_minimum_required(VERSION 3.18)

# Set VERSION and BUILD
unset(VERSION CACHE)
file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/VERSION VERSION)
file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/VERSION_CPP VERSION)
set(PROJECT_VERSION_BUILD dev)

# Append local cmake module path
Expand Down
1 change: 1 addition & 0 deletions VERSION_CPP
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
23.12.00
4 changes: 4 additions & 0 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ package_name="cucim"
package_dir="python/cucim/src"

version=$(rapids-generate-version)
# for CMake VERSION need to truncate any trailing 'a'
version_cpp=${version%a*}

commit=$(git rev-parse HEAD)

echo "${version}" > VERSION
echo "${version_cpp}" > VERSION_CPP
sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "${package_dir}/${package_name}/_version.py"

rapids-logger "Begin py build"
Expand Down
4 changes: 4 additions & 0 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ source rapids-date-string
version=$(rapids-generate-version)
commit=$(git rev-parse HEAD)

# for CMake VERSION_CPP need to truncate any trailing 'a'
version_cpp=${version%a*}

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

# Patch project metadata files to include the CUDA version suffix and version override.
Expand All @@ -24,6 +27,7 @@ PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}"
# update package name to have the cuda suffix
sed -i "s/name = \"${package_name}\"/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file}
echo "${version}" > VERSION
echo "${version_cpp}" > VERSION_CPP
sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "${package_src_dir}/_version.py"

if [[ ${PACKAGE_CUDA_SUFFIX} == "-cu12" ]]; then
Expand Down
1 change: 1 addition & 0 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/source/conf.
echo "${NEXT_FULL_TAG}" > VERSION
# update VERSION files used by C++/CMake (TODO: avoid these duplicate copies)
NEXT_CPP_LONG_TAG=${NEXT_MAJOR}.${NEXT_MINOR}.${NEXT_PATCH} # no leading 'v' or trailing 'a'
echo "${NEXT_CPP_LONG_TAG}" > VERSION_CPP
sed_runner "s/${CURRENT_LONG_TAG}/${NEXT_CPP_LONG_TAG}/g" python/cucim/VERSION
sed_runner "s/${CURRENT_LONG_TAG}/${NEXT_CPP_LONG_TAG}/g" cpp/plugins/cucim.kit.cuslide/VERSION
sed_runner "s/${CURRENT_LONG_TAG}/${NEXT_CPP_LONG_TAG}/g" cpp/plugins/cucim.kit.cumed/VERSION
Expand Down

0 comments on commit 9bb33ab

Please sign in to comment.