CMake: Create a config file for use with find_package (PR #22536)

73 views
Skip to first unread message

Maarten

unread,
Jun 15, 2022, 1:55:41 PM6/15/22
to wx-...@googlegroups.com, Subscribed

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

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

Commit Summary

  • dc42b45 CMake: Allow to use wxLIB_TARGETS in install.cmake
  • 8ea2972 CMake: Create a config file for use with find_package
  • 146c186 CMake: Use CONFIG in the minimal sample
  • 0e4f859 CMake: Prevent double directory separators
  • f06fc78 CMake: Never use Windows path separators in install prefix
  • fa1d22a CMake: Use correct INSTALL_INTERFACE include directory on Linux

File Changes

(7 files)

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

Maarten

unread,
Jun 15, 2022, 5:13:03 PM6/15/22
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.

  • 85ea32a CMake: Set correct variable in AppVeyor build


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22536/push/10173604739@github.com>

Maarten

unread,
Jun 16, 2022, 4:07:10 PM6/16/22
to wx-...@googlegroups.com, Push

@MaartenBent pushed 3 commits.

  • 509fe46 CMake: Don't use imported target for target_include_directories
  • ec397a1 CMake: Add wxWidgets_LIBRARIES to config similar to FindwxWidgets
  • 01b5890 CMake: Add workaround for ALIAS with CMake older dan 3.18


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22536/push/10183939254@github.com>

Maarten

unread,
Jun 16, 2022, 4:38:50 PM6/16/22
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.

  • 11690f2 CMake: Improve mapping configurations


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22536/push/10184169150@github.com>

Maarten

unread,
Jun 16, 2022, 5:35:15 PM6/16/22
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.

  • ee2a30c CMake: Only map configs when Release build is available


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22536/push/10184558447@github.com>

Maarten

unread,
Jun 17, 2022, 2:26:49 PM6/17/22
to wx-...@googlegroups.com, Push

@MaartenBent pushed 4 commits.

  • f540e24 Merge remote-tracking branch 'upstream/master' into cmake-config-file
  • 686b070 CMake: consistent [wx_]install usage
  • b838572 CMake: Only map when configs do not exist
  • 6943deb CMake: Support target files of multiple builds


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22536/push/10193506543@github.com>

Maarten

unread,
Jun 18, 2022, 10:13:35 AM6/18/22
to wx-...@googlegroups.com, Push

@MaartenBent pushed 9 commits.

  • efa5cfc CMake: Prevent double directory separators
  • 2e2e96f CMake: Don't use Windows path separators in install prefix
  • 9d75776 CMake: Consistent [wx_]install usage
  • 9ffe6f5 CMake: Use correct INSTALL_INTERFACE include directory on Linux
  • ef29f74 CMake: Allow to use wxLIB_TARGETS in install.cmake
  • 308376d CMake: Create a config file for use with find_package
  • 3d52f80 CMake: Use find_package with CONFIG mode in the minimal sample
  • a175c2e CMake: Set correct variable in AppVeyor build
  • b767c6b CMake: Support target files of multiple builds


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22536/push/10198083337@github.com>

Maarten

unread,
Jun 18, 2022, 11:07:03 AM6/18/22
to wx-...@googlegroups.com, Push

@MaartenBent pushed 4 commits.

  • f6631a3 CMake: Create a config file for use with find_package
  • 629866d CMake: Use find_package with CONFIG mode in the minimal sample
  • 8181359 CMake: Set correct variable in AppVeyor build
  • 978271e CMake: Support target files of multiple builds


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/22536/push/10198287249@github.com>

Maarten

unread,
Jun 19, 2022, 11:51:21 AM6/19/22
to wx-...@googlegroups.com, Subscribed

Ready for review/merge.


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/22536/c1159762052@github.com>

VZ

unread,
Jun 19, 2022, 3:48:56 PM6/19/22
to wx-...@googlegroups.com, Subscribed

Thanks a lot!

Should we update docs/doxygen/overviews/cmake.md to recommend using the new method?


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/22536/c1159799808@github.com>

Ian McInerney

unread,
Jun 20, 2022, 7:22:50 AM6/20/22
to wx-...@googlegroups.com, Subscribed

Should we update docs/doxygen/overviews/cmake.md to recommend using the new method?

This method is only possible if the system wx library is compiled using its CMake build chain, since it requires wx to create the config files and install them. I believe many places still use the automake build system instead of the CMake-based build system (at least the Debian, Fedora and Homebrew build scripts do), which won't get the CMake config files created and installed. Adding the CONFIG flag to the find_package step on consumer applications will cause it to only look for the config files, which I think then would cause issues with locating the wx libraries for consumers using the automake-built library version (since it will skip using FindwxWidgets.cmake included with projects and CMake itself, and instead look for the non-existent config files).

The only way I can see this becoming the recommended method is if the recommended default build system for wx itself is also changed to be CMake and the packagers update to use that as well.


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/22536/c1160323815@github.com>

VZ

unread,
Jun 20, 2022, 6:07:00 PM6/20/22
to wx-...@googlegroups.com, Subscribed

After reading the docs it seems that without either MODULE or CONFIG both modes will be used, but it seems that MODULE is used first and if FindwxWidgets.cmake is found, it's probably going to result in an error even if using CONFIG would have succeeded, is this right?

So it seems like you'd actually need to use find_package(... CONFIG) first and then, if it fails, find_package(... MODULE). But this is, of course, too ugly to recommend and hence it would not be worth updating the documentation to mention it.

So, finally, let's merge this and, if there is some better way, update the docs later.

Thanks again, Maarten!


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/22536/c1160884532@github.com>

VZ

unread,
Jun 20, 2022, 6:08:27 PM6/20/22
to wx-...@googlegroups.com, Subscribed

Merged #22536 into master.


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/22536/issue_event/6842284740@github.com>

Reply all
Reply to author
Forward
0 new messages