2009/3/13 Denis Scherbakov <denis_scherba...@yahoo.com>:

>
> As I already wrote, my problem is that "IF ( NOT MICO_FOUND )" code is 
> executed too early - during compilation by cmake, not when user types "gmake 
> puts" and it becomes clear that MICO is needed.

That's the expected behavior, because CMake tries to find libXml2/Mico

** at CMake time ** , i.e. when CMake runs not when building (i.e.
when gmake runs in your case).

If you want to authorize a user to compile a sub-project without having
the required libs installed used by other sub-project you should make
** the configuration ** of those sub-project optional and not
** their compilation **

You may use CMake "OPTION" for that purpose:

OPTION(BUILD_PRINTF  "Build the PRINTF Sub-project" ON)
OPTION(BUILD_PUTS  "Build the PUTS Sub-project" ON)

IF (BUILD_PRINTF)
   ADD_SUBDIRECTORY("printf")
ENDIF(BUILD_PRINTF)

IF (BUILD_PUTS)
  ADD_SUBDIRECTORY("puts")
ENDIF (BUILD_PUTS)

When calling CMake your user/developper may decide not to compile
some sub-project:

cmake -DBUILD_PRINTF:BOOL=OFF

in this case the default is to build both.


-- 
Erk
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to