update cmake rules.

(Cherry picked from commit 967960eeb6744b64e24e3b9744463718ce7794bc)

Conflicts:
	src/CMakeLists.txt