cmake_modules/FindLua.cmake
changeset 2925 d088b5f813c9
parent 2924 908851e59958
child 3014 2b4116a8bdb0
child 3067 330e60f5dde8
--- a/cmake_modules/FindLua.cmake	Wed Mar 03 15:04:39 2010 +0000
+++ b/cmake_modules/FindLua.cmake	Wed Mar 03 16:19:37 2010 +0000
@@ -1,11 +1,15 @@
 # Find the Lua library
 #
 
-IF(UNIX)
-  FIND_LIBRARY(LUA_LIBRARY NAMES lua5.1 lua)
-ELSE(UNIX)
-  IF(WIN32)
-    SET(LUA_LIBRARY lua.dll CACHE FILEPATH "Path to the lua library to be used. This should be set to 'lua.dll' or 'lua' under Win32/Apple to use the bundled copy.")
-  else(WIN32)
-  ENDIF(WIN32)
-ENDIF(UNIX)
\ No newline at end of file
+IF(NOT LUA_LIBRARY)
+	IF(WIN32)
+		set(LUA_DEFAULT lua.dll)
+	ELSE(WIN32)
+		IF(APPLE)
+			set(LUA_DEFAULT lua)
+		ELSE(APPLE)
+			set(LUA_DEFAULT lua5.1.so)
+		ENDIF(APPLE)
+	ENDIF(WIN32)
+	SET(LUA_LIBRARY ${LUA_DEFAULT} CACHE STRING "Lua library to link to; file name without path only!")
+ENDIF(NOT LUA_LIBRARY)
\ No newline at end of file