<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Arial","sans-serif";
        color:#7F7F7F;
        font-weight:bold;
        font-style:normal;
        text-decoration:none none;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:56.7pt 42.5pt 56.7pt 85.05pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'>Looks like ‘+’ is not a valid character for the target name. <o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'>Specifically, cmGeneratorExpression.cxx does not have it as part of the regular expression to match target names: (line 23 on)<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas;color:black'> this->TargetInfo.compile("^\\$<TARGET"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas;color:black'> "(|_SONAME|_LINKER)" // File with what purpose?<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas;color:black'> "_FILE(|_NAME|_DIR):" // Filename component.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas;color:black'> "([A-Za-z0-9_.-]+)" // Target name.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas;color:black'> ">$");<o:p></o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'>(In case you’re unfamiliar with regular expressions, that + is just to denote 1 or more of the things between the [ and ] . )<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'>I tried adding + to that list, but I’m not sure how (if it’s possible) to escape it (and it resulted in a regular expression compile error (runtime)). I’d suggest using something else instead of a + in your target name.<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><div><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'>Aaron Meadows</span></b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'><o:p></o:p></span></p></div><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> cmake-bounces@cmake.org [mailto:cmake-bounces@cmake.org] <b>On Behalf Of </b>Kozlovskiy, Alexey<br><b>Sent:</b> Tuesday, February 14, 2012 5:38 AM<br><b>To:</b> cmake@cmake.org<br><b>Subject:</b> [CMake] $<TARGET_FILE:tgt> in the add_custom_command()<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoPlainText><span lang=RU>Hi,<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>If the project name has a symbols “-” or “+” the $<TARGET_FILE:tgt> in the add_custom_command() return Error: “Error evaluating generator expression”<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For example:<o:p></o:p></p><p class=MsoNormal>SET ( PROJECT_NAME "00010-Liquid+Gas_as_capture " )<o:p></o:p></p><p class=MsoNormal>set ( SRCS_MAIN_CPT main.c )<o:p></o:p></p><p class=MsoNormal>add_executable ( ${ PROJECT_NAME } ${SRCS_MAIN_CPT} )<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>add_custom_command ( TARGET ${ PROJECT_NAME } POST_BUILD <o:p></o:p></p><p class=MsoNormal> COMMAND "$<TARGET_FILE:${ PROJECT_NAME }>" <o:p></o:p></p><p class=MsoNormal> ARGS "$<TARGET_FILE_DIR:${ PROJECT_NAME }>/110.cnf"<o:p></o:p></p><p class=MsoNormal> COMMENT "Running cpt.exe..."<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>When I run the CMake I received the following error:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>“CMake Error at problems.rt.Cmake:114 (add_custom_command):<o:p></o:p></p><p class=MsoNormal> Error evaluating generator expression:<o:p></o:p></p><p class=MsoNormal> $<TARGET_FILE:00010-Liquid+Gas_as_capture><o:p></o:p></p><p class=MsoNormal>Expression syntax not recognized.”<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Is this a bug or some syntax limitation?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Regards,<o:p></o:p></p><p class=MsoNormal>Alexey<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html><br>
This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.