FetchContent: fails with GHS to populate a repository due to shell syntax
Background
This behavior is observed on CMake 3.26.4
The config
include(FetchContent)
FetchContent_Declare(
depname
GIT_REPOSITORY git@gitpath:/some/depname.git
GIT_TAG 1.0
)
FetchContent_MakeAvailable(depname)
The Result
This generates a subbuild for the depname
including a script that actually does the clone.
depname-populate_cc1_depname-populate-download.rule.sh
echo Performing download step (git clone) for 'depname-populate'
if [ ...
The problem is that this echo command uses invalid syntax. This results in a configure error that the project fails to populate because:
/path/to/depname-populate_cc1_depname-populate-download.rule.sh: line 1: syntax error near unexpected token `('
/path/to/depname-populate_cc1_depname-populate-download.rule.sh: line 1: 'echo Performing download step (git clone) for 'depname-populate''
This occurs on Linux and appears to be generator specific.