Add all targets to CMake bug workaround function.