Hello!

I've looked through the sources in your repo. I don't have CMake 3.12 right now, so I could not build it (Object library target "module1" may not link to anything). But that's not important.

I don't quite understand why are you using object libraries all over the project. If those modules are not intended to be used outside of the final shader library, then why not to make them static libraries? (Sorry me, please, for just asking without trying)

Also, I have an important note about the structure of the project: It may be better to have all the dependencies defined before they are used, i.e. you should not be able to use the target_link_libraries() with an undefined target as a linked library.

Unfortunately, I don't have any example for you. The closest to what you describe could be <strike>a horrible abomination</strike> the project that optionally fetches dependencies from the remote repo and adds them as subdirectories to build and link to them (just like in <a href="https://github.com/Crascit/DownloadProject" target="_top" rel="nofollow" link="external">this example project</a>, but uglier). This seems rather close to what you want to me because dependency of the main project is built into a separate library that is linked to the final artefact.

Best regards,
Innokentiy Alaytsev 








        
        
        
<br/><hr align="left" width="300" />
Sent from the <a href="http://cmake.3232098.n2.nabble.com/">CMake mailing list archive</a> at Nabble.com.<br/>