T-Rex / wxModularApp

Cross-Platform Modular Application (Main app + plugins) example for C++/wxWidgets
30 stars 17 forks source link

Unable to run cm.bat using VS2019 and VS2017 Native command prompt #4

Closed SohaibImranBhatti closed 3 years ago

SohaibImranBhatti commented 3 years ago

Hi, I am on a windows platform. I followed the readme for compiling the repository. The difference is that I am using Native Tools for Command Prompt VS2017 or VS2019. When I run the cm,bat file by navigating the command prompt to the build folder. The following error occurs.

CMake Error at CMakeLists.txt:20 (project): 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.3761.0 [Microsoft .NET Framework, version 4.0.30319.42000] Copyright (C) Microsoft Corporation. All rights reserved.

and also

E:\wxModularApp-master\build\Win\CMakeFiles\3.12.18081601-MSVC_2\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "E:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. Done Building Project "E:\wxModularApp-master\wxModularApp-master\build\Win\CMakeFiles\3.12.18081601-MSVC_2\VCTargetsPath.vcxproj" (default targets) -- FAILED. Build FAILED.

Even after setting the VCTargetsPath in the environment variable the file Microsoft.Cpp.Default.props is not found. Because I am unable to find this file there. Any solution

T-Rex commented 3 years ago

Hi. What version of CMake are you using and Windows version?

T-Rex commented 3 years ago

You need to specify the correct CMake generator name in the cm86.bat or cm64.bat For Visual Studio 2017 and 2019 this will be:

Visual Studio 16 2019        = Generates Visual Studio 2019 project files.
                                 Use -A option to specify architecture.
Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
                                 Optional [arch] can be "Win64" or "ARM".

The exact generator name will depend on how you have built the wxWidgets itself.

SohaibImranBhatti commented 3 years ago

Thanks a lot for the response