How to force cmake to use Visual Studio 2015 (v140) platform toolset?Visual studio doesn't have cl.exeVisual Studio compilers not visible by cmakeVisual Studio Platform 2015 Toolset ='v141' cannot be foundCompile CMake based project with minGWVC toolset version mismatched in Visual Studio 2017CMake cannot find Visual Studio 140 toolset on a 2017 installationhow appoint a specific windows sdk version for cmake build?CMake: How to specify VS2015.3 toolset with VS2017 installedvcpkg + cmake + visual studio not workingQuestions about “Binary Compatibility between Visual Studio 2015 and Visual Studio 2017”

Convergent Licencing

Why are there no file insertion syscalls

How can I improve my violin intonation for enharmonic notes?

What jobs would people work in a frontier railroad town?

Is the author of the Shu"t HaRidvaz the same one as the one known to be the rebbe of the Ariza"l?

Make symbols atomic, without losing their type

The Amazing Sliding Crossword

Leaving job close to major deadlines

Teferi's Time Twist and Gideon's Sacrifice

Would a 7805 5 V regulator drain a 9 V battery?

What preparations would Hubble have needed to return in a Shuttle?

Can a character learn spells from someone else's spellbook and then sell it?

How are で and いう being used in this context?

What is the highest power supply a Raspberry pi 3 B can handle without getting damaged?

`Table the `LCM` of an increasing list

One to Eleven Sum to Twenty Five

In the US, can a former president run again?

How would you explain #1 and #2 below using standard quotes?

My student in one course asks for paid tutoring in another course. Appropriate?

Does there exist a non-trivial group that is both perfect and complete?

How can I ping multiple IP addresses at the same time?

Is Newton's third law really correct?

Counterfeit checks were created for my account. How does this type of fraud work?

Why is it easier to balance a non-moving bike standing up than sitting down?



How to force cmake to use Visual Studio 2015 (v140) platform toolset?


Visual studio doesn't have cl.exeVisual Studio compilers not visible by cmakeVisual Studio Platform 2015 Toolset ='v141' cannot be foundCompile CMake based project with minGWVC toolset version mismatched in Visual Studio 2017CMake cannot find Visual Studio 140 toolset on a 2017 installationhow appoint a specific windows sdk version for cmake build?CMake: How to specify VS2015.3 toolset with VS2017 installedvcpkg + cmake + visual studio not workingQuestions about “Binary Compatibility between Visual Studio 2015 and Visual Studio 2017”






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








2















I installed both VS2015 and VS2017. For a cmake project, I want to use cmake to generate a vs2015 project (platform toolset v140).



I Opened the Developer Command Prompt for VS2015 then I ran cmake there.
But from the output and also the result sln file, I see it's still using vs2017 (v141) platform toolset.




-- Building for: Visual Studio 15 2017
-- The C compiler identification is MSVC 19.16.27027.1
-- The CXX compiler identification is MSVC 19.16.27027.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works




Please see the screenshot here:
cmake vs2015



So, how to I force cmake to use vs2015?










share|improve this question




























    2















    I installed both VS2015 and VS2017. For a cmake project, I want to use cmake to generate a vs2015 project (platform toolset v140).



    I Opened the Developer Command Prompt for VS2015 then I ran cmake there.
    But from the output and also the result sln file, I see it's still using vs2017 (v141) platform toolset.




    -- Building for: Visual Studio 15 2017
    -- The C compiler identification is MSVC 19.16.27027.1
    -- The CXX compiler identification is MSVC 19.16.27027.1
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works




    Please see the screenshot here:
    cmake vs2015



    So, how to I force cmake to use vs2015?










    share|improve this question
























      2












      2








      2








      I installed both VS2015 and VS2017. For a cmake project, I want to use cmake to generate a vs2015 project (platform toolset v140).



      I Opened the Developer Command Prompt for VS2015 then I ran cmake there.
      But from the output and also the result sln file, I see it's still using vs2017 (v141) platform toolset.




      -- Building for: Visual Studio 15 2017
      -- The C compiler identification is MSVC 19.16.27027.1
      -- The CXX compiler identification is MSVC 19.16.27027.1
      -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
      -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works




      Please see the screenshot here:
      cmake vs2015



      So, how to I force cmake to use vs2015?










      share|improve this question














      I installed both VS2015 and VS2017. For a cmake project, I want to use cmake to generate a vs2015 project (platform toolset v140).



      I Opened the Developer Command Prompt for VS2015 then I ran cmake there.
      But from the output and also the result sln file, I see it's still using vs2017 (v141) platform toolset.




      -- Building for: Visual Studio 15 2017
      -- The C compiler identification is MSVC 19.16.27027.1
      -- The CXX compiler identification is MSVC 19.16.27027.1
      -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
      -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works




      Please see the screenshot here:
      cmake vs2015



      So, how to I force cmake to use vs2015?







      visual-c++ visual-studio-2015 cmake visual-studio-2017






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 5:58









      Felix XuFelix Xu

      256




      256






















          2 Answers
          2






          active

          oldest

          votes


















          1














          This is what the -T option is for:




          -T Specify toolset name if supported by generator.



          Some CMake generators support a toolset name to be given to the native
          build system to choose a compiler. See the CMAKE_GENERATOR_TOOLSET
          variable. This is supported only on specific generators:



          Visual Studio Generators for VS 2010 and above The Xcode generator for
          Xcode 3.0 and above See native build system documentation for allowed
          toolset names.




          cmake -G "Visual Studio 15 2017" -T v140


          (Note that the generator names for Visual Studio changed between CMake 3.13 and 3.14)



          This will generate a Visual Studio 2017 solution, using the 2015 compiler and toolchain. So opening the solution will open VS 2017, but the code will compile with the 2015 toolchain.



          If you want to use the 2015 IDE instead, you use the 2015 generator and leave out the -T parameter.



          Note that you can also install the v140 toolchain as part of a VS2017 installation, so if you don't plan on using the older IDE, there is really no reason for keeping the VS2015 installation around.






          share|improve this answer
































            0














            cmake -G "Visual Studio 14 2015"



            make sure Windows SDK version 10.0.10586.0 is istalled.



            to see a list of the generators, run cmake --help






            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55331982%2fhow-to-force-cmake-to-use-visual-studio-2015-v140-platform-toolset%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              This is what the -T option is for:




              -T Specify toolset name if supported by generator.



              Some CMake generators support a toolset name to be given to the native
              build system to choose a compiler. See the CMAKE_GENERATOR_TOOLSET
              variable. This is supported only on specific generators:



              Visual Studio Generators for VS 2010 and above The Xcode generator for
              Xcode 3.0 and above See native build system documentation for allowed
              toolset names.




              cmake -G "Visual Studio 15 2017" -T v140


              (Note that the generator names for Visual Studio changed between CMake 3.13 and 3.14)



              This will generate a Visual Studio 2017 solution, using the 2015 compiler and toolchain. So opening the solution will open VS 2017, but the code will compile with the 2015 toolchain.



              If you want to use the 2015 IDE instead, you use the 2015 generator and leave out the -T parameter.



              Note that you can also install the v140 toolchain as part of a VS2017 installation, so if you don't plan on using the older IDE, there is really no reason for keeping the VS2015 installation around.






              share|improve this answer





























                1














                This is what the -T option is for:




                -T Specify toolset name if supported by generator.



                Some CMake generators support a toolset name to be given to the native
                build system to choose a compiler. See the CMAKE_GENERATOR_TOOLSET
                variable. This is supported only on specific generators:



                Visual Studio Generators for VS 2010 and above The Xcode generator for
                Xcode 3.0 and above See native build system documentation for allowed
                toolset names.




                cmake -G "Visual Studio 15 2017" -T v140


                (Note that the generator names for Visual Studio changed between CMake 3.13 and 3.14)



                This will generate a Visual Studio 2017 solution, using the 2015 compiler and toolchain. So opening the solution will open VS 2017, but the code will compile with the 2015 toolchain.



                If you want to use the 2015 IDE instead, you use the 2015 generator and leave out the -T parameter.



                Note that you can also install the v140 toolchain as part of a VS2017 installation, so if you don't plan on using the older IDE, there is really no reason for keeping the VS2015 installation around.






                share|improve this answer



























                  1












                  1








                  1







                  This is what the -T option is for:




                  -T Specify toolset name if supported by generator.



                  Some CMake generators support a toolset name to be given to the native
                  build system to choose a compiler. See the CMAKE_GENERATOR_TOOLSET
                  variable. This is supported only on specific generators:



                  Visual Studio Generators for VS 2010 and above The Xcode generator for
                  Xcode 3.0 and above See native build system documentation for allowed
                  toolset names.




                  cmake -G "Visual Studio 15 2017" -T v140


                  (Note that the generator names for Visual Studio changed between CMake 3.13 and 3.14)



                  This will generate a Visual Studio 2017 solution, using the 2015 compiler and toolchain. So opening the solution will open VS 2017, but the code will compile with the 2015 toolchain.



                  If you want to use the 2015 IDE instead, you use the 2015 generator and leave out the -T parameter.



                  Note that you can also install the v140 toolchain as part of a VS2017 installation, so if you don't plan on using the older IDE, there is really no reason for keeping the VS2015 installation around.






                  share|improve this answer















                  This is what the -T option is for:




                  -T Specify toolset name if supported by generator.



                  Some CMake generators support a toolset name to be given to the native
                  build system to choose a compiler. See the CMAKE_GENERATOR_TOOLSET
                  variable. This is supported only on specific generators:



                  Visual Studio Generators for VS 2010 and above The Xcode generator for
                  Xcode 3.0 and above See native build system documentation for allowed
                  toolset names.




                  cmake -G "Visual Studio 15 2017" -T v140


                  (Note that the generator names for Visual Studio changed between CMake 3.13 and 3.14)



                  This will generate a Visual Studio 2017 solution, using the 2015 compiler and toolchain. So opening the solution will open VS 2017, but the code will compile with the 2015 toolchain.



                  If you want to use the 2015 IDE instead, you use the 2015 generator and leave out the -T parameter.



                  Note that you can also install the v140 toolchain as part of a VS2017 installation, so if you don't plan on using the older IDE, there is really no reason for keeping the VS2015 installation around.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 25 at 9:33

























                  answered Mar 25 at 9:28









                  ComicSansMSComicSansMS

                  34.2k692120




                  34.2k692120























                      0














                      cmake -G "Visual Studio 14 2015"



                      make sure Windows SDK version 10.0.10586.0 is istalled.



                      to see a list of the generators, run cmake --help






                      share|improve this answer



























                        0














                        cmake -G "Visual Studio 14 2015"



                        make sure Windows SDK version 10.0.10586.0 is istalled.



                        to see a list of the generators, run cmake --help






                        share|improve this answer

























                          0












                          0








                          0







                          cmake -G "Visual Studio 14 2015"



                          make sure Windows SDK version 10.0.10586.0 is istalled.



                          to see a list of the generators, run cmake --help






                          share|improve this answer













                          cmake -G "Visual Studio 14 2015"



                          make sure Windows SDK version 10.0.10586.0 is istalled.



                          to see a list of the generators, run cmake --help







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Mar 25 at 8:26









                          Felix XuFelix Xu

                          256




                          256



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid …


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55331982%2fhow-to-force-cmake-to-use-visual-studio-2015-v140-platform-toolset%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

                              155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

                              Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?