-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Hi! I've stumbled upon an issue - I needed to define a macro in cmake library if it's using CGAL, see the snippet below.
find_package(CGAL CONFIG REQUIRED)
target_compile_definitions(CGAL::CGAL INTERFACE ENABLE_CGAL_SUPPORT)Which results in an error target_compile_definitions can not be used on an ALIAS target.
Since libraries typically export namespace::target, I was assuming this name would work for this. But investigating cgalconfig.cmake I've learned that it's actually an alias to CGAL target created in a global namespace.
Since I would like to support both official cgalconfig.cmake and also the configs coming from conan and conan is using CGAL::CGAL as the main target (see https://conan.io/center/recipes/cgal), then I need to use some kind of strategy to support both. Currently I'm thinking to create another CGAL::CGAL_INTERFACE target and link CGAL::CGAL to it, as a workaround.
Maybe it's worth considering deprecating CGAL exported target as some point?
As it's the best practice to export targets only to it's own namespace and then there's no need for aliases.