Looks like this line, inherited from the previous definition, was giving some trouble:
> (string-append "-DCMAKE_INSTALL_LIBDIR=\\"" (assoc-ref %outputs > "out") "/lib\\"") It was creating wrong variables (and wrong syntax too!): if(EXISTS "$ENV{DESTDIR}/tmp/guix-build-freecad-mine-0.18.5.drv-0/build/"/gnu/store/30rcpcdv7h6ak37wf30ijlbf9x2j6jyz-freecad-mine-0.18.5/lib"/libSMDS.so" AND NOT IS_SYMLINK "$ENV{DESTDIR}/tmp/guix-build-freecad-mine-0.18.5.drv-0/build/"/gnu/store/30rcpcdv7h6ak37wf30ijlbf9x2j6jyz-freecad-mine-0.18.5/lib"/libSMDS.so") I think I'll manage to solve this myself.