Consuming WxWidgets as a subdirectory using git submodules. The wx_ui target consumes the wxwidgets target. The purpose here is to have the wx_ui executable and its dependencies under defined install/bin directory.
# Configure from root cmake -S . -B build -G "Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=install # Build & install cmake --build build --config Release --target install
After running these commands, configuration and build are done successfully. However, the installation logic is not the one I desire.
wxwidgets dependencies are placed under lib directory instead of bin under install directory. When you run the executable, the obvious happens and it throws the system error complaining cannot proceed because wxmsw330u)core_vcx64_custom.dll was not found.static libs and headers under installation directory as follows:dynamic libraries under lib by design? Am I missing to pass a CMake variable to change it? What is the way to bring the wxwidgets dependent dynamic libraries under bin or is there any wxwidgets way of doing this properly?wxwidgets headers and static libraries under installation directory. How can I achieve that here?-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.
-- Which libraries should wxWidgets use?
wxUSE_REGEX: builtin (enable support for wxRegEx class)
wxUSE_ZLIB: builtin (use zlib for LZW compression)
wxUSE_EXPAT: builtin (use expat for XML parsing)
wxUSE_LIBJPEG: builtin (use libjpeg (JPEG file format))
wxUSE_LIBPNG: builtin (use libpng (PNG image format))
wxUSE_LIBTIFF: builtin (use libtiff (TIFF file format))
wxUSE_NANOSVG: builtin (use NanoSVG for rasterizing SVG)
wxUSE_LIBLZMA: OFF (use liblzma for LZMA compression)
-- Configured wxWidgets 3.3.0 for Windows-10.0.19045
Min OS Version required at runtime: Windows Vista / Windows Server 2008 (x64 Edition)
Which GUI toolkit should wxWidgets use? msw
Should wxWidgets be compiled into single library? OFF
Should wxWidgets be linked as a shared library? ON
Which wxWidgets API compatibility should be used? 3.2
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Hi,
The wxWidgets install target was designed to do a full installation of the wxWidgets library for developers. So it includes all the headers and libraries. Your use case is (I think) never considered.
You should be able to disable wxWidgets installation by setting the wxBUILD_INSTALL option to off.
Googling also showed you might be able to use EXCLUDE_FROM_ALL to prevent the wxWidgets libary from installing: add_subdirectory(wx_widgets EXCLUDE_FROM_ALL).
wxWidgets' CMake system does not have a feature to install the used (or all) shared libraries to the install folder.
One solution I can think of is to get the output filename of the wxWidgets targets you use. Untested, but something like this for the base libarry: get_target_property(libname wx::base OUTPUT_NAME).
and then install them using install(FILES allLibNames DESTINATION bin).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Hi,
Another solution would be to use static linking of wxWidgets so that no extra library is needed.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Thanks for the responses.
As defined in 'CMake install' docs, runtime dlls are expected under 'bin' directory. What would the main motive(reason) be for placing 'dlls' under 'lib'?
Looks like I have to play some games against CMake to disable installing 'headers' and 'static libs' and moving binaries around.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Why do you want to install static libs?
There is a reason they called static...
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Why do you want to install static libs?
There is a reason they called static...
No, I don't want static libs and headers. I only want to install WxWidgets runtime libs(dlls) to be located under 'bin'.
Consuming WxWdigets as static libs is an option but I'm looking for solutions when I consume WxWidgets as shared(dynamic) libs.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
wxWidgets is a library and its CMake files are designed to install it as library, hence its shared libraries are installed under lib (i would love if it would use lib64 on platforms that use that naming style, but thats are different story). When building a library as part of your own build, you usually do not install the library itself, you install it as runtime dependency of your own application with install(RUNTIME_DEPENDENCIES). Using this command, you can control as part of your build where to install the files and adapt for the target platform, e.g. on Windows it is common to install them next to the binaries because of the lack of RPath.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
FWIW I'm building wxwidgets with the intention of packaging it as a/some nuget packages, and being able to build/install the static/dynamic flavours of wxwidgets to a named directory would make that easier.
I'm looking at LIBDIRNAME in makefile.vc (nmake build), but if the cmake build supported what @bc913 was asking for, I would prefer to use that.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()