Slightly simplify and make more robust CMake version parsing (PR #26382)

19 views
Skip to first unread message

VZ

unread,
Apr 15, 2026, 11:53:39 AM (9 days ago) Apr 15
to wx-...@googlegroups.com, Subscribed

Check that we parsed all version components and avoid doing 2 regex matches for every component when we can just use CMAKE_MATCH_1 directly.


@MaartenBent This is very minor, but I was just implementing something similar in my own code and I was wondering why did wx do it in the more complicated way. I couldn't find any answer (CMAKE_MATCH_1 seems to be available since always), so I've decided to change it and ask you if you see anything wrong with it, so that I could fix my own code if necessary. And if not, I think this is slightly better, isn't it?


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26382

Commit Summary

  • 3aa9f42 Slightly simplify and make more robust CMake version parsing

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26382@github.com>

Maarten

unread,
Apr 18, 2026, 5:14:03 PM (6 days ago) Apr 18
to wx-...@googlegroups.com, Subscribed
MaartenBent left a comment (wxWidgets/wxWidgets#26382)

I don't know why, it has been there since CMake support was added.

Personally I would use a macro instead of a function, and then get rid of PARENT_SCOPE.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26382/c4274574694@github.com>

VZ

unread,
Apr 18, 2026, 6:24:20 PM (6 days ago) Apr 18
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26382)

Thanks, I'll change it to the macro — I tend to avoid them for hygienic reasons, but you're right that it should probably be fine for such a simple case.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26382/c4274676099@github.com>

VZ

unread,
Apr 18, 2026, 6:28:36 PM (6 days ago) Apr 18
to wx-...@googlegroups.com, Subscribed

Closed #26382.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26382/issue_event/24643261843@github.com>

VZ

unread,
Apr 18, 2026, 6:28:38 PM (6 days ago) Apr 18
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26382)

Applied in the commit above.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26382/c4274681785@github.com>

Reply all
Reply to author
Forward
0 new messages