Boost logo

Boost :

Subject: Re: [boost] CMake - one more time
From: Robert Ramey (ramey_at_[hidden])
Date: 2016-04-23 13:08:32

> This is not necessary at all. Cmake provides the `BUILD_SHARED_LIBS` variable that can be set to do this same purpose:

Of course I saw this. This is a great example of the kind of thing that
drives me nuts. looking at the CMake documentation

a) Its not clear how the variable is supposed got get set in the first
place. Is one expected to include in the CMakeLists.txt file a
statement like
But wouldn't that constraint the build to shared or static library? What
if you want to choose?

b) What is the default? - oh it might depend upon whether "option()" is
used somewhere. Instead of providing an answer it just gives you
another question.

c) So it is not clear on its face whether the statement
add_library(target_name ....) builds a static or shared library. It
depends upon some other "global" variable. That is you cannot know
what a statement will do by looking at the statement. Worse yet,
the behavior of the statement may depend upon some higher level
CMakeLists.txt file that you might not even be aware of.

d) is BUILD_SHARED_LIBS a cached variable?

I could go on, but you get the idea. And this is just one single
variable. There are dozens with similar behavior and implications.
As far as I can tell, all other build systems suffer from the same
problems. And the documentation actually makes it worse because it
suggests that the system is simple to use when it's actually not. It
makes naive users feel like they're stupid - whether they are or not.

And this is made worse by the fact that there are lots of people who
have made simple build scripts for small projects with limited
requirements. This work the first time - now they think it IS easy and
they think there's nothing to it. It's depressing.

One cannot make a build script without deep trolling of the net to find
he cause of arbitrary surprises. You can't just read a build script and
know what it does.

Robert Ramey

Boost list run by bdawes at, gregod at, cpdaniel at, john at