чт, 31 янв. 2019 г. в 10:29, Torsten Robitzki <tors...@robitzki.de>:
>
> 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?

Just guessing maybe better use $ENV{ARM_GCC_TOOL_PATH} ?
https://cmake.org/cmake/help/latest/variable/ENV.html?highlight=env


-- 
Best Regards,
Sergei Nikulov
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to