cmake-basis / legacy

Legacy CMake BASIS project for versions 3.2 and older. For newer versions, go to
https://github.com/cmake-basis/BASIS
Other
13 stars 11 forks source link

cmake namespace support #497

Closed ahundt closed 8 years ago

ahundt commented 8 years ago

It seems cmake has added namespaces, there are a couple possible ways cmake-basis could utilize them. One idea is perhaps uids should eventually be ported to use namespaces instead, particularly when there are submodules?

schuhschuh commented 8 years ago

Can you link to some documentation of the respective CMake feature? Because I cannot see any feature that is capable of supplying what the BASIS target UIDs were introduced for.

ahundt commented 8 years ago

https://cmake.org/cmake/help/v3.3/policy/CMP0037.html?highlight=colon

https://cmake.org/cmake/help/v3.3/manual/cmake-packages.7.html?highlight=colon

perhaps it only applies to exported targets? then it may not really be what we want.

schuhschuh commented 8 years ago

Yes, I thought you were referring to the NAMESPACE argument of the export function. This is not a replacement for the BASIS target UIDs. Note also that BASIS already exports each (sub-)project's targets with their respective NAMESPACE prefix.

Unlike CMake which now wants to establish double colons (::) as namespace separator, BASIS uses a single dot . and therefore disallows dots in target names. Note that CMP0037 would disallow BASIS to use a double colon for non-imported targets for the target UIDs. Hence, it's probably good we didn't choose the C++ style namespace separator.

The target UIDs feature of BASIS is quite more sophisticated than what CMake offers out of the box.

ahundt commented 8 years ago

ok, didn't know as much about it so I thought the idea was worth consideration. Seems it won't fit, thanks!