Problem with VS2017 and (cmake-3.8-rc2)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Problem with VS2017 and (cmake-3.8-rc2)

Thompson, KT



I use the CMakeAddFortranSubdirectory feature in one of my projects.  This appears to be broken under Visual Studio 2017 Community Edition RC because CMake\share\cmake-3.8\Modules\Platform\ generates a batch file that contains:


call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"


and this batch function changes the current working directory to %USERPROFILE%/Source (unlike earlier versions) .  Has anyone else seen this?


I have fixed the issue by replacing the cmake provided with


@echo off

set CWD=%CD%

call "@CMAKE_GNUtoMS_BAT@"

cd /d %CWD%

lib /machine:"@CMAKE_GNUtoMS_ARCH@" %*


I'm not sure if CMake needs to make this change more permanent or if this is a bug in VS2017.





Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: