[CMake] Troubles with add_subdirectory

Tyler Roscoe tyler at cryptio.net
Tue Jul 7 10:43:08 EDT 2009


On Tue, Jul 07, 2009 at 10:33:59AM +0200, Pierre-Julien Villoud wrote:
> cmake_minimum_required(VERSION 2.6)
> 
> add_subdirectory(Project1)
> add_subdirectory(Project2)
> add_subdirectory(Project3)
> 
> Project1\CMakeFiles\ Project1.dir\build.make:43: CMakeFiles/ Project1.dir/depend.make: No such file or directory
> Project1\CMakeFiles\ Project1.dir\build.make:46: CMakeFiles/ Project1.dir/progress.make: No such file or directory
> Project1\CMakeFiles\ Project1.dir\build.make:49: CMakeFiles/ Project1.dir/flags.make: No such file or directory
> 
> Anyone see what's wrong ?

The space between CMakeFiles and ProjectN.dir looks anomalous (and is
present twice). Did you somehow include an extra space somewhere?

> Another thing that has nothing to do with this, When I choose the Visual Studio 8 generator, it outputs a project by target. Is there any way to exclude some targets so they don't have a project ?

Maybe the various EXCLUDE_FROM_ALL / EXCLUDE_FROM_DEFAULT_BUILD
properties?

You could also use appropriate if()s to manually exclude certain
projects/targets.

tyler


More information about the CMake mailing list