Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Since cmake 2.6, else() and endif() don't need to repeat the condition.
[simgrid.git] / buildtools / Cmake / Modules / FindLua51Simgrid.cmake
index 5d54f0d..2b3c4d1 100644 (file)
@@ -5,13 +5,13 @@ mark_as_advanced(HAVE_LUA_BIN)
 message(STATUS "Looking for lua.h")
 if(LUA_INCLUDE_DIR)
   message(STATUS "Looking for lua.h - found")
-else(LUA_INCLUDE_DIR)
+else()
   message(STATUS "Looking for lua.h - not found")
-endif(LUA_INCLUDE_DIR)
+endif()
 
 if(HAVE_LUA_BIN)
   message(STATUS "Found Lua: ${HAVE_LUA_BIN}")
-endif(HAVE_LUA_BIN)
+endif()
 
 set(LIB_LUA_NAME "")
 
@@ -22,8 +22,8 @@ foreach(lib_path ${LUA_LIBRARIES})
     string(REPLACE "lib" "" LIB_LUA_NAME "${LIB_LUA_NAME}")
     if(LIB_LUA_NAME)
       string(REPLACE "/lib${LIB_LUA_NAME}.${LIB_EXE}" "" LUA_LIBRARY_DIR ${lib_path})
-    endif(LIB_LUA_NAME)
-  endif(NOT LIB_LUA_NAME)
+    endif()
+  endif()
 endforeach(lib_path ${LUA_LIBRARIES})
 
 message(STATUS "Looking for lib lua")
@@ -31,14 +31,14 @@ if(LUA_LIBRARY_DIR)
   message(STATUS "Looking for lib lua - found")
   message(STATUS "Lua version: ${LIB_LUA_NAME}")
   message(STATUS "Lib path   : ${LUA_LIBRARY_DIR}")
-else(LUA_LIBRARY_DIR)
+else()
   message(STATUS "Looking for lib lua - not found")
-endif(LUA_LIBRARY_DIR)
+endif()
 
 if(LUA51_FOUND)
   set(HAVE_LUA 1)
   include_directories(${LUA_INCLUDE_DIR})
   link_directories(${LUA_LIBRARY_DIR})
-else(LUA51_FOUND)
+else()
   message(STATUS "Warning : Lua need version 5.1")
-endif(LUA51_FOUND)
+endif()