[CMake] Fix generation of exported targets in build directory