The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=15865 
====================================================================== 
Reported By:                temp4746
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15865
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-11-26 14:11 EST
Last Modified:              2015-11-26 14:11 EST
====================================================================== 
Summary:                    Can't use /PDBALTPATH:%_PDB% in MSVC IDE generator
due to CMake escaping percent signs
Description: 
When using the MSVC generator and using a linker flag that is added to the
AdditionalOptions of the linker in the vcxproj, CMake will escape the linker
flag.

For example it will double up percent signs in a flag such as:

/PDBALTPATH:%_PDB%

Resuling in:

/PDBALTPATH:%%_PDB%%

Which is wrong in the MSVC IDE but might be correct for makefile generators.
This prevents using this flag properly.

Any fix for this need to be carefully thought out to prevent introducing an
escaping bug in a different location in CMake.

BTW if you try using percent signs in a compiler option it will escape it TWICE
meaning you get FOUR percent signs for one percent sign.

Steps to Reproduce: 
Try the following:

cmake_minimum_required(VERSION 3.4)
project(Bug)
add_executable(bug main.cpp)
set_target_properties(bug PROPERTIES LINK_FLAGS "/PDBALTPATH:%_PDB%")

And look in the IDE under linker->Command Line
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-11-26 14:11 temp4746       New Issue                                    
======================================================================

-- 

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