[CMake] How to iterate over a set of directories containing projects?

Peter p.schregle at impuls-imaging.com
Mon Jul 13 13:05:00 EDT 2009


Am 13.07.2009 16:43, schrieb Tyler Roscoe:
> On Mon, Jul 13, 2009 at 10:56:54AM +0200, Peter wrote:
>    
>> I'm wondering if there would be a way to avoid authoring
>> these similar CMakeLists.txt files and instead somehow iterate over all
>> the projects in the CMakeLists.txt file which is one level higher in the
>> hierarchy?
>>      
>
> foreach (proj proj1 proj2 projN)
>      add_executable (${proj} ${proj}.cpp)
>      ...
> endforeach ()
>
> Like that?
>
> tyler
>
>    
Exactly, thanks a lot. Looks so easy when the solution is shown.Funny 
that I could not figure that ou myself.

Peter




More information about the CMake mailing list