CMake Install on Windows - No windeployqt?
CMake Install on Windows - No windeployqt?
Over on the Travis discussion topic voskos is using Github's actions to create zip files with packaged executables in them, and the one for Windows does not include the Qt libraries, which have to be either installed in your system or manually copied in for the FreeCAD exe to work. A quick search of this forum yields basically no hits for the windeployqt tool, which is normally used when packaging up a Qt executable for Windows. Can anyone explain why we aren't doing that for our Windows installs? Are Windows package maintainers just copying the DLLs manually? Or how does that work?
Re: CMake Install on Windows - No windeployqt?
I use a .bat file that copies stuff over from the Libpack.
Code: Select all
REM Copy Libpack Python and (U)CRT to FreeCAD/bin
robocopy C:\Libpacks\FreeCADLibs_12.4.3_x64_VC17\bin\DLLs C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\bin\DLLs /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy C:\Libpacks\FreeCADLibs_12.4.3_x64_VC17\bin\Lib C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\bin\Lib /XD __pycache__ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy C:\Libpacks\FreeCADLibs_12.4.3_x64_VC17\bin\Scripts C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\bin\Scripts /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy C:\Libpacks\FreeCADLibs_12.4.3_x64_VC17\bin python*.* C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\bin\ /XF *.pdb /XF python*_d.* /MT:%NUMBER_OF_PROCESSORS% > nul
REM robocopy C:\Libpacks\FreeCADLibs_12.4.3_x64_VC17\bin msvc*.* C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
REM robocopy C:\Libpacks\FreeCADLibs_12.4.3_x64_VC17\bin ucrt*.* C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy Libpack QT5/plugins to FreeCAD/bin
robocopy C:\Libpacks\FreeCADLibs_12.4.3_x64_VC17\plugins C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\bin\ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy C:\Libpacks\FreeCADLibs_12.4.3_x64_VC17\bin\ QtWebEngineProces* assistant* C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\bin\ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy C:\Libpacks\FreeCADLibs_12.4.3_x64_VC17\resources C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\resources /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy C:\Libpacks\FreeCADLibs_12.4.3_x64_VC17\translations C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\translations /MT:%NUMBER_OF_PROCESSORS% > nul
REM generate qt.conf
echo [Paths] > C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\bin\qt.conf
echo Prefix =.. >> "C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\bin\qt.conf
REM get all the dependency .dll's
robocopy C:\Libpacks\FreeCADLibs_12.4.3_x64_VC17\bin *.dll C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\bin /XF *.pdb /XF api*.* /XF *d.dll /XF *_d.dll /XF *-gd-*.dll /XF *-gyd-*.dll XF/ *_debug.dll /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy C:\Libpacks\FreeCADLibs_12.4.3_x64_VC17\bin *TKG2d.dll *TKG3d.dll *TKStd.dll *TKV3d.dll C:\SoftwareProjects\FreeCAD-testbuild-12.4.3\bin /MT:%NUMBER_OF_PROCESSORS% > nul
There are also some CMake options in FreeCAD that copies stuff. The existing algorithm just copies all the stuff from the Libpack bin so you get a bunch of stuff like debug .dll's that aren't necessary. I've had on my list for a long time to port the .bat file to python and make a pull request. Alas my python skills are rudimentary at best. Also robocopy multithreading is very fast.
I don't know how much windeployqt would help as there are many other .dll's that need to be managed.
From a packaging perspective I'm interested in a way to provide delta updates that don't require continuosly downloading all the stuff that doesn't change.
"fight the good fight"
Re: CMake Install on Windows - No windeployqt?
That makes sense - I normally only have Qt and Windows DLLs, and I handle the Windows stuff separately. Do you foresee any problems if we were to integrate the DLL copy into the INSTALL target? I think we can make it smart (so it only copies them if they are different), but I think it would be nice if after running install, you actually had a functional FreeCAD. The LIBPACK_COPY variables are nice to have, but of course they only work once, and won't do an update if the libraries change, etc.
I don't know anything at all about packaging something as complex as FreeCAD, so I'm afraid I'm worthless there, though I'd be happy to help out if you need Python scripting done, etc.
Re: CMake Install on Windows - No windeployqt?
FREECAD_INSTALL_DEPEND_DIRS is set to True by default. The problem being that it copies extra stuff. You should be able to just run FreeCAD.exe from the installed FreeCAD/bin. If you just .zip the install directory the package is unnecessarily huge.
I always set FREECAD_LIBPACK_DIR, maybe when using an env variable the behaviour is different?
"fight the good fight"