I am trying to create a cmake toolchain file for the GreenHills compiler.
When I am using cmake -T C:\ghs\multi506
everything works fine.
But after creating a toolchain file with the line
set(GHS_TOOLSET_ROOT C:/ghs/multi506)
I get the error message:
CMake Error: No GHS toolsets found in GHS_TOOLSET_ROOT "C:/ghs/multi506/"
What is the problem?
The use of
-T
andGHS_TOOLSET_ROOT
is finicky. This is because of trying to maintain backward compatibility with the original generator implementation of trying to find the "latest" compiler.'-T' takes either a absolute path or a relative path.
-T C:\ghs\multi506
means that the compilers are in this directory. It will contain gbuild.exe, etcetera.-T multi506
will appendmulti506
toGHS_TOOLSET_ROOT
. ThereforeCMake
will look forgbuild.exe
inC:\ghs\multi506
.If you don't use
-T
then auto search mode is enabled.CMake
will search for directories namedcomp_[^;]+
, which is the naming scheme Green Hills uses for its compilers, inGHS_TOOLSET_ROOT
. So in this case it will be looking for something likeC:\ghs\multi506\comp_20210504
.I prefer using
-T
with an absolute path to the compiler directory.