-
Notifications
You must be signed in to change notification settings - Fork 81
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
Support XIB compiling for non-Xcode projects #1499
Conversation
Glad someone is looking at this. Thanks! |
if(APPLE) | ||
plasma_executable(plClient CLIENT INSTALL_PDB SOURCES ${plClient_SOURCES} ${plClient_HEADERS} ${RESOURCES}) | ||
target_xib_resources(plClient SOURCES ${plClient_IBSOURCES}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you could process the XIBs in the plasma_executable
command, which would be more ideal in terms of limiting the platform-specific branches in consuming code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean adding another keyword like plasma_exectuable(plClient CLIENT INSTALL_PDB SOURCES ... IBSOURCES ...)
? Or trying to parse out .xib
files from the list of provided sources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking more of the latter.
FYI I took a stab at doing this as part of I'm wondering if I can somehow set the |
This should be ready for re-review now. It appears to work both with Xcode (in CI) and with make (locally), as far as the XIB files are concerned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. @dpogue and @colincornaby - what order would we like to see these merged? This first, then Metal or the other way around? Either way, someone is going to have to rebase, I think.
It looks like this avoids taking over for the Xcode generator. Has this been tested with the Xcode generator? If it's non disruptive to the Xcode generator, I'd feel better about having this merged in first. |
In the Xcode case, this lets Xcode handle the XIB files the way it normally would. CI shows the nibs being put in the Resources folder as expected. |
I'd be fine with this being merged first then. I feel like there might still be some review left on Metal and I think getting this merged in wouldn't be too painful. |
XIB (XML Interface Builder) files describe windows and user interface elements and their properties on macOS (and other Apple platforms), and are authored using Xcode's Interface Builder drag-and-drop tool. As part of compiling an app, those XIB files need to be compiled from XML to a proprietary NIB format and included in the .app bundle as resources.
Xcode projects will handle this automatically when there's an XIB file in the list of files to process, but if you generate Makefiles with CMake then these files don't get compiled properly, and the source XML files get bundled up as resources instead. This leads to errors when launching the application because it can't find the compiled interface definitions.
The Xcode compiler tools provide an
ibtool
command-line tool that can compile XIB files to NIB files, but we need to teach CMake to invoke it. That is what this PR accomplishes.Aside: We'll eventually have similar issues with Metal shaders, which also need their own compilation process involving special tools, but we can deal with that when we get there.