tikzpicture shape label with curves

Like this:

enter image description here

For above picture you need add to picture code the following code line:

\draw[thick,yellow] (0,4) to [bend right] node[fill=white,text=black] {\SI{10}{cm}} (4,0);

Complete MWE:

\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{tikz}
\usepackage{siunitx} % <--- new package

\begin{document}
    \begin{tikzpicture}
\draw[thick] (0,0) rectangle (4,4);
%
\node [above] at (0,4) {$A$};
\node [below] at (0,0) {$B$};
\node [below] at (4,0) {$C$};
\node [above] at (4,4) {$D$};
\node [above] at (2,2.1) {$O$};
%
\draw[thick] (0,0) -- (4,4) 
             (0,4) -- (4,0);
\draw[thick,yellow] (0,4) to [bend right] node[fill=white,text=black] {\SI{10}{cm}} (4,0); % <---
\end{tikzpicture}
\end{document}

I'd name the coordinates and would refrain from overpainting existing lines by default.

\documentclass[tikz,border=3mm]{standalone}
\usepackage{siunitx} 
\begin{document}
\begin{tikzpicture}
\draw[thick] (0,0) coordinate[label=below:$B$](B) rectangle (4,4)
coordinate[label=above:$D$](D)
(B|-D)coordinate[label=above:$A$](A) (B-|D)coordinate[label=below:$C$](C);
%
\node [above] at (2,2.1) {$O$};
%
\draw[thick] (A) -- (C) (B) -- (D);
%
%\draw[thick,dashed](0,4) -- node[fill=white]{$10\text{ m}$}(4,0);
\path (A) to[bend right] node(10cm){\SI{10}{\centi\meter}}(C)
(A) edge[bend right=10] (10cm) (10cm) edge[bend right=10] (C);
\end{tikzpicture}
\end{document}

enter image description here

or

\documentclass[tikz,border=3mm]{standalone}
\usepackage{siunitx} 
\begin{document}
\begin{tikzpicture}
\draw[thick] (0,0) coordinate[label=below:$B$](B) rectangle (4,4)
coordinate[label=above:$D$](D)
(B|-D)coordinate[label=above:$A$](A) (B-|D)coordinate[label=below:$C$](C);
%
\node [above] at (2,2.1) {$O$};
%
\draw[thick] (A) -- (C) (B) -- (D);
%
%\draw[thick,dashed](0,4) -- node[fill=white]{$10\text{ m}$}(4,0);
\path (A) to[bend right] node[fill=white,fill opacity=0.6](10cm){\SI{10}{\centi\meter}}(C)
(A) edge[bend right=10] (10cm) (10cm) edge[bend right=10] (C);
\end{tikzpicture}
\end{document}

enter image description here