Backport for 5.0.7#2785
Backport for 5.0.7#2785Rot127 merged 1 commit intocapstone-engine:v5from scribam:v5-backport-cmake-fix
Conversation
|
This commit doesn’t actually fix the root cause. It ends up leaving capstone VERSION empty, which triggers a CMake warning: What we need instead is to handle the case where PROJECT_VERSION is an empty string and set value. The next 6.0.0 alpha branch shows the intended behavior: With that in place, the following change shouldn’t be necessary anymore: f557fa2 |
|
PR updated with the CMakeLists.txt change from ebe3ef2 |
My commit is obligatory for get works in old cmd, it no reconize argument without "..." |
|
It happened because |
Should works yes, but keep need " " for correct passe full argument of version in regex match for more info: Without quotes:
If PROJECT_VERSION is 6.0.0, CMake expands this to:
CMake interprets 6.0.0 as three separate arguments (6, 0, 0) instead of a single string. With quotes:
The value is passed as one single string ("6.0.0"), and the regex works correctly. So while the logic for handling undefined or empty variables avoids the “empty string” issue, quotes are still required to prevent argument splitting when the variable contains dots, spaces, or other special characters. |
|
In CMake, arguments are split by whitespace and by semicolons (list separators), not by dots. So it does not become three arguments 6 0 0. 6.0.0 is a single unquoted token, so this works fine. You can try and this and it results in : |
i have open my pr and and fixed issue litterlay because with also adding (OR PROJECT_VERSION STREQUAL "") |
Rot127
left a comment
There was a problem hiding this comment.
@Zangetsu38 What is your cmake version?
i have updated again, so here works fine, but during particular inside build and cmake version, if using old cmd, it request obloigatory " " on argument in regex for works |
|
also,j change on seqtral is from here is better take commit with original author i thinks, same for my commit |
This is ok. But what is your cmake version? We need to bump the minimum required version in the build files. If we know your version it is easier to find the exact version the behavior changes. |
here i have just last version, or recent, 4.1.1, but i no remmember for preview have get issue |
|
@Zangetsu38 Please check if you maybe run into the https://cmake.org/cmake/help/latest/policy/CMP0054.html behavior. |
Thanks for the hint! In my case it was not related to CMP0054 and |

GitHub Actions has started to roll out CMake 4 so projects using capstone will be hit by this issue #2778 and build workflows will fail.
Hence, I would like to have the fix (f557fa2) added to the v5 branch ASAP and a new tag created (5.0.7) so people can upgrade and avoid build issues.