Fix the policy warning CMP0026 in CMake 3.0.

get_target_property LOCATION is not supposed to be used anymore.

configure_file() cannot be used with generator expressions, and
file(GENERATE) cannot do normal variable substitution so we have to
generate the paths.lua file in two steps.