-
Notifications
You must be signed in to change notification settings - Fork 74
Cleanup CMake redundancies and use FILE_SET for headers #236
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
base: dev
Are you sure you want to change the base?
Conversation
018f690
to
91f5b0c
Compare
Update: On headers, I was originally fighting against On the exported CMake config: By configuring For future liblsl debug development, we should really use the 'external tests'. I still have some Windows work to do before this is ready... |
5e4731a
to
283b81b
Compare
…ast we don't get a big red X.
…ion that installed non-flat header tree by transitive dependencies.
…ee artifacts and thus were masking installation issues
8d2a332
to
c1d3ebe
Compare
It's a shame but I'm going to have to abandon the FILE_SET approach for the headers because it is incompatible with Apple Frameworks. I'll do that in the new PR. |
This is an attempt to delete unneeded CMake code. Draft for now; I just want to trigger the CI runners.
Installing Headers
I struggled with this for a while. It should be the case that headers are installed automatically with
install(TARGETS ... INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
, as long as the headers end up in the interface property of the installed target. And the headers should be in this property of the lsl target when it links in lslobj. However, something wasn't quite working.An alternative would be to use the
PUBLIC_HEADER
property. This worked to propagate the headers, but for some reason this flattens all the headers into a single folder.Instead, I ended up going with a relatively new
FILE_SET
feature. This works well.LSLTargets.cmake
It looks like we provide a hard-coded LSLConfig.cmake which is simply a wrapper around LSLTargets.cmake -- AND it forces the includes of LSLCMake.cmake. I'm going to try and remove the LSLConfig.cmake and instead generate that file (LSLTargets -> LSLConfig) with the consequence that we won't be forcing people to load LSLCMake.cmake if they find_target(LSL). I think it's likely that I will add it back, but it needs to be updated or cleaned. e.g., there's a bunch of code in there to help make Apple app bundles but that's a lot less useful now that Apple has increased MacOS security, unless we add in code signing and notarization but that's far less portable.