Compiling static binaries when CMake is used
There is a file created by cmake called link.txt that is helpful for me, sort of like a conf-cc or conf-ld file when statically compiling programs from cr.yp.to. To find it, I use something like
find|grep -E CMakeFiles/.+\.dir/link.txt
In the simplest case, to compile the static binary, all I need to do is something like sed -i 's/ / -static/;s/\.so /\.a /g' /path/to/link.txt
sh /path/to/link.txt
AFAICT there is no mention of link.txt in the cmake documentation and nothing interesting about it comes up in web searches, hence this note.NB. This is a workaround for an impatient UNIX-like OS user that compiles software from projects that use cmake, not a software author that uses cmake in a project.
AFAICT from the cmake source code the link.txt file ("LinkScript") is only created for UNIX and MinGW.