[CMake] Checking Variables in a tool-chain file

Torsten Robitzki Torsten at Robitzki.de
Thu Jan 31 02:25:30 EST 2019


Hi,
I have a tool-chain file, which requires a variable to be set to the path to the compiler on the local machine:

  set(CMAKE_C_COMPILER ${ARM_GCC_TOOL_PATH}/bin/arm-none-eabi-gcc)
  set(CMAKE_CXX_COMPILER ${ARM_GCC_TOOL_PATH}/bin/arm-none-eabi-g++)

Now I want to give the user an error message, in case that this variable is not set. The „usual“ check for the existence of the variable doesn’t work, because the tool-chain file is included in different context, without access to the cache.

Any idea?

regards,
Torsten

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <https://cmake.org/pipermail/cmake/attachments/20190131/732422c6/attachment.sig>


More information about the CMake mailing list