Salome GUI doesn't build on FreeBSD

Configure fails to find SIP:
CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find SIP (missing: SIP_INCLUDE_DIR SIP_EXECUTABLE SIP_PYTHONPATH)

I have py39-sip-6.7.12 installed. py39-sip-6.7.12 installs multiple executables:
/usr/local/bin/sip-build
/usr/local/bin/sip-distinfo
/usr/local/bin/sip-install
/usr/local/bin/sip-module
/usr/local/bin/sip-sdist
/usr/local/bin/sip-wheel

There is also the older py39-sip4-4.19.25 package available which does install one executable /usr/local/bin/sip.
Unfortunately, this sip executable fails to parse /usr/local/lib/python3.9/site-packages/PyQt5/bindings/QtCore/QtCoremod.sip:
sip: /usr/local/lib/python3.9/site-packages/PyQt5/bindings/QtCore/QtCoremod.sip:23: syntax error

QtCoremod.sip is installed by py39-qt5-pyqt-5.15.10.

What versions of packages does Salome require?
Why doesn’t cmake script complain about versions if they aren’t appropriate for Salome?

How can Salome GUI be built?

This needs addressing
I get the following error.

CMake Error:
  Running

   '/usr/bin/ninja' '-C' '/home/SALOME/Modules/GUI/Build' '-t' 'recompact'

  failed with:

   ninja: error: build.ninja:15099: bad $-escape (literal $ must be written as $$)

@NabilG sorry for pinging you but can you show us your sip6 configuration for the salome gui in cmake? I have use sip-install as the binary. Many thanks

I did not have time to look into this issue yet.

No worries. It would be nice if you could have a look.
Thanks for your help
Cheers

@NabilG This seems to be related to ninja. Does not occur with make. My sip executable is sip-build and include is as indicated in the sip6 shell script that is supplied. I have the following error now.

c++: error: unrecognized command-line option ‘-Wshorten-64-to-32’
Built target QT_INSTALL_TS_RESOURCES_STD_msg_ja
make[2]: *** [src/DDS/CMakeFiles/DDS.dir/build.make:90: src/DDS/CMakeFiles/DDS.dir/DDS_DicItem.cxx.o] Error 1

Any clues? ** this is resolved by using clang++ isntead of gcc
Now this error occurs with sip6.8.6

sip-build: error: unrecognized arguments: -s .cc -c . -n PyQt5.sip

I disabled the python console and now there are compilation issues to the equally disabled paraview headers.
I think these sip based builds are not optimal…

SALOME/Modules/GUI/gui/src/LightApp/LightApp_Application.cxx:2102:19: error: unknown type name 'PV3DViewer_ViewManager'; did you mean 'PyViewer_ViewManager'?
    viewMgr = new PV3DViewer_ViewManager( activeStudy(), desktop() );
                  ^~~~~~~~~~~~~~~~~~~~~~
                  PyViewer_ViewManager

I also get this error when i disable paraview and vtk in order to progress. This is as far as I have got.