VCTargetsPath error while using VS 10 2010 generator

lsoranco
Tue, 12 Jul 2022 11:50:39 +0000
Usage

Hello!

I am absolutely new to CMake (in fact I am still figuring out its purpose, not usually to languages that are complex to compile, programmed most of my stuff on Python and Rust), so please bear with me if the question is too obvious:

I am trying to use CMake in FyTest, in order to have a Fortran unit testing framework. The command I am running on the root of the folder (I am using the cmd prompt as the interface) of the repository clone is simply:

cmake -G "Visual Studio 10 2010" .

And I get the following error:

  Failed to run MSBuild command:

    C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe

  to get the value of VCTargetsPath:

    Microsoft (R) Build Engine version 4.8.4084.0
    [Microsoft .NET Framework, version 4.0.30319.42000]
    Copyright (C) Microsoft Corporation. All rights reserved.

    Build started 12/07/2022 08:30:02.
    Project "C:\Users\<REDACTED>\Desktop\fytest\CMakeFiles\3.22.5\VCTargetsPath.vcxproj" on node 1 (default targets).
    C:\Users\<REDACTED>\Desktop\fytest\CMakeFiles\3.22.5\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
    Done Building Project "C:\Users\<REDACTED>\Desktop\fytest\CMakeFiles\3.22.5\VCTargetsPath.vcxproj" (default targets) -- FAILED.

    Build FAILED.

    "C:\Users\<REDACTED>\Desktop\fytest\CMakeFiles\3.22.5\VCTargetsPath.vcxproj" (default target) (1) ->
      C:\Users\<REDACTED>\Desktop\fytest\CMakeFiles\3.22.5\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

        0 Warning(s)
        1 Error(s)

    Time Elapsed 00:00:00.19


  Exit code: 1



-- Configuring incomplete, errors occurred!
See also "C:/Users/<REDACTED>/Desktop/fytest/CMakeFiles/CMakeOutput.log".

In fact, this computer doesn’t have a C++ compiler, which I recognize is what CMake is complaining about not finding, but the computer I am using belongs to a company, and I am not allowed to install a C++ compiler on my own. Furthermore, as it can be seen from the line where the error occurs:

project(FyTest VERSION 0.1 LANGUAGES Fortran)

This project is built entirely in Fortran, so it shouldn’t require a C++ compiler.

So my questions are: Can I “turn off” this requirement for a C++ compiler? Is this something that CMake demands, or should it be okay with just the Fortran compiler? Or is this MSBuild fault?

10 posts - 3 participants