cmake_policy(SET CMP0118 NEW) enable_language(CXX) add_library(foo OBJECT empty.cpp) add_executable(bar $) get_target_property(location bar LOCATION)