Is there an open source project which uses CMake well and could be used as a reference for good CMake practices?
I've been using CMake for years and it's definitely not the worst solution for building multiplatform C++ projects. But I've never read a CMake script and thought what a clean solution, it's always a bit gnarly.
I don't know about "could be used as a reference for good practices", but here's a CMake file for a game project I've worked on if you're interested looking at how someone might use CMake for a smaller codebase (everything large I've used it for has been a work for hire unfortunately). It compiles on Linux with GCC, Mac OS X with Apple Clang, and Windows with MSVC, and supports multiple platform backends (currently SDL2 and SDL3). I've done development work on it with CLion, Xcode, and Visual Studio.
> But I've never read a CMake script and thought what a clean solution, it's always a bit gnarly.
I think using CMake for a cross-platform project that supports multiple compilers will always be a bit gnarly, mainly due to the differences between Windows and Unix-like platforms. MSVC is configured very differently to GCC and Clang so you have to list all your compiler flags twice, and there's no good option for doing system-wide installation of libraries (there's vcpkg, but a lot of stuff on there is missing or outdated) so you have to support both system-wide libraries on Unix-like platforms and user-provided DLLs on Windows.
We are trying to use CMake in a very limited fashion.
For example, any build time environment checks are forbidden (no "try_compile" scripts), and all configuration for all platforms is fixed.
We don't use it for installation and packaging; it is only used for builds. The builds have to be self-contained.
We also forbid using CMake files from third-party libraries. For every library, a new, clean CMake file is written, which contains the list of source files and nothing else.
From this standpoint, there should be no big difference between CMake, Bazel, Buck, GYP, GN, etc.
Spotlight straight up broke on both of my Macs after Sequoia. It can't even find exact matches in many directories marked for indexing and re-indexing did nothing. Just searching for apps under Applications doesn't seem to find all apps.
I’ve had so many issues with it as well! To the absurd level where I could not search for settings in the Settings app… People all over the net have had all kinds of issues and there’s never been any help other than „oh go and reindex”.
iOS has this problem as well. You search for a setting in the Settings app. It’ll say “doesn’t exist” (or whatever) while it’s looking for something extremely obvious (like “software update”) instead of just showing a processing icon.
Then when it does show the results, they’re usually in some terribly unhelpful order. It took me ages to try and go through the CUJ of “this app isn’t sending me notifications because I turned them off now I want them back on”
Just yesterday I was trying to find a file in Finder, using the search, and it could not find it even though I was just one directory up from the directory it was sitting in. It made no sense to me at all. Reading these stories, it’s clicking for me.
I gave up on it because of this and installed Raycast which seems a lot more reliable. I used Spotlight effectively as my launcher for apps/settings, and have the Dock completely hidden and Spotlight set to hide everything else. But when it can't even do that consistently, I have no idea how!
Spotlight has been broken on both of my Macs since Sequoia. It doesn't find anything under Downloads dir even though it should be indexed. Or any non-Apple apps under Applications. Re-indexing did nothing.
Performance is really abysmal with C++ development and it's the biggest reason for avoiding Xcode for me. Actions such as completion and contextual jumping just keeps lagging on a M3 Pro even if everything should be indexed. VS Code with the usual C++ plugin and CLion have no problems with the same codebase.
I like the integration with different sanitizers in Xcode, some of the visualizations are pretty neat. Instruments is quite good as well.
Some content mills seem to display a date but automatically update it periodically. Sometimes you can outright see it can't be correct since the information is woefully out of date or you can check from Internet Archive that the content is the same as before but with a bumped date.
I've been using CMake for years and it's definitely not the worst solution for building multiplatform C++ projects. But I've never read a CMake script and thought what a clean solution, it's always a bit gnarly.
reply