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
-TandGHS_TOOLSET_ROOTis 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\multi506means that the compilers are in this directory. It will contain gbuild.exe, etcetera.-T multi506will appendmulti506toGHS_TOOLSET_ROOT. ThereforeCMakewill look forgbuild.exeinC:\ghs\multi506.If you don't use
-Tthen auto search mode is enabled.CMakewill 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
-Twith an absolute path to the compiler directory.