I've written a CMakeLists.txt as shown below:
cmake_minimum_required (VERSION 3.22)
project(tutorial)
set(wxWidgets_CONFIGURATION mswu)
find_package(wxWidgets REQUIRED COMPONENTS net core base)
include(${wxWidgets_USE_FILE})
add_executable(tutorial main.cpp)
target_link_libraries(tutorial ${wxWidgets_LIBRARIES})
install(TARGETS tutorial DESTINATION bin)
include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "1")
include(CPack)
As you might guess, this is WxWidgets application.
Look at the bottom. It includes InstallRequiredSystemLibraries and CPack.
With this cmake I have generated a NSIS Cpack installer "tutorial-0.1.1-win64.exe". But this installer only installs the project binary and some runtime libraries. It doesn't install any WxWidgets library. So the project binary fails to run on other systems that is not installed WxWidgets libraries.
I'd like to make NSIS Cpack installer installs WxWidgets DLL libraries also. How can I make it?
See! Those binaries are needed to be installed! But NSIS Cpack installer doesn't install wxbase315ud_vc14x_x64.dll and wxmsw315ud_core_vc14x_x64.dll
I am working on Windows 10
I don't want to statically link to the WxWidgets libraries. I'd like to make it link dynamically with shared libraries.