CMake:Experiments With Lua: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(New page: Here is a source tree for a CMake that also accepts Lua as input. This is just an experiment and only one command cm_get_property returns a value as a proper Lua function should. But all c...)
 
No edit summary
Line 1: Line 1:
Here is a source tree for a CMake that also accepts Lua as input. This is just an experiment and only one command cm_get_property returns a value as a proper Lua function should. But all commands are wrapped and the LuaTest test case (found under CMake/Tests) works.  
Here (http://www.cmake.org/Wiki/Image:CMakeLua.zip) is a source tree for a CMake that also accepts Lua as input. This is just an experiment and only one command cm_get_property returns a value as a proper Lua function should. But all commands are wrapped and the LuaTest test case (found under CMake/Tests) works.  


-- a simple test case
<pre>
-- a simple test case
cm_project ("LuaTest");
cm_project ("LuaTest");


Line 18: Line 19:
print("The location of simpleLib is: " ..  
print("The location of simpleLib is: " ..  
   cm_get_property("TARGET", "simpleLib", "LOCATION"));
   cm_get_property("TARGET", "simpleLib", "LOCATION"));
</pre>

Revision as of 18:04, 26 November 2007

Here (http://www.cmake.org/Wiki/Image:CMakeLua.zip) is a source tree for a CMake that also accepts Lua as input. This is just an experiment and only one command cm_get_property returns a value as a proper Lua function should. But all commands are wrapped and the LuaTest test case (found under CMake/Tests) works.

-- a simple test case
cm_project ("LuaTest");

cm_add_executable ("LuaTest", "simple.cxx");

sources = {
  "simpleLib.cxx",
  "simpleCLib.c", 
  "simpleWe.cpp"
}

cm_add_library ("simpleLib", "STATIC", unpack(sources));

cm_target_link_libraries ("LuaTest", "simpleLib");

print("The location of simpleLib is: " .. 
  cm_get_property("TARGET", "simpleLib", "LOCATION"));