Fix CMake build
This fixes issues caused by:
Corresponding upstream commits:
- 2f1e70744dfd87d41425bd8c685cc846a306a54f
- 234d6367f9080bc65708049de42a58514bb723ed
- 54c91a630b634b87c0b6eff24c99d3ec7cae6460
- 2c988f4009b7eb5ef8c162b2a3b1841a1001f7fe
- 31918449e6ca18a669030886533d6ca548f3bf5f
- 9fd521fcd85eb1053388ce455c42edbc5e836e0f
Change-Id: Id8fe9307f71262260d51aac81151d8ca66ca9e93
Edited by Islam Ragimov