From: <ai...@us...> - 2009-01-30 02:38:03
|
Revision: 9416 http://plplot.svn.sourceforge.net/plplot/?rev=9416&view=rev Author: airwin Date: 2009-01-30 02:38:01 +0000 (Fri, 30 Jan 2009) Log Message: ----------- Find, check version consistency, and use LUA_EXECUTABLE. Modified Paths: -------------- trunk/cmake/modules/lua.cmake trunk/plplot_test/test_lua.sh.in Modified: trunk/cmake/modules/lua.cmake =================================================================== --- trunk/cmake/modules/lua.cmake 2009-01-30 00:34:33 UTC (rev 9415) +++ trunk/cmake/modules/lua.cmake 2009-01-30 02:38:01 UTC (rev 9416) @@ -58,3 +58,40 @@ set(ENABLE_lua OFF CACHE BOOL "Enable LUA bindings" FORCE) endif(NOT LUA_FOUND) endif(ENABLE_lua) + +if(ENABLE_lua) + find_program(LUA_EXECUTABLE lua) + if(NOT LUA_EXECUTABLE) + message(STATUS "WARNING: " + "lua executable not found. Disabling lua bindings") + set(ENABLE_lua OFF CACHE BOOL "Enable LUA bindings" FORCE) + endif(NOT LUA_EXECUTABLE) +endif(ENABLE_lua) + +if(ENABLE_lua) + # Check whether you have found a lua executable that is consistent + # with the library version. + execute_process(COMMAND ${LUA_EXECUTABLE} -v + OUTPUT_VARIABLE LUA_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE LUA_VERSION + ERROR_STRIP_TRAILING_WHITESPACE + ) + #message("(preliminary) LUA_VERSION = ${LUA_VERSION}") + string(REGEX MATCH "[0-9]\\.[0-9]\\.[0-9]" LUA_VERSION "${LUA_VERSION}") + message(STATUS "LUA_VERSION = ${LUA_VERSION}") + set(LUA_VERSION_VALID) + if(${LUA_VERSION} VERSION_LESS "5.1.0" AND NOT HAVE_lua51) + set(LUA_VERSION_VALID ON) + endif(${LUA_VERSION} VERSION_LESS "5.1.0" AND NOT HAVE_lua51) + if(${LUA_VERSION} VERSION_GREATER "5.0.9999999" AND HAVE_lua51) + set(LUA_VERSION_VALID ON) + endif(${LUA_VERSION} VERSION_GREATER "5.0.9999999" AND HAVE_lua51) + + if(NOT LUA_VERSION_VALID) + message(STATUS "WARNING: " + "lua executable found but version not consistent with library. Disabling lua bindings") + set(ENABLE_lua OFF CACHE BOOL "Enable LUA bindings" FORCE) + endif(NOT LUA_VERSION_VALID) + +endif(ENABLE_lua) Modified: trunk/plplot_test/test_lua.sh.in =================================================================== --- trunk/plplot_test/test_lua.sh.in 2009-01-30 00:34:33 UTC (rev 9415) +++ trunk/plplot_test/test_lua.sh.in 2009-01-30 02:38:01 UTC (rev 9416) @@ -38,12 +38,12 @@ fi if [ "$index" = "14" ] ; then echo ${results}/x${index}a${lang}%n.$dsuffix | \ - lua x${index}.${lang} -dev $device -o ${results}/x${index}${lang}%n.$dsuffix \ + @LUA_EXECUTABLE@ x${index}.${lang} -dev $device -o ${results}/x${index}${lang}%n.$dsuffix \ $options 2> test.error >| ${results}/x${index}${lang}_${dsuffix}.txt # Look for any status codes (segfaults, plexit) from the examples themselves. status_code=$? else - lua x${index}.${lang} -dev $device -o ${results}/x${index}${lang}%n.$dsuffix \ + @LUA_EXECUTABLE@ x${index}.${lang} -dev $device -o ${results}/x${index}${lang}%n.$dsuffix \ $options 2> test.error >| ${results}/x${index}${lang}_${dsuffix}.txt # Look for any status codes (segfaults, plexit) from the examples themselves. status_code=$? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |