[doc] fix CMakeLists.txt for the handbook
This is deliberately against 3.2. For the master, the whole else branch can be deleted. This will be done in another MR.
This is deliberately against 3.2. For the master, the whole else branch can be deleted. This will be done in another MR.