Invoke sed in a BSD-sed-compatible way. Upstream has solved it in a different way, so this patch will not be needed in later versions of freecad. https://github.com/FreeCAD/FreeCAD/commit/c44ade6961c39009dee34f61491f27ccf8b81852 --- cMake/FindPySide2Tools.cmake.orig 2019-10-22 11:53:35.000000000 -0500 +++ cMake/FindPySide2Tools.cmake 2019-10-28 21:55:27.000000000 -0500 @@ -42,7 +42,7 @@ # we follow the tool command with in-place sed. ADD_CUSTOM_COMMAND(OUTPUT ${outfile} COMMAND "${PYSIDE2UICBINARY}" "${infile}" -o "${outfile}" - COMMAND sed -i "/^# /d" "${outfile}" + COMMAND sed -i .orig "/^# /d" "${outfile}" MAIN_DEPENDENCY "${infile}" ) endif() @@ -69,7 +69,7 @@ # we follow the tool command with in-place sed. ADD_CUSTOM_COMMAND(OUTPUT "${outfile}" COMMAND "${PYSIDE2RCCBINARY}" "${infile}" ${PY_ATTRIBUTE} -o "${outfile}" - COMMAND sed -i "/^# /d" "${outfile}" + COMMAND sed -i .orig "/^# /d" "${outfile}" MAIN_DEPENDENCY "${infile}" ) endif() --- cMake/FindPySideTools.cmake.orig 2019-10-22 11:53:35.000000000 -0500 +++ cMake/FindPySideTools.cmake 2019-10-28 21:55:21.000000000 -0500 @@ -42,7 +42,7 @@ # we follow the tool command with in-place sed. ADD_CUSTOM_COMMAND(OUTPUT ${outfile} COMMAND "${PYSIDEUIC4BINARY}" "${infile}" -o "${outfile}" - COMMAND sed -i "/^# /d" "${outfile}" + COMMAND sed -i .orig "/^# /d" "${outfile}" MAIN_DEPENDENCY "${infile}" ) endif(WIN32) @@ -74,7 +74,7 @@ # we follow the tool command with in-place sed. ADD_CUSTOM_COMMAND(OUTPUT "${outfile}" COMMAND "${PYSIDERCC4BINARY}" "${infile}" ${PY_ATTRIBUTE} -o "${outfile}" - COMMAND sed -i "/^# /d" "${outfile}" + COMMAND sed -i .orig "/^# /d" "${outfile}" MAIN_DEPENDENCY "${infile}" ) endif(WIN32)