CMakeLists.txt: Fix prblem when using flag DISABLE_LIBRARIES_GENERATION

Change-Id: I38c73fce9b480df0c11f87b28b15f0da12ae3bd8