[CMake] Tricky question once more

Denis Scherbakov denis_scherbakov at yahoo.com
Tue May 5 09:02:34 EDT 2009


I have checked cmGlobalGenerator.cxx and its CheckLocalGenerators
function. This seems to the right place to perform all checks.

I think I could make a global variable CMAKE_ALLOW_PARTIAL_PROJECT_TREE, which I could check in this function. If a target has a failed dependency,
then I should rewrite this target and make it just "cmake -E echo This
target cannot be built."

The problem at this point is to convert cmTarget into just "cmake -E echo" and correctly identify dependencies.

> > Once more: I have 3 projects.
> > 
> > projectA depends on projectB
> > projectB depends on SOMEAPP_INCLUDES and
> SOMEAPP_LIBRARIES
> > projectC does not depend on anything
> > 
> > I have FindSomeApp script that sets SOMEAPP_FOUND
> > 
> > 1. I want to be able to complete cmake configuration,
> and build projectC, even if projectB
> > and projectA cannot be built. Currently I get an error
> "The following variables are used in
> > this project, but they are set to NOTFOUND."
> > 
> > 2. My project is very big, so putting everywhere
> IF-ENDIF is not an option, I need some
> > automatic way. I can rewrite ADD_SUBDIRECTORY, though,
> but how?
> 
> The only way to get that is to create a macro which takes a
> subdir and a
> variable name and hides the if/endif ugliness. Then use
> this macro
> everywhere instead of add_subdirectory.
> 
> Andreas



      


More information about the CMake mailing list