[CMake] Platform dSPACE
Robin Verschueren
robin.verschueren at gmail.com
Fri Jun 23 16:20:12 EDT 2017
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 <mellery451 at gmail.com> wrote:
>
> > On Jun 23, 2017, at 1:11 PM, Robin Verschueren <
> robin.verschueren at 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.
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170623/5aff498f/attachment.html>
More information about the CMake
mailing list