PackageProject.cmake icon indicating copy to clipboard operation
PackageProject.cmake copied to clipboard

Avoid Creating Alias Target If It Already Exists

Open threeal opened this issue 1 year ago • 0 comments

This issue addresses the lines of code that create an alias target for a specific namespace: https://github.com/TheLartians/PackageProject.cmake/blob/2d8a4685857c768da7ad1d8a7c6e07b1b5285cca/CMakeLists.txt#L33-L42

It is suggested to create the alias target only if the alias does not already exist; otherwise, it may cause issues as highlighted in https://github.com/boost-ext/ut/pull/564.

Before CMake 3.18, this may not have caused an issue because any new alias target would replace the old alias. However, the behavior has changed since then (see also).

threeal avatar Jun 20 '24 11:06 threeal