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 · 1 comment
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?

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