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:
- Change the project name from 'Project' to 'Project-name-with-dashes'
- Copy
cmake/ProjectConfig.cmake.in to Project-name-with-dashesConfig.cmake.in
make test
- Inspect the generated header in
build/include/project-name-with-dashes
- 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.
Describe the bug
The generated
version.hppis 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.hppis not added to the include path, which makes it unusable from within the project itself.To Reproduce
Steps to reproduce the behavior:
cmake/ProjectConfig.cmake.intoProject-name-with-dashesConfig.cmake.inmake testbuild/include/project-name-with-dashesExpected behavior
version.hpp.