labstreaminglayer / AppTemplate_cpp_qt

An example application to stream data from a device via the Labstreaminglayer
Other
5 stars 1 forks source link

CPack failing in Windows and MacOS #5

Closed cboulay closed 4 years ago

cboulay commented 4 years ago

I played around with GitHub actions for the AudioCapture app, yml here. I have it automatically generating releases and uploading packages to the release for Ubuntu and MacOS, but not Windows.

While it's probably possible to manually zip up the contents of the install dir and upload that, I think we want CPack working once again for Windows apps. It's broken for AudioCapture, AppTemplate, LabRecorder, and indeed anything that uses liblsl/cmake/LSLCMake.cmake.

The error is EXEC : CPack error : Failed to change working directory to D:/Tools/Neurophys/labstreaminglayer/Apps/LabRecorder/build_ win/_CPack_Packages/win64/ZIP/lsl-1.13.0-win64/liblsl : No such file or directory. I have no idea where CPack gets the idea that that is the working directory.

cboulay commented 4 years ago

Maybe fixed here: https://github.com/sccn/liblsl/commit/406b5de4f35fb09b93363e668bde72fa2e2e3adc

tstenner commented 4 years ago

I've successfully CPack'ed two different apps on OS X and Windows, so it should work out of the box. Do we have to put out a new release or just a patch release (1.13.1.1) and update the packages on the release page so we don't have to change all links in the apps?

cboulay commented 4 years ago

I think patching and manually updating the packages on the release page is a good option.

cboulay commented 4 years ago

On MacOS, cmake --build build --config Release -j --target package still has a couple problems.

AppTemplate_cpp_qt $cmake --build build --config Release -j --target package
[ 16%] Automatic MOC and UIC for target AppTemplate_cpp_qt
[ 16%] Built target AppTemplate_cpp_qt_autogen
[100%] Built target AppTemplate_cpp_qt
Run CPack packaging tool...
CPack: Create package using TBZ2
CPack: Install projects
CPack: - Run preinstall target for: AppTemplate_cpp_qt
CPack: - Install project: AppTemplate_cpp_qt []
CPack: -   Install component: AppTemplate_cpp_qt
CPack: -   Install component: Unspecified
/usr/local/opt/qt/bin/macdeployqt /Volumes/STORE/Tools/Neurophys/labstreaminglayer/Apps/AppTemplate_cpp_qt/build/AppTemplate_cpp_qt.app/Contents/MacOS/AppTemplate_cpp_qt -verbose=1 --use-debug-libs
CPack: Create package
CPack: - package: /Volumes/STORE/Tools/Neurophys/labstreaminglayer/Apps/AppTemplate_cpp_qt/build/AppTemplate_cpp_qt-1.13.0-OSX64.tar.bz2 generated.
CPack: - package: /Volumes/STORE/Tools/Neurophys/labstreaminglayer/Apps/AppTemplate_cpp_qt/build/Unspecified-1.13.0-OSX64.tar.bz2 generated.

For the second problem, I could add a command to the GitHub actions to move the dylib manually. However, that won't help any Mac users who self-build. The slightly ironic thing about that is that simply "building" but not "installing" the app gives something that works because the unpackaged binary is next to the dylib.

So we still need to figure out how to get macdeployqt to package the dylib inside the .app.

cboulay commented 4 years ago

Sigh.

From here...

To include a 3rd party library in the application bundle, copy the library into the bundle manually, after the bundle is created.

So we need to get CMake to do that for us as a post-install command.

cboulay commented 4 years ago

I've adjusted the liblsl copying logic here: https://github.com/sccn/liblsl/commit/fd8e0d2f8c4c95793f8a4717f2002b6af35bc78f

I didn't realize that your pull request had the updated change but that you hadn't merged to master because you had talked about making a patch release and uploading assets. I assumed it was done. I'll see if I can fix the conflicts.