Conversation
Add an opt-in LSL_BUILD_EXAMPLES option (default OFF) to build the examples alongside liblsl. Examples can also still be configured as a standalone project to test the installed CMake package. In standalone mode, the examples use find_package(LSL) and install their targets; when included in the liblsl build, they link directly to the existing LSL::lsl target. The option was added in 70cc090 and removed in 5758c64 because the examples relied on in-tree artifacts, which could mask installation issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Examples are a useful way for users to learn how to use liblsl. While working on PR #304, I also found that building them alongside liblsl is useful for checking early whether the generated
LSL::lsltarget provides all the dependency information required by its consumers.The examples were originally added in 70cc090 and removed in 5758c64. The removal addressed a real issue: the examples used
find_package(LSL)to find in-tree artifacts, which could mask problems with the installed CMake package.Currently, building the examples against an installed liblsl requires configuring and building liblsl, installing it, and then configuring and building the examples. With
LSL_BUILD_EXAMPLES=ON, users can build liblsl and its examples with a single configuration and build.Changes
LSL::lsltarget from the current build and do not callfind_package(LSL).find_package(LSL)to exercise the installed CMake package.Follow-up
Once PR #304 is merged, these three lines can be removed from
examples/CMakeLists.txt, since theLSL::lsltarget will already propagate theThreadsdependency: