-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
Parsing the version from CMakeLists.txt is broken #1589
Comments
@asztalosdani can you try this and send a PR if it works.
We may have to test with some meson.build projects as well. Bonus points if you could add few more unit tests. |
asztalosdani
added a commit
to asztalosdani/cdxgen
that referenced
this issue
Jan 24, 2025
asztalosdani
added a commit
to asztalosdani/cdxgen
that referenced
this issue
Jan 24, 2025
Signed-off-by: Daniel Asztalos <[email protected]>
This was referenced Jan 24, 2025
prabhu
pushed a commit
that referenced
this issue
Jan 24, 2025
* Fix version parsing in CMakeLists files #1589 Signed-off-by: Daniel Asztalos <[email protected]> * Lint fixes Signed-off-by: asztalosdani <[email protected]> --------- Signed-off-by: Daniel Asztalos <[email protected]> Signed-off-by: asztalosdani <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running cdxgen does not extract the version from the
CMakeLists.txt
correctly.cdxgen version: 11.1.1
How to reproduce:
CMakeLists.txt
cdxgen -t cpp -o bom.json
in that folderbom.json
metadata > component > version
attribute should be filled, but it is empty.Additional info
I noticed in the
parseCmakeLikeFile()
function it looks for lowercase"version"
.cdxgen/lib/helpers/utils.js
Lines 13177 to 13180 in 459dfe1
So I tried changing
project(MyProject VERSION 2.1.3)
toproject(MyProject version 2.1.3)
, and it extracted the version correctly, but this is not a valid CMakeLists syntax.Then in
cdxgen/lib/helpers/utils.js
Lines 13182 to 13187 in 459dfe1
it says, if the version is empty, it gets it from the options.projectVersion, so I tried running it with
--project-version=1.2.4
, but it did not do anything.The text was updated successfully, but these errors were encountered: