Git Product home page Git Product logo

Comments (8)

nlohmann avatar nlohmann commented on May 28, 2024

I will check locally. Maybe we need an option to dump the actual error message for each version.

from cmake_min_version.

nlohmann avatar nlohmann commented on May 28, 2024

I tried the project locally using macOS. I first had an error with all CMake versions, because Boost was not installed. Once I fixed that (brew install boost), I got

❯ ./cmake_min_version.py ~/Downloads/cmake_min_test1
Found 32 CMake binaries from directory tools

[  0%] CMake 3.13.5   ✔ works
[ 17%] CMake 3.5.2    ✘ error
[ 33%] CMake 3.9.6    ✔ works
[ 50%] CMake 3.7.2    ✘ error
[ 80%] CMake 3.8.2    ✔ works
[100%] Minimal working version: CMake 3.8.2

cmake_minimum_required(VERSION 3.8.2)

from cmake_min_version.

yalov avatar yalov commented on May 28, 2024

it's something I had expected.

I have repeated the same with WSL ubuntu 20.04 and have installed boost there (apt install libboost-all-dev), and I got the same 3.8.

On windows I have installed boost using the
https://sourceforge.net/projects/boost/files/boost-binaries/

the problem probablly within if (WIN32) in the CMakeLists.txt

from cmake_min_version.

nlohmann avatar nlohmann commented on May 28, 2024

I now added an --error_details flag. With it, you can display the stderr output which could help identifying the reason why CMake failed.

from cmake_min_version.

yalov avatar yalov commented on May 28, 2024

I have updated the https://github.com/yalov/cmake_min_test1 a little bit
and have launched the tool with the --error_details,
the OP error is about using Visual Studio Command Prompt:

     CMake Error at CMakeLists.txt:3 (project):
     The CMAKE_CXX_COMPILER: cl
     is not a full path and was not found in the PATH.

     To use the NMake generator with Visual C++, cmake must be run from a shell
     that can use the compiler cl from the command line.  This environment is
     unable to invoke the cl compiler.  To fix this problem, run cmake from the
     Visual Studio Command Prompt (vcvarsall.bat).

     Tell CMake where to find the compiler by setting either the environment
     variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
     to the compiler, or to the compiler name if it is in the PATH.

Then I launched from the Visual Studio Command Prompt,
and the error is about being unable to find the older Platform Toolset.
Is there any way to bypass this and force the use of the installed toolset?

[ 63%] CMake 3.9.6    ✘ error
       CMake Error at CMakeLists.txt:3 (project):
         Failed to run MSBuild command:

           MSBuild.exe

         to get the value of VCTargetsPath:

           MSBuild version 17.9.8+b34f75857 for .NET Framework
           Build started 2024-04-02 23:17:52.

           Project "C:\Users\user\AppData\Local\Temp\tmpw5_v39s0\CMakeFiles\3.9.6\VCTargetsPath.vcxproj" on node 1 (default targets).
           C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(456,5): error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install Visual Studio 2017 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\user\AppData\Local\Temp\tmpw5_v39s0\CMakeFiles\3.9.6\VCTargetsPath.vcxproj]
           Done Building Project "C:\Users\user\AppData\Local\Temp\tmpw5_v39s0\CMakeFiles\3.9.6\VCTargetsPath.vcxproj" (default targets) -- FAILED.

           Build FAILED.

           "C:\Users\user\AppData\Local\Temp\tmpw5_v39s0\CMakeFiles\3.9.6\VCTargetsPath.vcxproj" (default target) (1) ->
           (PrepareForBuild target) ->
             C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(456,5): error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install Visual Studio 2017 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\user\AppData\Local\Temp\tmpw5_v39s0\CMakeFiles\3.9.6\VCTargetsPath.vcxproj]
               0 Warning(s)
               1 Error(s)
           Time Elapsed 00:00:00.23
         Exit code: 1

from cmake_min_version.

nlohmann avatar nlohmann commented on May 28, 2024

Can you successfully run cmake from the command line? You can pass any parameter also to cmake_min_version.

from cmake_min_version.

yalov avatar yalov commented on May 28, 2024

yes, cmake by itself is working.
there is a full log.
3.9 - 3.12 — it tried to build using the v141 toolset, while the v143 is installed

[  0%] CMake 3.0.2  ✘ error
       CMake Error at CMakeLists.txt:8 (message):
         CMAKE_PROJECT_VERSION is not defined


[ 14%] CMake 3.1.3  ✘ error
       CMake Error at CMakeLists.txt:8 (message):
         CMAKE_PROJECT_VERSION is not defined


[ 25%] CMake 3.2.3  ✘ error
       CMake Error at CMakeLists.txt:8 (message):
         CMAKE_PROJECT_VERSION is not defined


[ 33%] CMake 3.3.2  ✘ error
       CMake Error at CMakeLists.txt:8 (message):
         CMAKE_PROJECT_VERSION is not defined


[ 40%] CMake 3.4.3  ✘ error
       CMake Error at CMakeLists.txt:8 (message):
         CMAKE_PROJECT_VERSION is not defined


[ 45%] CMake 3.5.2  ✘ error
       CMake Error at CMakeLists.txt:8 (message):
         CMAKE_PROJECT_VERSION is not defined


[ 50%] CMake 3.6.3  ✘ error
       CMake Error at CMakeLists.txt:8 (message):
         CMAKE_PROJECT_VERSION is not defined


[ 54%] CMake 3.7.2  ✘ error
       CMake Error at CMakeLists.txt:8 (message):
         CMAKE_PROJECT_VERSION is not defined


[ 57%] CMake 3.8.2  ✘ error
       CMake Error at CMakeLists.txt:3 (project):
         No CMAKE_C_COMPILER could be found.



       CMake Error at CMakeLists.txt:3 (project):
         No CMAKE_CXX_COMPILER could be found.



[ 60%] CMake 3.9.6  ✘ error
       CMake Error at CMakeLists.txt:3 (project):
         Failed to run MSBuild command:

           MSBuild.exe

         to get the value of VCTargetsPath:

           MSBuild version 17.9.8+b34f75857 for .NET Framework
           Build started 2024-04-09 23:50:42.

           Project "C:\Users\user\AppData\Local\Temp\tmpz4a0861r\CMakeFiles\3.9.6\VCTargetsPath.vcxproj" on node 1 (default targets).
           C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(456,5): error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install Visual Studio 2017 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\user\AppData\Local\Temp\tmpz4a0861r\CMakeFiles\3.9.6\VCTargetsPath.vcxproj]
           Done Building Project "C:\Users\user\AppData\Local\Temp\tmpz4a0861r\CMakeFiles\3.9.6\VCTargetsPath.vcxproj" (default targets) -- FAILED.

           Build FAILED.

           "C:\Users\user\AppData\Local\Temp\tmpz4a0861r\CMakeFiles\3.9.6\VCTargetsPath.vcxproj" (default target) (1) ->
           (PrepareForBuild target) ->
             C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(456,5): error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install Visual Studio 2017 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\user\AppData\Local\Temp\tmpz4a0861r\CMakeFiles\3.9.6\VCTargetsPath.vcxproj]

               0 Warning(s)
               1 Error(s)

           Time Elapsed 00:00:00.20


         Exit code: 1



[ 62%] CMake 3.10.3 ✘ error
       CMake Error at CMakeLists.txt:3 (project):
         Failed to run MSBuild command:

           MSBuild.exe

         to get the value of VCTargetsPath:

           MSBuild version 17.9.8+b34f75857 for .NET Framework
           Build started 2024-04-09 23:50:42.

           Project "C:\Users\user\AppData\Local\Temp\tmp5al3om8x\CMakeFiles\3.10.3\VCTargetsPath.vcxproj" on node 1 (default targets).
           C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(456,5): error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install Visual Studio 2017 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\user\AppData\Local\Temp\tmp5al3om8x\CMakeFiles\3.10.3\VCTargetsPath.vcxproj]
           Done Building Project "C:\Users\user\AppData\Local\Temp\tmp5al3om8x\CMakeFiles\3.10.3\VCTargetsPath.vcxproj" (default targets) -- FAILED.

           Build FAILED.

           "C:\Users\user\AppData\Local\Temp\tmp5al3om8x\CMakeFiles\3.10.3\VCTargetsPath.vcxproj" (default target) (1) ->
           (PrepareForBuild target) ->
             C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(456,5): error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install Visual Studio 2017 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\user\AppData\Local\Temp\tmp5al3om8x\CMakeFiles\3.10.3\VCTargetsPath.vcxproj]

               0 Warning(s)
               1 Error(s)

           Time Elapsed 00:00:00.20


         Exit code: 1



[ 65%] CMake 3.11.4 ✘ error
       CMake Error at CMakeLists.txt:3 (project):
         Failed to run MSBuild command:

           MSBuild.exe

         to get the value of VCTargetsPath:

           MSBuild version 17.9.8+b34f75857 for .NET Framework
           Build started 2024-04-09 23:50:43.

           Project "C:\Users\user\AppData\Local\Temp\tmpdy45fod8\CMakeFiles\3.11.4\VCTargetsPath.vcxproj" on node 1 (default targets).
           C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(456,5): error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install Visual Studio 2017 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\user\AppData\Local\Temp\tmpdy45fod8\CMakeFiles\3.11.4\VCTargetsPath.vcxproj]
           Done Building Project "C:\Users\user\AppData\Local\Temp\tmpdy45fod8\CMakeFiles\3.11.4\VCTargetsPath.vcxproj" (default targets) -- FAILED.

           Build FAILED.

           "C:\Users\user\AppData\Local\Temp\tmpdy45fod8\CMakeFiles\3.11.4\VCTargetsPath.vcxproj" (default target) (1) ->
           (PrepareForBuild target) ->
             C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(456,5): error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install Visual Studio 2017 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\user\AppData\Local\Temp\tmpdy45fod8\CMakeFiles\3.11.4\VCTargetsPath.vcxproj]

               0 Warning(s)
               1 Error(s)

           Time Elapsed 00:00:00.20


         Exit code: 1



[ 67%] CMake 3.12.4 ✘ error
       CMake Error at CMakeLists.txt:3 (project):
         Failed to run MSBuild command:

           MSBuild.exe

         to get the value of VCTargetsPath:

           MSBuild version 17.9.8+b34f75857 for .NET Framework
           Build started 2024-04-09 23:50:43.

           Project "C:\Users\user\AppData\Local\Temp\tmp4fv8p4w5\CMakeFiles\3.12.4\VCTargetsPath.vcxproj" on node 1 (default targets).
           C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(456,5): error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install Visual Studio 2017 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\user\AppData\Local\Temp\tmp4fv8p4w5\CMakeFiles\3.12.4\VCTargetsPath.vcxproj]
           Done Building Project "C:\Users\user\AppData\Local\Temp\tmp4fv8p4w5\CMakeFiles\3.12.4\VCTargetsPath.vcxproj" (default targets) -- FAILED.

           Build FAILED.

           "C:\Users\user\AppData\Local\Temp\tmp4fv8p4w5\CMakeFiles\3.12.4\VCTargetsPath.vcxproj" (default target) (1) ->
           (PrepareForBuild target) ->
             C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(456,5): error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install Visual Studio 2017 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\user\AppData\Local\Temp\tmp4fv8p4w5\CMakeFiles\3.12.4\VCTargetsPath.vcxproj]

               0 Warning(s)
               1 Error(s)

           Time Elapsed 00:00:00.20


         Exit code: 1



[ 68%] CMake 3.13.5 ✔ works
[ 70%] CMake 3.14.7 ✔ works
[ 71%] CMake 3.15.7 ✔ works
[ 73%] CMake 3.16.9 ✔ works
[ 74%] CMake 3.17.5 ✔ works
[ 75%] CMake 3.18.6 ✔ works
[ 76%] CMake 3.19.8 ✔ works
[ 77%] CMake 3.20.6 ✔ works
[ 78%] CMake 3.21.7 ✔ works
[ 79%] CMake 3.22.6 ✔ works
[ 79%] CMake 3.23.5 ✔ works
[ 80%] CMake 3.24.4 ✔ works
[ 81%] CMake 3.25.3 ✔ works
[ 81%] CMake 3.26.6 ✔ works
[ 82%] CMake 3.27.9 ✔ works
[ 82%] CMake 3.28.4 ✔ works
[ 83%] CMake 3.29.0 ✔ works
[100%] Minimal working version: CMake 3.13.5

cmake_minimum_required(VERSION 3.13.5)

from cmake_min_version.

nlohmann avatar nlohmann commented on May 28, 2024

I am not using Windows myself, so I have no way to check this. Could there be environment variables that need to be set?

from cmake_min_version.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.