[CMake] Avoid nested cmake invocation taking parent's info.

Óscar Fuentes ofv at wanadoo.es
Sun Nov 9 16:24:45 EST 2008

While cross-compiling, I'm trying to avoid depending on previously built
executables, that is, the cross-compile build should create the native
utilities it needs. For this, I'm trying


where CX_NATIVE_TG_DIR is a new directory where the native build is
performed. Later,

  add_custom_command(OUTPUT ${LLVM_TABLEGEN}
    COMMENT "Building native TableGen...")
  add_custom_target(NativeTableGen DEPENDS ${LLVM_TABLEGEN})

The problem is in execute_process. The cmake process created by it is
taking variable values from the enclosing cmake, so it uses the same
compiler, configure variables, etc.

How can this be avoided? I want the nested cmake to work as if the
enclosing cmake didn't existed.


More information about the CMake mailing list