I don’t believe that there is any in-code way of detecting whether tracing is enabled. I think this is good since code can’t then change its behavior when being traced.
As for arguments on the command line being available, I think that is only done in script mode, but it probably excludes any flags that CMake itself consumed. Actually, it appears that -- is required to trigger it. It sets CMAKE_ARGV<N> variables for use in the script in this case.