X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4d9b0b89d262961f5a594bfbcb7a1312bcbe43de..9df3c57540c57dd47465db521fe6a7f52739dd55:/tools/cmake/Modules/FindLuaSimgrid.cmake diff --git a/tools/cmake/Modules/FindLuaSimgrid.cmake b/tools/cmake/Modules/FindLuaSimgrid.cmake index 2904b9847a..00b9fb801b 100644 --- a/tools/cmake/Modules/FindLuaSimgrid.cmake +++ b/tools/cmake/Modules/FindLuaSimgrid.cmake @@ -1,9 +1,9 @@ # Search for the Lua 5.3 include files and libraries -# +# # Input variable: # LUA_HINT: path to Lua installation -- only needed for non-standard installs # Output variable: -# HAVE_LUA : if Lua was found +# SIMGRID_HAVE_LUA : if Lua was found # LUA_LIBRARY : the path to the dynamic library # LUA_INCLUDE_DIR : where to find lua.h # LUA_VERSION_MAJOR: First part of the version (often, 5) @@ -40,7 +40,7 @@ find_library(LUA_LIBRARY /opt/csw /opt ) -if (NOT LUA_LIBRARY) +if (NOT LUA_LIBRARY) message(FATAL_ERROR "Error: Lua library not found. Please install that package (and set LUA_HINT) or disable Lua.") endif() if (NOT LUA_INCLUDE_DIR OR NOT EXISTS "${LUA_INCLUDE_DIR}/lua.h") @@ -53,10 +53,10 @@ file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_VERSION_MINOR[ \t]+\"[0123456789]+\"") string(REGEX REPLACE "^#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([^\"]+)\"" "\\1" LUA_VERSION_MINOR "${lua_version_str}") unset(lua_version_str) - + # Check that we have a sufficient version of Lua if(LUA_VERSION_MAJOR EQUAL 5 AND LUA_VERSION_MINOR EQUAL 3) - set(HAVE_LUA 1) + set(SIMGRID_HAVE_LUA 1) include_directories(${LUA_INCLUDE_DIR}) else() message(FATAL_ERROR "Error: Lua version 5.3 is required, but version ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} found instead.")