Building JUCE with CMake

This is essentially a duplicate of this three year old post, but I’d like to bring up the question again.

I work with Sublime Text and CMake, and I would like to use JUCE for one of my projects. Unfortunately, it demands that either XCode or Visual Studio is used, which are extremely bloated pieces of software IMO, neither of which work on Linux. Since CMake can generate XCode and Visual Studio project files, as well as Unix Makefiles and many others, why aren’t CMakeLists.txt scripts included by default?

Regardless, does anyone have a working CMake solution for building JUCE and JUCE projects, or advice for writing my own? I’ve been trying to write some CMake scripts for hours with no luck.

afaik this shouldn’t be too hard, as long as you have experience with CMake.

I’ve built juce apps using premake and qmake in the past, just needed to get the include paths and source files correct.

If you have working premake or qmake files, I’d be grateful to use those as a starting point. Have you posted these in the forums at some point? I’m not so unsure of how to write CMake scripts as I am with JUCE’s build requirements, so if I can make it work I’ll post them here for others.

How different is building JUCE vs. building a project with a JUCE dependency? Would it be better to build JUCE along with the project by just including the .cpp files or by statically linking the compiled JUCE library? However, my largest uncertainty (which would be answered by example build systems) is what .vst and .component files actually are. I assume the .vst file is a compiled dynamic loader module, but is an Audio Unit essentially a Mac OS X bundle with a dynamic loader module inside and an Info.plists locating it?

Sorry for the many questions!