Live data from Hacker News

An Introduction to Modern CMake

cliutils.gitlab.io

31–40 of 126 posts

Re: An Introduction to Modern CMake

#31

Please don't use cmake, the dependency chain it pulls in on a bare machine is massive.

I hate and am deeply suspicious of dependencies but I just did 'brew deps cmake' on my machine and it printed nothing.

Some CMakefiles have many and gratuitous dependencies but that's the fault of those authors.

Re: An Introduction to Modern CMake

#33
post #30

Earlier quoted context omitted.

What's wrong with dependencies?

Every dependency increases the fragility of your program. What if you update the dependency and it breaks your program? What if you have two programs dependent on the same library -- but different versions? This just scratches at the surface of the problem. Sometimes the risk is worth it: you need some complex functionality not worth writing yourself. In that case it's a good thing. But understand that it's a tradeof…

This is a very dangerous argument for anything but the most domain specific or simple logic. Every time I roll something non trivial rather than using the widely testing and "battle hardened" alternative that increases the fragility of my program.

There are times when it makes sense, but those are the special cases, and carry a cost which should be considered.

Re: An Introduction to Modern CMake

#34

Please don't use cmake, the dependency chain it pulls in on a bare machine is massive.

If dependencies are a problem, you could always use the pre-compiled version from cmake.org. It uses the bundled 3rd party libs.

I prefer software that uses mature 3rd party libs over NIH driven rewrites. Please also keep in mind that CMake is available for many platforms sone with fading user base like AIX, HPUX, or Solaris. Using a well tested event library like libuv helps to keep those supported.

Re: An Introduction to Modern CMake

#35
post #16

Earlier quoted context omitted.

What systems does modern CMake not support?

Android NDK supports CMake 3.6 only for example.

There are two different things: CMake support within the NDK (by Google) and NDK support in CMake. The later is usually easy to use and supports many NDK revisions.

See: https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7....

Re: An Introduction to Modern CMake

#36
post #4

The recommended compatibility boilerplate for new projects is tedious. There must be a way to include this knowledge in cmake itself rather than requiring every "properly" configured project to get this right: cmake_minimum_required(VERSION 3.1) if(${CMAKE_VERSION} VERSION_LESS 3.12) cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) else() cmake_policy(VERSION 3.12) endif() This is all before you ev…

[deleted]

Re: An Introduction to Modern CMake

#38
post #8
post #4

The recommended compatibility boilerplate for new projects is tedious. There must be a way to include this knowledge in cmake itself rather than requiring every "properly" configured project to get this right: cmake_minimum_required(VERSION 3.1) if(${CMAKE_VERSION} VERSION_LESS 3.12) cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) else() cmake_policy(VERSION 3.12) endif() This is all before you ev…

This syntax is also uber ugly. I can’t understand why C still hasn’t a proper build system that is either using convention over configuration (like Go or Rust) or something like cmake but with a proper syntax (maybe something in pyhon?)

There is a python one, waf, https://en.m.wikipedia.org/wiki/Waf It is awesome but not very popular. I wish it was more popular. As a python and C++ developer the build files and up so much clearer than anything else. I write and use cmake files every day and I don't like it at all.

Re: An Introduction to Modern CMake

#39
What I find a big shortcoming from CMake is that it does not have support for building for multiple architectures at once.

https://cmake.org/pipermail/cmake-developers/2014-September/...

Quote: "The fundamental problem with supporting multiple architectures is that pretty much all of CMake is designed to support one architecture at a time. Modules/*, CMakeCache.txt, etc. are all built around only finding, using, and building one artifact per library (OS X universal binaries work with multiple architectures because they are still only one file). I think even your "toolchain scope" approach would end up being used in practice to wrap the entire CMakeLists.txt file."

Re: An Introduction to Modern CMake

#40
I used CMake and I liked that it can produce NMake files, which can be used for building with Windows SDK (not bloated Visual Studio, SDK contains just headers and compiler) on Windows XP.

And generally it is much easier to use than manually write Makefiles or use Autotools with weird unintuitive syntax. As I remember, they use `dnl` keyword (download?) for comments!

Post reply on HN