Hi,

The current way of specifying a toolchain file is during the configure step
via the command line.

mkdir /tmp/build && cd /tmp/build
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchain.cmake /path/to/source

In the project that I am working on I need to load different toolchain
files depending on the application/target I need to build.

For that reason, I set the CMAKE_*_COMPILER before I call the project().
But if I want to figure out the host system and load the toolchain based on
that it's not possible.

CMAKE_SYSTEM_NAME is available only after project() call is finished. Is
there anyway I can figure out the host information before the call to
project()?

What I would like to do:

include(toolchain-${CMAKE_SYSTEM_NAME}-${MYPRODUCT_ARCH}.cmake)

project(myproject)
add_subdirectory(src)


Regards,
Murali.
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to