Re: [CMake] static library from several subdirectories

2010-03-25 Thread Verweij, Arjen
Hi Markus, >-Original Message- >From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf >Of Markus Raab >I have exactly the same problem, please share if you get a good >solution. Any luck yet? I think we got it nailed so far, but now it needs to refactoring and reusag

Re: [CMake] static library from several subdirectories

2010-03-22 Thread Verweij, Arjen
Hi, >-Original Message- >From: Michael Wild [mailto:them...@gmail.com] >Problem is the following: > >Dependencies between stuff in different directories only work for top- >level targets (add_library, add_executable and add_custom_target). So, >you would need to add a ADD_CUSTOM_TARGET c

Re: [CMake] static library from several subdirectories

2010-03-22 Thread Michael Wild
On 22. Mar, 2010, at 15:22 , Verweij, Arjen wrote: > Hi, > >> From: Michael Wild [mailto:them...@gmail.com] > You have to call ADD_SOURCES for all your sources BEFORE you do the ADD_LIBRARY call. >>> >>> I am already doing this, but since the files I was adding to the >> library didn

Re: [CMake] static library from several subdirectories

2010-03-22 Thread Verweij, Arjen
Hi, >From: Michael Wild [mailto:them...@gmail.com] >>> You have to call ADD_SOURCES for all your sources BEFORE you do the >>> ADD_LIBRARY call. >> >> I am already doing this, but since the files I was adding to the >library didn't exist, the call failed. I somehow expected cmake to start >execut

Re: [CMake] static library from several subdirectories

2010-03-19 Thread Michael Wild
On 19. Mar, 2010, at 16:27 , Verweij, Arjen wrote: > Hi, > > This is a bit length, sorry. > >> -Original Message- >> From: Michael Wild [mailto:them...@gmail.com] > > >>> What am I missing? I'm trying again with my simple a/liba.c and >> b/b/libb.c setup, but this time I start out wit

Re: [CMake] static library from several subdirectories

2010-03-19 Thread Verweij, Arjen
Hi, This is a bit length, sorry. >-Original Message- >From: Michael Wild [mailto:them...@gmail.com] >> What am I missing? I'm trying again with my simple a/liba.c and >b/b/libb.c setup, but this time I start out with liba.cr and libb.cr >that need to be converted to liba.c and libb.c. >

Re: [CMake] static library from several subdirectories

2010-03-19 Thread Michael Wild
Hi I added my comments below, inline in the code On 19. Mar, 2010, at 13:58 , Verweij, Arjen wrote: > Hi, > >> -Original Message- >> From: Michael Wild [mailto:them...@gmail.com] > > >> I'd recommend to change the add_sources function to do all the >> preprocessing and then only add

Re: [CMake] static library from several subdirectories

2010-03-19 Thread Verweij, Arjen
Hi, >-Original Message- >From: Michael Wild [mailto:them...@gmail.com] >I'd recommend to change the add_sources function to do all the >preprocessing and then only add the products (.f, .f90, .c etc.) files >to the list. You can do the preprocessing like this (of course, you'll >have to

Re: [CMake] static library from several subdirectories

2010-03-17 Thread Verweij, Arjen
Hi, >-Original Message- >From: Michael Wild [mailto:them...@gmail.com] >I think the problem is that the ${BIG_LIB} target does not exist when >you call ADD_DEPENDENCIES. Probably you should also collect all the >custom targets into a global property and then after the >ADD_LIBRARY(${BIG_

Re: [CMake] static library from several subdirectories

2010-03-17 Thread Michael Wild
On 17. Mar, 2010, at 13:01 , Verweij, Arjen wrote: > Hi, > >> From: Michael Wild [mailto:them...@gmail.com] > >> I'd recommend to change the add_sources function to do all the >> preprocessing and then only add the products (.f, .f90, .c etc.) files >> to the list. You can do the preprocessing

Re: [CMake] static library from several subdirectories

2010-03-17 Thread Verweij, Arjen
Hi, >From: Michael Wild [mailto:them...@gmail.com] >I'd recommend to change the add_sources function to do all the >preprocessing and then only add the products (.f, .f90, .c etc.) files >to the list. You can do the preprocessing like this (of course, you'll >have to change things for your setup,

Re: [CMake] static library from several subdirectories

2010-03-16 Thread Michael Wild
On 16. Mar, 2010, at 22:30 , Verweij, Arjen wrote: > Hi Markus, > > I have tested Michael's suggestion. It works wonders for combining source > files into a single lib, regardless of the directory levels. For instance, I > tested with: > > CMakeLists.txt > a/CMakeLists.txt > a/liba.c > b/CMak

Re: [CMake] static library from several subdirectories

2010-03-16 Thread Verweij, Arjen
If I manage to solve it I will report back here. Regards, Arjen >-Original Message- >From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf >Of Markus Raab >Sent: dinsdag 16 maart 2010 17:43 >To: cmake@cmake.org >Subject: Re: [CMake] static library from

Re: [CMake] static library from several subdirectories

2010-03-16 Thread Michael Wild
On 16. Mar, 2010, at 17:42 , Markus Raab wrote: > Verweij, Arjen wrote: > >> I'm looking for a cmake-way to create a static library from several >> subdirectories. > > I have exactly the same problem, please share if you get a good solution. > > What about collecting all files in a cache varia

Re: [CMake] static library from several subdirectories

2010-03-16 Thread Markus Raab
Verweij, Arjen wrote: > I'm looking for a cmake-way to create a static library from several > subdirectories. I have exactly the same problem, please share if you get a good solution. What about collecting all files in a cache variable? Then you could add files per directory, but with a global s

Re: [CMake] static library from several subdirectories

2010-03-16 Thread Michael Wild
On 16. Mar, 2010, at 9:54 , Verweij, Arjen wrote: > Hi, > >>> Hopefully I'm misunderstanding you, since otherwise the list would >> contain >>> close to 4000 files. >> >> Well, I don't see a real problem with this. If this makes your files too >> long, >> just separate the setting of these sour

Re: [CMake] static library from several subdirectories

2010-03-16 Thread Verweij, Arjen
Hi, >> Hopefully I'm misunderstanding you, since otherwise the list would >contain >> close to 4000 files. > >Well, I don't see a real problem with this. If this makes your files too >long, >just separate the setting of these source-variables into separate files. I would prefer to keep the source

Re: [CMake] static library from several subdirectories

2010-03-12 Thread Alexander Neundorf
On Friday 12 March 2010, Verweij, Arjen wrote: > Hi, > > >> For a legacy FORTRAN project, I'm looking for a cmake-way to create a > >> static library from several subdirectories. The current solution is > > > >using a > > > >> custom POST_BUILD step with ar and ranlib, but the resulting archive > >

Re: [CMake] static library from several subdirectories

2010-03-12 Thread Verweij, Arjen
Hi, >> For a legacy FORTRAN project, I'm looking for a cmake-way to create a >> static library from several subdirectories. The current solution is >using a >> custom POST_BUILD step with ar and ranlib, but the resulting archive >is not >> known to cmake and can't be used to link to the main. > >Y

Re: [CMake] static library from several subdirectories

2010-03-12 Thread Alexander Neundorf
On Friday 12 March 2010, Verweij, Arjen wrote: > Hi, > > For a legacy FORTRAN project, I'm looking for a cmake-way to create a > static library from several subdirectories. The current solution is using a > custom POST_BUILD step with ar and ranlib, but the resulting archive is not > known to cmake

Re: [CMake] static library from several subdirectories

2010-03-12 Thread Tyler Roscoe
On Fri, Mar 12, 2010 at 05:29:00PM +0100, Verweij, Arjen wrote: > For a legacy FORTRAN project, I'm looking for a cmake-way to create a > static library from several subdirectories. The current solution is > using a custom POST_BUILD step with ar and ranlib, but the resulting > archive is not known

[CMake] static library from several subdirectories

2010-03-12 Thread Verweij, Arjen
Hi, For a legacy FORTRAN project, I'm looking for a cmake-way to create a static library from several subdirectories. The current solution is using a custom POST_BUILD step with ar and ranlib, but the resulting archive is not known to cmake and can't be used to link to the main. As an alternat