CMake: how to determine all the .DLL/.SO files that are need for an executable?

前端 未结 2 472
感动是毒
感动是毒 2020-12-16 04:58

Let\'s assume my program needs several DLL\'s to work. I should provide that DLLs to the user in my distribution. For now I need QtCore4.DLL, QtGui4.DLL, msvcp90.DLL, msvcr9

2条回答
  •  清酒与你
    2020-12-16 05:00

    As suggested by Andre there is InstallRequiredSystemLibraries for finding/installing the correct C/C++ runtime. There is also BundleUtilities that can be used to find the other dependencies of your application, library and/or plugins.

    It can never pick things up like runtime loaded plugins, but you can add them along with the library directories that should be used. In the most recent versions of CMake quite a few improvements have been made to make BundleUtilities more reliable on all platforms.

提交回复
热议问题