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 reusage of

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 executing the

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't exist, the call

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 call

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-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
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 with liba.cr and

Re: [CMake] static library from several subdirectories

2010-03-17 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

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-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 like this

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_LIB}

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 listing

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 source-variables into

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

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 variable? Then

Re: [CMake] static library from several subdirectories

2010-03-16 Thread Verweij, Arjen
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 several subdirectories Verweij, Arjen

[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

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. You can just