Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSL for IOS (iPad, Iphone) cmake #186

Open
VladimirR46 opened this issue Mar 9, 2023 · 3 comments
Open

LSL for IOS (iPad, Iphone) cmake #186

VladimirR46 opened this issue Mar 9, 2023 · 3 comments

Comments

@VladimirR46
Copy link

Hello!

Our team wants to use an iPad (Air 5) for a series of experiments. Our stimulus program is written in Qt Creator (c++). The program compiles successfully and runs on an iPad with iOS. We want to add lsl to the program to send event markers.

We also tested the program on macOS with a m1 pro processor, everything compiles and works using cmake.

We could not find any compiled libraries for ios. And there is not even any instruction on how to do it.

Maybe someone knows how to do it and can help? Maybe you can use e.g. https://github.com/leetal/ios-cmake
Xcode project from root folder is not supported anymore((.

@cboulay
Copy link
Collaborator

cboulay commented Mar 10, 2023

Thanks for the link. I'll give it a look the next time I'm working on liblsl CMakeLists.txt file. However, due to the low demand and high maintenance costs, I doubt we'll add iOS to our CD builds.

It's been a while, but I've used liblsl on iOS before so I know it works. Even though we don't supply binaries, it shouldn't be too hard to build your own with the right CMake invocation... which might come from that link.

You also have the option grabbing liblsl directly into your own project using CMake's FetchContent to pull in the repo at config time and build it next to your target. If there's anything in our if (APPLE)... fragments that somehow pre-empt iOS then let us know and we'll try to clean those up.

This is untested, but it might look something like this:

include(FetchContent)
set(LSL_BUILD_STATIC ON)
FetchContent_Declare(LSL
            GIT_REPOSITORY https://github.com/sccn/liblsl.git
            FIND_PACKAGE_ARGS
    )
FetchContent_MakeAvailable(LSL)

# ... add your target ...

target_link_libraries(${target_name} PRIVATE LSL)

@florin-pop
Copy link

@VladimirR46 I managed to make it work with ios-cmake using the following diff applied to the tag v1.16.0 : a.diff.zip
If you want to try it, you will need to set:

XCODE_ATTRIBUTE_DEVELOPMENT_TEAM
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER

This will build a liblsl.dylib that can be used in an iOS app if you have the Multicast Networking entitlement.
However I was not able to upload the app using this dynamic library to AppStore because of the error:

ITMS-90426: Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it.

The error message is misleading in what it suggest as a fix because I was using the current public version of Xcode.

My current solution is to manually compile all C++ source code into a .Framework which is very Apple friendly and can be used on both macOS and iOS.

Feel free to download it and try it yourself.

@shokarta
Copy link

shokarta commented Oct 30, 2024

@VladimirR46 having same ITMS-90426 issue, how did you fix yourself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants