[CMake] Visual Studio 2017

Matějů Miroslav, Ing. Mateju.Miroslav at azd.cz
Fri Sep 15 08:15:21 EDT 2017


Hello Randy,

From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Randy Heiland
Sent: Friday, September 15, 2017 1:38 PM

> Is there a "best way" to use cmake for VS17 (but same cakelists for Linux)? And by "best", I mean with minimal effort on users.
> To be more specific, on Windows, I *think* I'd like to have users install the cmake binary, then use Powershell to build an application.
Is there really a need for using PowerShell if you also want to use the same CMakeLists for Linux?

> But my initial attempt to do so is confusing. I install VS17 (for C++), it installs in standard path, but 'cl' is not found in Powershell. I read that I shouldn't edit my PATH (nor do I really want users to have to), but run some .bat instead to setup my env. So, how should one specify the compiler for cmake? Oh yes, then I see that VS17 also has its own cmake??
Have you run CMake successfully yet? I am not really aware how it works but CMake *can* for sure detect VS in my CLI environment without having VS in PATH. If you use an IDE that understands CMake (like VS17 or Qt Creator, for example), you should be able to open a CMake project in the IDE and build it there. Please report your particular problem if it does not work for you.
If you prefer to run cl.exe in CLI, then vcvarsall.bat is the .bat file you are looking for.

Best regards,

Ing. Miroslav Matějů
Programmer Analyst

AŽD Praha s.r.o.
Technology Division
Research and Development
Žirovnická 2/3146, 106 17  Prague
Czech Republic
Phone: +420 267 287 476
Web: www.azd.cz


More information about the CMake mailing list