[CMake] Linking archives in a sibling directory

2010-11-30 Thread Raymond Wan
Hi all, I'm having a problem understanding how I can link to an archive in another directory which is not a subdirectory. For example: myproj +-- main +-- CMakeLists.txt +-- source files for main program +-- dir-A +-- CMakeLists.txt +-- source files for sub-program A +-- dir

Re: [CMake] Linking archives in a sibling directory

2010-12-01 Thread Michael Hertling
On 12/01/2010 08:18 AM, Raymond Wan wrote: > Hi all, > > I'm having a problem understanding how I can link to an archive in > another directory which is not a subdirectory. For example: > > myproj > +-- main > +-- CMakeLists.txt > +-- source files for main program > +-- dir-A > +-

Re: [CMake] Linking archives in a sibling directory

2010-12-01 Thread Raymond Wan
Hi Michael, On Thu, Dec 2, 2010 at 01:03, Michael Hertling wrote: > On 12/01/2010 08:18 AM, Raymond Wan wrote: >> Hi all, >> >> I'm having a problem understanding how I can link to an archive in >> another directory which is not a subdirectory. For example: >> >> myproj >>   +-- main >>     +--

Re: [CMake] Linking archives in a sibling directory

2010-12-02 Thread Michael Hertling
On 12/01/2010 06:03 PM, Raymond Wan wrote: > Hi Michael, > > > On Thu, Dec 2, 2010 at 01:03, Michael Hertling wrote: >> On 12/01/2010 08:18 AM, Raymond Wan wrote: >>> Hi all, >>> >>> I'm having a problem understanding how I can link to an archive in >>> another directory which is not a subdirect

Re: [CMake] Linking archives in a sibling directory

2010-12-02 Thread David Cole
On Thu, Dec 2, 2010 at 5:40 AM, Michael Hertling wrote: > On 12/01/2010 06:03 PM, Raymond Wan wrote: > > Hi Michael, > > > > > > On Thu, Dec 2, 2010 at 01:03, Michael Hertling > wrote: > >> On 12/01/2010 08:18 AM, Raymond Wan wrote: > >>> Hi all, > >>> > >>> I'm having a problem understanding how

Re: [CMake] Linking archives in a sibling directory

2010-12-02 Thread Raymond Wan
Hi Michael, On Thu, Dec 2, 2010 at 19:40, Michael Hertling wrote: > On 12/01/2010 06:03 PM, Raymond Wan wrote: >> Ah!  I see.  Then is it recommended that this top-level CMakeLists.txt >> have just these lines, or should I move the ADD_EXECUTABLE, etc. lines >> here as well?  Or is this really "

Re: [CMake] Linking archives in a sibling directory

2010-12-02 Thread Rolf Eike Beer
> Hi Michael, > > > On Thu, Dec 2, 2010 at 19:40, Michael Hertling > wrote: >> On 12/01/2010 06:03 PM, Raymond Wan wrote: >>> Ah! Â I see. Â Then is it recommended that this top-level >>> CMakeLists.txt >>> have just these lines, or should I move the ADD_EXECUTABLE, etc. lines >>> here as well? Â

Re: [CMake] Linking archives in a sibling directory

2010-12-02 Thread Raymond Wan
Hi Rolf, On Thu, Dec 2, 2010 at 23:36, Rolf Eike Beer wrote: > Let's say you have > > dirA, dirB, dirC > > dirA builds a lib > dirB builds a lib that needs libA > dirC builds a target that needs libA and libB > > Then you can't do > > > libB/CMakeLists.txt >  ADD_SUBDIRECTORY(../dirA dira) > > l

Re: [CMake] Linking archives in a sibling directory

2010-12-03 Thread Michael Hertling
On 12/02/2010 03:13 PM, Raymond Wan wrote: > Hi Michael, > > > On Thu, Dec 2, 2010 at 19:40, Michael Hertling wrote: >> On 12/01/2010 06:03 PM, Raymond Wan wrote: >>> Ah! I see. Then is it recommended that this top-level CMakeLists.txt >>> have just these lines, or should I move the ADD_EXECUT

Re: [CMake] Linking archives in a sibling directory

2010-12-03 Thread Raymond Wan
Hi Michael, Thank you for your continued advice! On Fri, Dec 3, 2010 at 19:13, Michael Hertling wrote: > On 12/02/2010 03:13 PM, Raymond Wan wrote: >> ADD_SUBDIRECTORY (dir-A) >> >> before >> >> ADD_SUBDIRECTORY (main) >> >> then "main" will be built correctly? > > Even this is not necessary if

Re: [CMake] Linking archives in a sibling directory

2010-12-08 Thread Michael Hertling
On 12/03/2010 04:26 PM, Raymond Wan wrote: > Hi Michael, > > Thank you for your continued advice! > > > On Fri, Dec 3, 2010 at 19:13, Michael Hertling wrote: >> Nevertheless, I wonder why you want to build "main" by configuring its >> own source directory and alternatively via the top-level dir

Re: [CMake] Linking archives in a sibling directory

2010-12-12 Thread Raymond Wan
Hi Michael, Thank you for the follow-up and sorry for my late response! I appreciate your suggestions as they basically summarize the problems I've been having... On Wed, Dec 8, 2010 at 21:25, Michael Hertling wrote: > Yes, absolutely, with such relations among executables and libraries, > the