[CMake] Problem with VS2017 and CMakeGNUtoMS_lib.bat.in (cmake-3.8-rc2)

Thompson, KT kgt at lanl.gov
Tue Mar 7 11:02:39 EST 2017


Hi,

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\GNUtoMS_lib.bat.in 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 GNUtoMS_lib.bat.in 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.

-kt
-----

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170307/d116a5e8/attachment-0001.html>


More information about the CMake mailing list