cmake and build: fixes for cross-compiling to enable ControlPort with ICE.