Tuesday, June 07, 2011

How to accidentally kill your CI build time « Schneide Blog

How to accidentally kill your CI build time « Schneide Blog: "In order to have the build time available (e.g. to show in an “about” box), we use a preprocessor symbol like REVISION_DATE which gets filled in a CMakeLists.txt file. The whole thing looks like this:

1
...
2
EXEC_PROGRAM(date ARGS '+%F_%T' OUTPUT_VARIABLE REVISION_DATE)
3
...
4
ADD_DEFINITIONS(-DREVISION_DATE=\'${REVISION_DATE}\')
5
...
Since the beginning of the time these lines of CMake code lived in a small sub-sub-..-directory with little to no incomming dependencies. Then, at some point, it became necessary to have the REVISION_DATE symbol at some other place, too, which led to a move of the above code into the CMakeLists.txt file of the main package."