Set the following policies to "OLD" if cmake version is greater than
2.8.12:
CMP0026 - Disallow use of the LOCATION target property
CMP0045 - Error on non-existent target in get_target_property
(cherry picked from commit 10ee2f72d9b3acc58b7dff784d1f79cb52dcc4fa)