Okay, that sounds reasonable. It's a pity, because that clutters the
CMakeLists of
potentially a lot of subfolders, e.g.:

if(EMBEDDED_SYSTEM1)
    include(SYSTEM1_SPECIAL_FLAGS)
elseif(EMBEDDED_SYSTEM2)
    include(
etc.

It would be nicer to just specify that from the command line:

cmake -D CMAKE_TOOLCHAIN_FILE=<EMBEDDED_SYSTEM1> ..

Thanks for the help!
Robin

On Fri, 23 Jun 2017 at 13:17 Michael Ellery <mellery...@gmail.com> wrote:

>
> > On Jun 23, 2017, at 1:11 PM, Robin Verschueren <
> robin.verschue...@gmail.com> wrote:
> >
> > Thank you, that makes sense.
> >
> > If I do that, how can I set specific settings for this Platform only? It
> seems that e.g.
> >
> > set(CMAKE_INCLUDE_FLAG_C "-J")
> >
> > in the Toolchain file is overwritten by CMake after processing the
> Toolchain file
> > (more specifically, in CMakeGenericSystem.cmake).
> >
> > Or should I set this variable somewhere else?
> >
> > Best,
> > Robin
>
> I think you use the toolchain file to declare the basics (what compiler to
> use) and then you can add specific flags and other settings in your other
> CMAKE files *after* the project() declaration (which usually clobbers a
> bunch of settingsā€¦). If you want to have your compiler flags/settings in a
> reusable file, you can just use the basic include() support to import a
> separate file, but it still needs to come after project() most likely.
>
>
>
>
-- 

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