[cmake-developers] [CMake 0011660]: Semicolons escaped badly

Mantis Bug Tracker mantis at public.kitware.com
Wed Jan 5 18:37:41 EST 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=11660 
====================================================================== 
Reported By:                sly5
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   11660
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-01-05 18:37 EST
Last Modified:              2011-01-05 18:37 EST
====================================================================== 
Summary:                    Semicolons escaped badly
Description: 
A macro definition that contains semicolons is escaped badly on Visual Studio.
In particular, 

set_source_files_properties( main.cpp PROPERTIES COMPILE_DEFINITIONS
"MSG=\"hello\;world\"" ) 

Turns into the following switch: 

 /D "MSG=\"hello"" /D "world\\" 

It works fine on a Linux platform by correctly escaping as

-DMSG="\"hello;world\"" 


Steps to Reproduce: 
Create a CMakeLists.txt with the content: 

______________________________________________
project( Hello CXX )
cmake_minimum_required(VERSION 2.8)
add_executable( hello hello.cpp )
set_source_files_properties( hello.cpp 
   PROPERTIES COMPILE_DEFINITIONS 
   "MSG=\"hello\;world\"" 
) 
==============================================

And a hello.cpp file
______________________________________________
#include <iostream>
int main() { 
   std::cout<< MSG  <<std::endl; 
   return 0;
}
==============================================


Build and compile on Windows using Visual Studio. 
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-05 18:37 sly5           New Issue                                    
======================================================================




More information about the cmake-developers mailing list