MantisBT - CMake
View Issue Details
0015186CMakeCMakepublic2014-10-02 09:412015-04-06 09:07
Clinton Stimpson 
 
normalminoralways
closedwon't fix 
 
 
0015186: target names restricted to ascii since 3.0
Using the project attached here:
http://www.cmake.org/Bug/view.php?id=14934 [^]

I get a warning:
CMake Warning (dev) at CMakeLists.txt:31 (add_executable):
  Policy CMP0037 is not set: Target names should not be reserved and should
  match a validity pattern. Run "cmake --help-policy CMP0037" for policy
  details. Use the cmake_policy command to set the policy and suppress this
  warning.

  The target name "教學程式" is reserved or not valid for certain CMake
  features, such as generator expressions, and may result in undefined
  behavior.


cmGeneratorExpression::IsValidTargetName() has this:

  static cmsys::RegularExpression targetNameValidator("^[A-Za-z0-9_.:+-]+$");
  return targetNameValidator.find(input);

Perhaps the regex can be inverted and specific characters which are disallowed should be searched for.
No tags attached.
Issue History
2014-10-02 09:41Clinton StimpsonNew Issue
2014-10-02 09:45Brad KingNote Added: 0036887
2014-10-02 10:03Clinton StimpsonNote Added: 0036888
2014-10-02 10:06Brad KingStatusnew => resolved
2014-10-02 10:06Brad KingResolutionopen => won't fix
2015-04-06 09:07Robert MaynardNote Added: 0038417
2015-04-06 09:07Robert MaynardStatusresolved => closed

Notes
(0036887)
Brad King   
2014-10-02 09:45   
Logical target names should be like C identifiers. The OUTPUT_NAME target property can be used to give the binary a fancy name.

We don't know the set of disallowed characters because lots of native tools have random limitations with non-C-identifer names. Even if we enumerated all known limitations now, new native tools in the future could add new ones.
(0036888)
Clinton Stimpson   
2014-10-02 10:03   
Ok. The OUTPUT_NAME solution works just fine.
(0038417)
Robert Maynard   
2015-04-06 09:07   
Closing resolved issues that have not been updated in more than 4 months.