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             
      
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to