[BUG+FIX] CMake Build in 3.0.6

Hello team!

I recently downloaded and built NVSHMEM version 3.0.6 and I noticed a bug (easily fixable :)) that breaks the CMake build only when using Ninja as a generator for CMake.

TL;DR

Ninja build fails with the following error

ninja: error: build.ninja:1641: multiple rules generate nvshmem_src_3.0.6-4/git_commit.txt

due to the duplicate BYPRODUCT ${CMAKE_CURRENT_SOURCE_DIR}/../git_commit.txt in line 644 of nvshmem_src_3.0.6-4/src/CMakeLists.txt (see below). Removing that line fixes the bug.

Context

As shown here, Ninja is very pedantic about the byproduct config, hence why it was the only one affected. Makefile generator, which I initially used, works fine and does not fail.

I caught the problem using an automated CMake+Ninja toolchain from an IDE (CLion), and discovered the BYPORDUCT issue after running a diff comparing 3.0.6 with older 2.11.0

< add_custom_target(git_commit ALL COMMAND test -f git_commit.txt || git rev-parse HEAD > git_commit.txt || echo "not built from a git repo" > git_commit.txt
<                   COMMAND grep -q NVSHMEM_MAJOR git_commit.txt || echo "NVSHMEM_MAJOR := ${PROJECT_VERSION_MAJOR}" >> git_commit.txt
<                   COMMAND grep -q NVSHMEM_MINOR git_commit.txt || echo "NVSHMEM_MINOR := ${PROJECT_VERSION_MINOR}" >> git_commit.txt
<                   COMMAND grep -q NVSHMEM_PATCH git_commit.txt || echo "NVSHMEM_PATCH := ${PROJECT_VERSION_PATCH}" >> git_commit.txt
<                   COMMAND grep -q NVSHMEM_PACKAGE git_commit.txt || echo "NVSHMEM_PACKAGE := ${PROJECT_VERSION_TWEAK}" >> git_commit.txt
<                   COMMAND cp git_commit.txt version.txt
<                   BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/../git_commit.txt
<                              ${CMAKE_CURRENT_SOURCE_DIR}/../git_commit.txt # <- problem here
> add_custom_target(git_commit ALL COMMAND test -f ${CMAKE_CURRENT_SOURCE_DIR}/../git_commit.txt || git rev-parse HEAD > ${CMAKE_CURRENT_SOURCE_DIR}/../git_commit.txt || echo "not built from a git repo" > ${CMAKE_CURRENT_SOURCE_DIR}/../git_commit.txt
>                   BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/../git_commit.txt)

Feel free to close this topic.