Print the version of the include files that will be used.
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 1 May 2013 10:34:15 +0000 (10:34 +0000)
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 1 May 2013 10:34:15 +0000 (10:34 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@49106 f5534014-38df-0310-8fa8-9805f1628bb7

cmake/modules/FindLUA.cmake

index 2c6bc5ee6538ea6e6ea0cab4249782d227ee53b9..e490fc105f0f66fe81439ffb1e2cd9feadd72846 100644 (file)
@@ -30,6 +30,16 @@ FIND_PATH(LUA_INCLUDE_DIR lua.h
   /opt
 )
 
+if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
+  file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" LUA_VERSION REGEX "LUA_VERSION_NUM")
+  if (LUA_VERSION)
+    string(REGEX REPLACE "^#define[ \t]+LUA_VERSION_NUM[ \t]+(.+)" "\\1" LUA_VERSION "${LUA_VERSION}")
+  else()
+    set( LUA_VERSION "500")
+  endif()
+endif()
+
+
 FIND_LIBRARY(LUA_LIBRARY
   NAMES lua52 lua5.2 lua51 lua5.1 lua
   HINTS
@@ -50,6 +60,7 @@ INCLUDE(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if 
 # all listed variables are TRUE
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LUA  DEFAULT_MSG  LUA_LIBRARY LUA_INCLUDE_DIR)
+message("LUA INCLUDEs version: ${LUA_VERSION}")
 
 IF(LUA_LIBRARY)
   SET( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")