Skip to content

[BUG] Invalid version header for project name not valid as a C identifier #54

@arnaud-m

Description

@arnaud-m

Describe the bug
The generated version.hpp is invalid when the project name is not a valid C identifier.
For example, project names containing dashes (-) result in invalid C symbols.

In addition, the generated version.hpp is not added to the include path, which makes it unusable from within the project itself.

To Reproduce
Steps to reproduce the behavior:

  1. Change the project name from 'Project' to 'Project-name-with-dashes'
  2. Copy cmake/ProjectConfig.cmake.in to Project-name-with-dashesConfig.cmake.in
  3. make test
  4. Inspect the generated header in build/include/project-name-with-dashes
  5. Try to include 'version.hpp' from the project source.

Expected behavior

  • The project name should be transformed into a valid C identifier when generating version.hpp.
  • The generated header should be added to the project's include path for the library and executable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions