HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
Kitware
CMake
C2015–2023
Kitware / CMake

CMake

Mirror of CMake upstream repository

10Distinct people
12Mentions
0Explicit recommenders
8.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Mirror of CMake upstream repository

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 2:04:58 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year12 dated mentions

Observed mentions: 2015-12-17 17:34:18 UTC to 2023-01-02 06:08:22 UTC.

012342015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC202
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC404
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC202
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101

What Hacker News says

12 sources
Yes. Again, Google can do whatever it likes with its repositories. This is entirely unrelated to whether or not the software is proprietary. Compare Google's practices here to Qt's[1], CMake's[2], or any other large open source project that is primarily maintained by a single company. To be abundantly clear: I don't think this is a good way to run an open source project, but it is a legitimate way to run one. So long as the source code and standards (insofar as they exist) are themselves permissive, then the community details are just that. [1]: https://wiki.qt.io/Qt_Contribution_Guidelines [2]: https://github.com/Kitware/CMake/blob/master/CONTRIBUTING.rs...
In Ask HN: Learn C in 2023?
CMake is pretty simple internally. Every "keyword" is a function call. Every function call is implemented as a class. The simplest way to hijack it would be to have a function that calls out to your external interpreter/tool with the state you want. I could see doing that in a couple of ways: * Add a builtin command [1] that takes a string or filename and calls the interpreter with any additional data you want to pass. * Add a flow control command [1] that passes the inline block to the interpreter of your choice. You'd probably have to override cmFunctionBlocker as well for this. Note that this can't fix the deep design issues in CMake like the insane string representation. And no, I'm definitely not in therapy from CMake-induced PTSD. [1] https://github.com/Kitware/CMake/blob/master/Source/cmComman...
In Little languages are the future of programming
> Oh, you have proof that person X murdered someone? I am sure I can find awful stuff that person Y and Z did! No - that's not what I'm saying at all. I'm saying that if you're holding X to a standard, you should hold Y and Z to the same standard. > No, my users however might need to once they have to deal with a cmake project. cmake is available from the package manager on basically every system imaginable, or as a binary (or source) download for a whole host of platforms. It's also widely used, so chances are a user is going to have it installed. > I was told that it takes hours, though I might be misremembering. If you're going to dogmatically claim that cmake is inferior, then you should at least verify the grounds of your claims are true. I ran git clone https://github.com/Kitware/CMake.git && cd cmake && cmake -H. -Bbuild && cma
Read the rest
ke --build build in under 90 seconds. Might have even been faster if I used ninja. I actually don't konw how to compile make from source on windows. I had a look, and apparently I need to ftp the source from a gnu mirror? > This kind of thing does not really distract you from anything. Adding something like that takes as long as it does to add a cmake check. Then the person who is compiling has to do -DENABLE_FEATURE=1. This isn't unique to cmake but a meta build system does more than just let you add defines.
In CMake Part 1 – The Dark Arts
If you want to be in that distro repo, yeah. If you're just building on CentOS 7, download newer binaries (https://github.com/Kitware/CMake/releases) and use them instead. I do this all the time for our CentOS 7 deployments (and we use gcc 8 or 9; I forget when we last uplifted the devtoolset). FWIW, `cmake3` is packaged in CentOS 7 (though it might be EPEL?). All that said, given CMake's backwards compatibility guarantees, it is a bit silly that distributions don't update CMake more aggressively.
In Using CMake and Managing Dependencies
> achieved the status of de-facto standard due to its design and simplicity CMake is miserable to work with, but has excellent cross-platform support, able to target many build systems and IDEs. It also has a wealth of package-detection libraries. It was first-to-market with this combination of virtues, and it's difficult for competing systems to beat CMake on those terms. These are much of the reason I continue to use CMake, the other main reason being that fragmentation is harmful in itself. > Queue in the popular saying about how bad workers always blame their tools. If a worker does awful things, that's a reflection of how bad the worker is, not the tools. You seem to be suggesting there can be no such thing as a poor tool. When someone expresses dissatisfaction with a tool, and lays out numerous specific complaints born of their expe
Read the rest
rience, that does not entitle you to imply they must just be incompetent, which is what you've done. You might refrain from borderline personal insults in future. You've not substantiated the If a worker does awful things premise. I've written several well-functioning CMake scripts, always following the current best practices. My point isn't that it's impossible to do this, but that it's painful to achieve. > complaining about cmake because of its rudimentary BASIC-like scripting language is a huge red flag Writing scripts is the only way you can use CMake. > If your idea of using cmake is to write scripts, you're either aiming to do something extremely exotic and exceptional, like adding macros that magically support frameworks like Qt or conan, or I dare say you do not know what you are doing. Again, CMake is always script-driven. Anyway, this response is misguided. The CMake scripting language is not intended only for small and simple scripts. I already addressed this point last time. [0] CMake package-detection scripts are enormous, and fail to follow any kind of standard pattern. Just look at this official first-party CMake script and tell me this is how it ought to look. [1] It's a trainwreck. > you only need to call about half a dozen cmake functions to declare build targets and define it's properties, and you've already met over 95% of any project needs. If you make the tiniest error anywhere along the line, you will get mysterious failures rather than helpful error messages. You might even get failures which only affect certain platforms. I've encountered this several times, as CMake fails to properly abstract away all the differences between the Windows and Unix build+link models, especially regarding shared libraries. Once you've got your script working, it will look as if CMake properly abstracts away these differences, but the existence of such failure modes belies the illusion. A good metabuild system would aspire to make invalid states unrepresentable, or would at least help defend against common mistakes. CMake doesn't even try. It's fragile footguns all the way down. A recent example of a failure mode that simply wouldn't happen in a better system (I mentioned another previously at [2]): I'm seeing CTest passing the string WORKING_DIRECTORY to my test script, as a command-line argument. Presumably it's incorrectly handling the WORKING_DIRECTORY marker in the argument list of add_test. Am I doing something wrong? Perhaps, but not that I can tell. Presumably this failure mode is only possible because of CMake's awful approach to parameter-handling, and would not have occurred in a well-designed system. > If instead you're in the business of mangling makefiles with BASIC you should really take a step back and reconsider what you're trying to do because odds are you're doing it very wrong. You're blindly assuming I'm misusing CMake. When I write CMake scripts, I always try to follow the current best-practices. Again, I do not appreciate you assuming that I have no idea what I'm doing simply because I disagree with you. [0] https://news.ycombinator.com/item?id=24567450 [1] https://github.com/Kitware/CMake/blob/master/Modules/FindIma... [2] https://news.ycombinator.com/item?id=24203172
In Exodus: Easily migrate your JVM code from Maven to Bazel
> Sure, locally installing a new version of cmake or some other build system is not too hard, but it's certainly additional friction. for cmake it's basically wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-x86_… tar xaf cmake-3.20.0-linux-x86_64.tar.gz export PATH=$PWD/cmake-3.20.0/bin:$PATH definitely simpler than installing cygwin, msys or wsl :-) (and some software requires cl.exe on windows anyways)
In GNU Autotools: A Tutorial [pdf]
Another example: FindBLAS. [0] There are various different compatible BLAS libraries, and the elaborate CMake script accommodates this. To return to a point I made earlier, part of the value of having a configure step before the build step, is to handle all the platform-specific stuff early, failing early and with good error-messages if something is missing. I've seen builds fail several minutes in, it's very annoying, and the configure step should make all the checks necessary to prevent this happening. If the configure step succeeds, I should be able to rely on make succeeding. You make a good case that this step should really be very simple, and I agree, especially considering pkg-config exists, [1] but here we are. (True to form, CMake is able to leverage pkg-config, but makes it painful and confusing. [2] You have to be a master of C
Read the rest
Make to figure it out, and the correct answer depends on the CMake version, despite that both pkg-config and CMake were first released in the year 2000.) Also, optional dependencies can be handled properly. I don't see how you could easily handle this with pure Make. [0] https://github.com/Kitware/CMake/blob/master/Modules/FindBLA... [1] https://en.wikipedia.org/wiki/Pkg-config [2] https://stackoverflow.com/q/29191855/
In Allowing CMake functions to return(value)
> I do not understand the concept of "package detection". The detection of software packages depended on by my code. Typically this means libraries, and perhaps also executables, either executables needed for the build process (such as code-generators) or executables that will be needed at runtime. If my code uses a Boost library, the Autotools configure script (or CMake) can check that Boost is installed on the machine, check that it has an acceptable version number, and configure the build to look in the right place to find Boost's header files. If Boost is not installed, the configure script (or CMake) will fail with an error. It will do this quickly, not part-way through a build, which is poor form and can be annoying for the user. Configure scripts can also handle optional dependencies. They can also detect platform-specific attribut
Read the rest
es and produce a header file of the values, helping the developer cope with the platform's quirks. (It might check for the availability of a compiler intrinsic, or something of that sort.) > In that case, either your dependency is correctly installed into your system (and then, by definition, it is automatically found by the compiler and the linker), or it is not. There is no canonical installation path for a Unix package. You're right that the linker can be expected to, well, handle the linking, but that's not the whole story. Different distros (and different Unix-like OSs) install things (such as header files) in different places. Even within a distro, installing a package from source (rather than through the package-manager) may result in it being placed in a different directory. On Ubuntu the convention is that /usr/include holds headers installed through the package-manager, and /usr/local/include holds headers for libraries installed from source. Of course, Windows isn't a Unix-like, and things have to be handled differently there. The configure script should figure out that stuff automatically, the user shouldn't be given a pile of errors to manually fix. They shouldn't have to make any source-code changes just to get things to build. Robustly portable scripts to find packages, can be surprisingly involved. [0] This is why CMake encourages us to write self-contained Find... scripts that be reused by other codebases. > Both of these things can be perfectly done with plain makefiles Doing so manually with raw Makefiles, isn't scalable. This is why systems like Autotools exist. The configure script handles this sort of machine-specific detail. Large programs may have dozens of dependencies. It may be a sizeable task for the user to fix them all. > The alternative is to have your build system to search around your disk for possible versions of the required dependency. This is a completely untoward behavior and in very bad taste. C and C++ are not like Java. There isn't a single idealised system that you can target. You are exposed to platform-specifics, and it's on you to cope with them. This is true both at the source level (good code doesn't rely on sizeof(long) giving any particular value), and at the build level. [0] https://github.com/Kitware/CMake/blob/master/Modules/FindIma...
In Allowing CMake functions to return(value)
I use strace(1) look for stat(2) syscalls that fail with ENOENT. An advantage of this approach is that I do not have to imitate the C preprocessor, so parser differentials can never happen. The following default.o.do file from my blog post [1] handles the case: #!/bin/sh redo-ifchange $2.c strace -e stat,stat64,fstat,fstat64,lstat,lstat64 -f 2>&1 >/dev/null\ gcc $2.c -o $3 -MD -MF $2.deps\ |grep '1 ENOENT'\ |grep '\.h'\ |cut -d'"' -f2 2>/dev/null\ >$2.deps_ne read d <$2.deps redo-ifchange ${d#*:} while read -r d_ne; do redo-ifcreate $d_ne done <$2.deps_ne chmod a+x $3 This approach is also used for building Liberation Circuit if strace is installed [2]. I think the compiler should output the necessary information. To quote Jonathan de Boyne Pollard [3]: > As noted earlier, no C or C++ compiler
Read the rest
currently generates any redo-ifcreate dependency information, only the redo-ifchange dependency information. This is a deficiency of the compilers rather than a deficiency of redo, though. That the introduction of a new higher-precedence header earlier on the include path will affect recompilation is a fact that almost all C/C++ build systems fail to account for. > I have written, but not yet released, a C++ tool that is capable of generating both redo-ifchange information for included files and redo-ifcreate information for the places where included files were searched for but didn't exist, and thus where adding new (different) included files would change the output. JdeBP, could you please release your tool under a free software license? I suspect it has fewer errors than the similar CMake approach [4]. [1] http://news.dieweltistgarnichtso.net/posts/redo-gcc-automati... [2] https://github.com/linleyh/liberation-circuit/blob/master/sr... [3] http://jdebp.eu./FGA/introduction-to-redo.html#CompilerDefic... [4] https://github.com/Kitware/CMake/blob/master/Source/cmDepend...
In A Tutorial on Portable Makefiles
> I'm not sure what you mean by databases of systems and features... I didn't really mean a literal database. I meant stuff like this: https://github.com/Kitware/CMake/blob/master/Modules/FindQt4... This is pretty typical CMake. It's encoding that for a particular version of Qt, add a few more compilation flags. It's a "knowledge base" of Qt versions encoded as a CMake module. The autoconf way would be to try to link a minimal program to Qt, and if it fails, try to see if adding more libraries makes the linking succeed. Or this, for example: https://github.com/Kitware/CMake/blob/master/Modules/FindOpe... It is trying to account for two popular compilers on Windows but not with Cygwin. It's the whole chain of "if Windows, if cygwin, if mingw, if msvc" what I called a "database" above. Doesn't clang work on Windows these days? What will thi
Read the rest
s knowledge base do now? Shouldn't clang work almost like mingw? But because it misses the "if mingw" branch, code that probably would have worked for clang will be skipped over.
In Autotools Mythbuster

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.