-
Notifications
You must be signed in to change notification settings - Fork 12
Fix Interface Library Installation and Begin to Separate Target Concerns #170
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
Conversation
|
@ryanmrichard r2g. The tests also all pass on my system with CMake 4.1.1. It is the topic of another quick PR, but I think we should update the unit testing to include CMake 4.x. |
|
@ryanmrichard Do you agree with the patch version increment I tagged? My reasoning is that it doesn't change or add any functionality to the user API and just fixes our support for interface libraries. However, I think it does technically add new classes to the public API (if |
|
@zachcran I'm fine with either patch or minor. Even though there's a lot of code here, I think it's more along the lines of a bug fix vs. a new feature. Point being, I think patch is probably the more applicable. |
|
🚀 [bumpr] Bumped! |
Description
Interface libraries (of type
INTERFACE) do not generate an associated compiled library. However, CMaize will still generate the installed<package>Config.cmakefile as if a library was created. Additionally,INTERFACE_LINK_LIBRARIESwere not being properly set onINTERFACEtargets, which are required for a dependent target to properly compile.To resolve these issues, I first needed a method to determine what type of library (see add_library docs) was being installed. The library target type appears to be language agnostic as types like
SHARED,STATIC, andINTERFACEare applicable to multiple languages. Therefore, I began by partially decoupling the CMaize-specific library target functionality and language-specific library target functionality into separate target classes. In this way, general, CMake-level interface library-related concerns can be made independent of programming language of the target. This allows us to easily inject a "library type" attribute into all library targets by adding it to theCMaizeInterfaceLibraryclass. Additionally, it allows future language targets to be more easily added with default behaviors.The following image summarizes the change in the class hierarchy described above, with the current state described as well as the intended, fully decoupled class hierarchy that is beyond the scope of this PR for future reference:
The
CMakePackageManagerclass was then updated to fix the aforementioned issues for installed config files, which was fairly trivial after the work above.During the development and debugging process, I also attempted to improve CMaize messages output during the build process to be more useful and informative. Messages were primarily added at the
VERBOSEorDEBUGlevels so they did not run counter to the desire to reduce some output in #151.TODOs