Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version not parsed from mutliline project() syntax in CMakeLists.txt #1597

Open
asztalosdani opened this issue Jan 24, 2025 · 2 comments
Open

Comments

@asztalosdani
Copy link
Contributor

#1589 is a fix for the project(MyProject VERSION 2.1.3) syntax, but

project(MyProject
    VERSION 2.1.3)

is also valid and cdxgen cannot parse this correctly. Unfortunately parseCmakeLikeFile() works by splitting the CMakeLists.txt into lines and going line-by-line, so I don't see a simple fix for this. I see two directions, rewrite it to use regex matching to find all parts, or use a library to parse the CMakeLists.txt files if such library exists.

@prabhu
Copy link
Collaborator

prabhu commented Jan 24, 2025

can we try .replace(/\n(\s)+/g, " ") before splitting line by line?

@prabhu
Copy link
Collaborator

prabhu commented Feb 2, 2025

Please send a pull request if you get this working. Long term, we can try to find a AST parser for these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants