[Cmake] Proper way to embed or nest a separate project into another project?

Andy Cedilnik andy.cedilnik at kitware.com
Mon, 15 Mar 2004 08:25:24 -0500


Hi Eric,

If LUA has CMake files, then you are all set. If not, then you have to
do some magic. Looking through LUA 5.0 source (Debian apt-get source
lua50), looks like it should not take you (or anybody) too much time to
convert it to CMake. Right now you have to do manual edit of file
"config", but that could be substitute by some try compiles...

On Fri, 2004-03-12 at 18:13, Eric Wing wrote:
> So does this mean that I can't take a self-standing
> Lua/CMake project as-is and then embed it in my
> project?

Substitute MESSAGE for whatever you want to do in that case. If LUA is
found, then I guess SET(USE_SYSTEM_LUA ON). Otherwise
SUBDIRS(Utilities/Lua).

In VTK, Xdmf, ITK, ParaView, ... we usually provide options to use
system libraries and there are no problems. You just have to make sure
the FindLUA.cmake does set the same variables as your alternative case
(when you build it yourself).

			Andy

> Substituting MESSAGE(...) for
> SET_OPTION(USE_SYSTEM_LUA OFF or ON), will this cause
> me problems? So if Lua is found, but the user decides
> to use the bundled one instead, won't this cause a
> conflict when the user hits 'c' for configure again
> because the above code will be rerun and reset the
> state back to the system Lua?