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 Modules

2010-03-12 Thread Markus Raab
Hello! Michael Wild wrote: > IMHO it would be simpler and safer to have a function which collects all > the file names, adds them to a global property and then allows you to > compile a static library from that. E.g (completely untested): Yeah, you are right, this approach sounds much better. Bu

Re: [CMake] Static Modules

2010-03-12 Thread Markus Raab
Hello! Alexander Neundorf wrote: > I would not recommend creating the static libs, taking them apart again > and then putting other libs together again. > That will be kind of hacky. > Just listing all the source files doesn't make problems and is > straightforward. You are right, thank you very

Re: [CMake] Static Modules

2010-03-10 Thread Markus Raab
Hi! Ryan Pavlik wrote: > get_target_properties() with the property SOURCES > then for each value you get back there, do a > get_source_file_properties() for LOCATION > and add all such locations to a new list, then create a target with that > source list. Thank you for your answer. The method yo

Re: [CMake] Static Modules

2010-03-10 Thread Markus Raab
Hi, Thank you both for your help! Ryan Pavlik wrote: > A bit less work: if you're building all the modules in CMake too, you > could loop through them extracting their source lists then adding those to > a new target: probably could be generalizable to a custom command in a > cmake module. Yes,

Re: [CMake] Static Modules

2010-03-10 Thread Markus Raab
Alexander Neundorf wrote: > We don't have that anymore, we just compile all the files directly into > one library. But only in the dynamic way? > We didn't have any issues with this since then. > (it may be possible to hack something together with custom commands to > extract the object files f

[CMake] Static Modules

2010-03-09 Thread Markus Raab
Hi list! I am currently trying to migrate a autotools project to cmake. The project used modules intensively. It was possible to compile all these modules also statically and link them together to a single static library. Is this supported out of the box by cmake? How? This was realized by expor