LUA_FOUND should surely be set only if the system lua was found.
--- a/CMakeLists.txt Tue Jun 12 21:42:22 2012 -0400
+++ b/CMakeLists.txt Wed Jun 13 11:18:30 2012 -0400
@@ -200,7 +200,7 @@
endif()
find_package(Lua)
-if(${LUA_FOUND})
+if(LUA_FOUND)
message(STATUS "Lua library is present on your system (${LUA_DEFAULT})")
else()
message(STATUS "Lua library not found, building bundled dependency")
--- a/cmake_modules/FindLua.cmake Tue Jun 12 21:42:22 2012 -0400
+++ b/cmake_modules/FindLua.cmake Wed Jun 13 11:18:30 2012 -0400
@@ -20,8 +20,8 @@
FIND_LIBRARY(LUA_DEFAULT NAMES lua51 lua5.1 lua-5.1 lua PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib)
IF(${LUA_DEFAULT} MATCHES "LUA_DEFAULT-NOTFOUND")
set(LUA_DEFAULT lua)
+ ELSE()
set(LUA_FOUND true)
- ELSE()
message(STATUS "LibLua 5.1 found at ${LUA_DEFAULT}")
#remove the path (fpc doesn't like it - why?)
GET_FILENAME_COMPONENT(LUA_DEFAULT ${LUA_DEFAULT} NAME)
--- a/hedgewars/CMakeLists.txt Tue Jun 12 21:42:22 2012 -0400
+++ b/hedgewars/CMakeLists.txt Wed Jun 13 11:18:30 2012 -0400
@@ -217,7 +217,7 @@
add_custom_target(${engine_output_name} ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}")
#when system Lua is not found we need to compile it before engine
-if(NOT ${LUA_FOUND})
+if(NOT LUA_FOUND)
add_dependencies(${engine_output_name} lua)
endif()