nos_get_package() cmake function creates target named with version argument passed. This causes duplicated targets with different names such as _nos_gen_plugin_40 and _nos_gen_plugin_40_0 . To fix this, we need to cache already requested targets' versions and check compatibility with the requested one.