I gave it a try and it seems you are right though I get a warning:

CMake Warning:
  Manually-specified variables were not used by the project:

I assume in a proper run CMAKE_GENERATOR_TOOLSET is set by cmake -T and then read from there by the visual studio generator when it initializes.

By adding this to the cache manually I guess it is available before the generator is initialized as well.

Assuming that cmake -T does more than just set CMAKE_GENERATOR_TOOLSET or may choose to communicate the toolset with the generator in a different way in the future this may break sooner or later.

In CMakeLists.txt you can only set it after the generator has already been initialized (e.g. too late) (?)

Nils

On 12.05.2013 14:58, Szymon Gatner wrote:
To clarify: I am using CMake 2.8.11-rc4. There is nothing new toolset-related in the gui (as far as I can tell) but manually adding entry does work and properly generates project with XP toolset set.


2013/5/12 Nils Gladitz <glad...@sci-vis.de <mailto:glad...@sci-vis.de>>

    I may be missing something but I don't see an option to set this
    in cmake-gui yet either.
    As far as I understand it setting CMAKE_GENERATOR_TOOLSET by
    manually adding it to the cache in cmake-gui should not work.

    The only way to currently set it (as far as I can see) is by using
    the -T option for the cmake command line client.

    Nils


    On 12.05.2013 <tel:12.05.2013> 14:16, Szymon Gatner wrote:
    Oh, sorry it was "v110_xp" for cmake-gui of course too.

    So there is no way to set it outside the gui?


    2013/5/12 Nils Gladitz <glad...@sci-vis.de
    <mailto:glad...@sci-vis.de>>

        I think the proper value for Platform Toolset is "v110_xp" so
        "vs11_xp" shouldn't have worked.
        You can see the legally available values when you open any
        C++ project in Visual Studio and follow Project -> Properties
        -> Configuration Properties -> General -> "Platform Toolset".

        According to the documentation CMAKE_GENERATOR_TOOLSET is
        supposed to be read to see the value that the user set with
        the new -T cmake option rather than written to.
        This is also collaborated by this issue report:
        http://public.kitware.com/Bug/view.php?id=13961

        Nils


        On 12.05.2013 <tel:12.05.2013> 13:34, Szymon Gatner wrote:
        Hello,

        I am trying to target Win XP from Visual Studio 11 (2012)
        and I just tried new CMAKE_GENERATOR_TOOLSET variable with
        vs11_xp value and it worked nicely.

        Thing is, it only seems to work when it is added manually in
        cmake-gui via "Add Entry" but not when I am adding

        set(CMAKE_GENERATOR_TOOLSET v110_xp)

        to the root CMakeLists.txt (tried also with "v110_xp" as was
        not sure). I am new to CMake and probably missing something
        obvious?

        Regards,
        Szymon Gatner



        --

        Powered bywww.kitware.com  <http://www.kitware.com>

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

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

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






--
Szymon Gatner
The Lordz Games Studio
www.thelordzgamesstudio.com <http://www.thelordzgamesstudio.com>

--

Powered by www.kitware.com

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

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

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

Reply via email to