6 points · by 1vuio0pswjnm7 · 2y ago · 1 comment
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.