CMake Config mode issues (Issue #22716)

62 views
Skip to first unread message

Steffen Olszewski

unread,
Aug 8, 2022, 11:39:18 AM8/8/22
to wx-...@googlegroups.com, Subscribed

I am building wxWidgets myself on Windows using CMake and use it in my projects, which are beeing build by CMake as well, and wanted to use find_package() in Config mode instead of Module mode. I am using a monolithic build of wxWidgets and link statically. The switch from Module mode to Config mode was not that simple because both modes apparently work a bit different. I am not sure if all of these differences are by intent, so here are my observations.

  1. Config mode always requires an exact match of the library version. Currently, this is 3.3.0, so the following call works: find_package(wxWidgets 3.3.0 CONFIG COMPONENTS mono), while this one doesn't: find_package(wxWidgets 3.1.5 CONFIG COMPONENTS mono). Since i'm not requesting an exact match, the second call should also succeed. Or at least it should accept 3.2.0, which is the current release version.
  2. Config mode links internal libraries automatically while Module mode doesn't. In my case, i need png, in Module mode i have to specify mono png but in Config mode this errors out because png cannot be found. The automatic linking seems to be the right thing to do, not sure if Module mode can be changed to do this as well.
  3. In Config mode i have to search manually for the OpenGL package or i get an error because of a missing library. I am not using OpenGL so in Module mode i didn't get any error, i'm not sure whats the right thing to do in this case.
  4. Config Mode does not search for wxrc and does not populate the CMake Variable wxWidgets_wxrc_EXECUTABLE. Granted, this is not really part of the wxWidgets library and cannot really be expressed by targets, but Module Mode does populate this variable automatically.


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/issues/22716@github.com>

Andrea Pappacoda

unread,
Aug 27, 2022, 5:55:08 PM8/27/22
to wx-...@googlegroups.com, Subscribed

Config mode always requires an exact match of the library version. Currently, this is 3.3.0, so the following call works: find_package(wxWidgets 3.3.0 CONFIG COMPONENTS mono), while this one doesn't: find_package(wxWidgets 3.1.5 CONFIG COMPONENTS mono). Since i'm not requesting an exact match, the second call should also succeed. Or at least it should accept 3.2.0, which is the current release version.

I think that the current behaviour is correct. 3.3 is not compatible with 3.2, so find_package() is refusing to use it. See also:

https://github.com/wxWidgets/wxWidgets/blob/7bfad4984c7973653c56cf0a9cfb514475940680/build/cmake/install.cmake#L57-L70


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/issues/22716/1229275232@github.com>

oneeyeman1

unread,
Aug 27, 2022, 6:37:28 PM8/27/22
to wx-...@googlegroups.com, Subscribed

@sodevel,
Just an FYI
Unless you plan to work on developing CodeBlocks you don't need monolithic build.
Thank you.


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/issues/22716/1229281670@github.com>

VZ

unread,
Aug 28, 2022, 2:33:38 PM8/28/22
to wx-...@googlegroups.com, Subscribed

FWIW, I think (4) is a bug, but I'm not sure about the others as I never fully understood all the differences between the two modes.


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/issues/22716/1229527012@github.com>

StefanBruens

unread,
Aug 30, 2022, 1:08:36 PM8/30/22
to wx-...@googlegroups.com, Subscribed

For (4), wxrc should be put in a separate EXPORT set, and the resultant export file should be included from the main wx Config cmake file. The include should be optional, so the find_package does not fail if wxrc is not available.

Ideally, each COMPONENT is put in a separate export set, or at least the ones with different, large external dependencies. E.g. one export set for the non-GUI components, one for the core GUI components, one for e.g. the Webview, etc.


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/issues/22716/1231937626@github.com>

Reply all
Reply to author
Forward
0 new messages