Looks like '+' is not a valid character for the target name. 

 

Specifically, cmGeneratorExpression.cxx does not have it as part of the
regular expression to match target names: (line 23 on)

 

 

  this->TargetInfo.compile("^\\$<TARGET"

                           "(|_SONAME|_LINKER)"  // File with what
purpose?

                           "_FILE(|_NAME|_DIR):" // Filename component.

                           "([A-Za-z0-9_.-]+)"   // Target name.

                           ">$");

 

(In case you're unfamiliar with regular expressions, that + is just to
denote 1 or more of the things between the [ and ] . )

 

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.

 

Aaron Meadows

 

From: [email protected] [mailto:[email protected]] On Behalf
Of Kozlovskiy, Alexey
Sent: Tuesday, February 14, 2012 5:38 AM
To: [email protected]
Subject: [CMake] $<TARGET_FILE:tgt> in the add_custom_command()

 

Hi,

 

If the project name has a symbols "-" or "+" the $<TARGET_FILE:tgt> in
the add_custom_command() return Error: "Error evaluating generator
expression"

 

For example:

SET ( PROJECT_NAME "00010-Liquid+Gas_as_capture " )

set ( SRCS_MAIN_CPT main.c      )

add_executable ( ${ PROJECT_NAME } ${SRCS_MAIN_CPT} )

 

add_custom_command ( TARGET ${ PROJECT_NAME } POST_BUILD 

                                            COMMAND "$<TARGET_FILE:${
PROJECT_NAME }>" 

                                            ARGS "$<TARGET_FILE_DIR:${
PROJECT_NAME }>/110.cnf"

                                            COMMENT "Running cpt.exe..."

 


)

 

When I run the CMake I received the following error:

 

"CMake Error at problems.rt.Cmake:114 (add_custom_command):

  Error evaluating generator expression:

    $<TARGET_FILE:00010-Liquid+Gas_as_capture>

Expression syntax not recognized."

 

Is this a bug or some syntax limitation?

 

Regards,

Alexey

 

 


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

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to