[cmake-developers] [CMake 0015808]: POST_BUILD command for "Visual Studio 14 2015" generates superfluous "C:"

Mantis Bug Tracker mantis at public.kitware.com
Sun Oct 25 22:24:41 EDT 2015


The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=15808 
====================================================================== 
Reported By:                ovz
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15808
Category:                   CMake
Reproducibility:            always
Severity:                   block
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2015-10-25 22:24 EDT
Last Modified:              2015-10-25 22:24 EDT
====================================================================== 
Summary:                    POST_BUILD command for "Visual Studio 14 2015"
generates superfluous "C:"
Description: 
If I specify WORKING_DIRECTORY in add_custom_command(... POST_BUILD ..) the
following snippet is generated in Post-Build event code. Note that extra command
specifying just "C:" after expected cd command. 

setlocal
cd C:\__temp\src\cmake\post_build_work_dir\build\working_dir
if %errorlevel% neq 0 goto :cmEnd
C:
if %errorlevel% neq 0 goto :cmEnd




Steps to Reproduce: 
* Unpack post_build_work_dir.zip in attachment. 

* You can inspect contents of the build directory. These are CMake generated
files I get on my machine. 

* Clean up build directory

* Run commands

cd build
cmake -G "Visual Studio 14 2015" ..

* Open build/post_build_work_dir.sln

* In Visual Studio right-click on post_build_work_dir project. Select Properties

* Navigate to Configuration Properties > Build Events > Post-Build Event

* Note the extra "C:" command in the post-build event text





Additional Information: 
Here is full text of Post-Build event generated after following steps of
reproduction

setlocal
cd C:\__temp\src\cmake\post_build_work_dir\build\working_dir
if %errorlevel% neq 0 goto :cmEnd
C:
if %errorlevel% neq 0 goto :cmEnd
some_command
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-10-25 22:24 ovz            New Issue                                    
2015-10-25 22:24 ovz            File Added: post_build_work_dir.zip             
      
======================================================================



More information about the cmake-developers mailing list