Re: [cmake-developers] Namespaces

2016-01-30 Thread Stephen Kelly
Pau Garcia i Quiles wrote: > But that does not work unless I juggle with add_library(... IMPORTED) or I > use Hunter or alike. I did something like that a few months ago: https://github.com/Ableton/aqt-cassowary/blob/master/src/CMakeLists.txt However, that's not a pattern which scales I

[cmake-developers] Namespaces

2016-01-28 Thread Pau Garcia i Quiles
Hello, I am adding several third-party projects as static libraries in my project. This is what I do: CMakeLists.txt | \-- 3rdparty | \ pugixml | \ QtZeroConf | \ QtDropBox | \ websocketpp In the root CMakeLists.txt, I have:

Re: [cmake-developers] Namespaces

2016-01-28 Thread Pau Garcia i Quiles
On Thu, Jan 28, 2016 at 7:17 PM, Stephen Kelly wrote: > > Has some kind of namespacing been considered for add_subdirectory? > > > > E. g. > > > > add_subdirectory(QtZeroConf NAMESPACE QTZEROCONF) > > And what if someone builds your project with -DBUILD_SHARED=ON? Are you >

Re: [cmake-developers] Namespaces

2016-01-28 Thread Stephen Kelly
Pau Garcia i Quiles wrote: > CMake should wrap every variable defined under the directory added with > add_subdirectory(QtZeroConf NAMESPACE QTZEROCONF) So, CMake needs to first determine what variables are used in the QtZeroConf directory (presumably without executing the cmake code there) and

Re: [cmake-developers] Namespaces

2016-01-28 Thread Ruslan Baratov via cmake-developers
On 29-Jan-16 01:17, Stephen Kelly wrote: Pau Garcia i Quiles wrote: add_subdirectory(pugixml/scripts) add_subdirectory(QtZeroConf) add_subdirectory(QtDropBox) add_subdirectory(websocketpp) This is an easy way to work with third-party dependences. Unfortunately this is 'easy, obvious and

Re: [cmake-developers] Namespaces

2016-01-28 Thread Pau Garcia i Quiles
On Thu, Jan 28, 2016 at 9:58 PM, Alan W. Irwin wrote: > Your experience is contrary to mine. For example, in my epa_build > project (where I build all the many prerequisites of PLplot) I build a lot > of > different libraries (such as Qt5 and the GTK+ stack of

Re: [cmake-developers] Namespaces

2016-01-28 Thread Pau Garcia i Quiles
On Thu, Jan 28, 2016 at 8:21 PM, Stephen Kelly wrote: Pau Garcia i Quiles wrote: > > > CMake should wrap every variable defined under the directory added with > > add_subdirectory(QtZeroConf NAMESPACE QTZEROCONF) > > So, CMake needs to first determine what variables are used

Re: [cmake-developers] Namespaces

2016-01-28 Thread Ben Boeckel
On Thu, Jan 28, 2016 at 21:07:13 +0100, Pau Garcia i Quiles wrote: > I think it's just a matter of adding an "internal note" saying "OK, I'm > going to namespace variables from now on" in cmAddSubdirectoryCommand when > add_subdirectory contains NAMESPACE, and then modifying the literal of the >

Re: [cmake-developers] Namespaces

2016-01-28 Thread Stephen Kelly
Pau Garcia i Quiles wrote: > On Thu, Jan 28, 2016 at 8:21 PM, Stephen Kelly > wrote: > > > Pau Garcia i Quiles wrote: >> >> > CMake should wrap every variable defined under the directory added with >> > add_subdirectory(QtZeroConf NAMESPACE QTZEROCONF) >> >> So, CMake needs

Re: [cmake-developers] Namespaces

2016-01-28 Thread Pau Garcia i Quiles
On Thu, Jan 28, 2016 at 9:19 PM, Ben Boeckel wrote: > I think the solution to your problem is to use INTERNAL cache variables > (for cache variables created by the third party project) or local > variables to override the cache variables in scope (which would likely >

Re: [cmake-developers] Namespaces

2016-01-28 Thread Alan W. Irwin
On 2016-01-28 19:58+0100 Pau Garcia i Quiles wrote: Unfortunately ExternalProject does not work well with find_package, e. g. this fill fail: CMakeLists.txt | \--- 3rdparty/CMakeLists.txt \--- server/CMakeLists.txt Where: 3rdparty/CMakeLists.txt contains ExternalProject_Add(QtZeroConf ...)

Re: [cmake-developers] Namespaces

2016-01-28 Thread Alan W. Irwin
On 2016-01-28 23:25+0100 Pau Garcia i Quiles wrote: On Thu, Jan 28, 2016 at 9:58 PM, Alan W. Irwin wrote: Your experience is contrary to mine. For example, in my epa_build project (where I build all the many prerequisites of PLplot) I build a lot of different

Re: [cmake-developers] Namespaces

2016-01-28 Thread Alan W. Irwin
On 2016-01-28 18:47+0100 Pau Garcia i Quiles wrote: [...] In the root CMakeLists.txt, I have: add_subdirectory(3rdparty) And in 3rdparty/CMakeLists.txt: add_subdirectory(pugixml/scripts) add_subdirectory(QtZeroConf) add_subdirectory(QtDropBox) add_subdirectory(websocketpp) This is an easy

Re: [cmake-developers] Namespaces

2016-01-28 Thread Stephen Kelly
Pau Garcia i Quiles wrote: > add_subdirectory(pugixml/scripts) > add_subdirectory(QtZeroConf) > add_subdirectory(QtDropBox) > add_subdirectory(websocketpp) > > This is an easy way to work with third-party dependences. Unfortunately this is 'easy, obvious and wrong'. > My problem comes from the