cmake_modules/FindLua.cmake
changeset 6813 48c3462ddce9
parent 6812 929b467c7277
child 6814 21928ae7c74b
equal deleted inserted replaced
6812:929b467c7277 6813:48c3462ddce9
     1 # Find the Lua library
     1 # Find the Lua library
     2 #
     2 #
     3 
     3 
     4 IF(WIN32)
     4 if (ANDROID)
     5 	SET(LUA_DEFAULT lua.dll)
     5 	SET(LUA_DEFAULT "liblua5.1.so")
     6 ELSE(WIN32)
     6 else (ANDROID)
     7 	IF(APPLE)
     7 	IF(WIN32)
     8 		SET(LUA_DEFAULT lua)
     8 		SET(LUA_DEFAULT lua.dll)
     9 	ELSE(APPLE)
     9 	ELSE(WIN32)
    10 		if (ANDROID)
    10 		IF(APPLE)
    11                 	SET(LUA_DEFAULT "liblua5.1.so")
    11 			SET(LUA_DEFAULT lua)
    12                 else (ANDROID)
    12 		ELSE(APPLE)
    13 	                #locate the system's lua library
    13 	                #locate the system's lua library
    14 			FIND_LIBRARY(LUA_DEFAULT NAMES lua51 lua5.1 lua-5.1 lua PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib)
    14 			FIND_LIBRARY(LUA_DEFAULT NAMES lua51 lua5.1 lua-5.1 lua PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib)
    15 			IF(${LUA_DEFAULT} MATCHES "LUA_DEFAULT-NOTFOUND")
    15 			IF(${LUA_DEFAULT} MATCHES "LUA_DEFAULT-NOTFOUND")
    16 				#UNSET(LUA_DEFAULT)
    16 				#UNSET(LUA_DEFAULT)
    17 				MESSAGE(FATAL_ERROR "Couldn't find Lua 5.1 library!")
    17 				MESSAGE(FATAL_ERROR "Couldn't find Lua 5.1 library!")
    18 			ENDIF()
    18 			ENDIF()
    19 			#remove the path (fpc doesn't like it - why?)
    19 			#remove the path (fpc doesn't like it - why?)
    20 			GET_FILENAME_COMPONENT(LUA_DEFAULT ${LUA_DEFAULT} NAME)
    20 			GET_FILENAME_COMPONENT(LUA_DEFAULT ${LUA_DEFAULT} NAME)
    21                 ENDIF(ANDROID)
    21                 ENDIF(APPLE
    22 	ENDIF(APPLE)
    22 	ENDIF(WIN32)
    23 ENDIF(WIN32)
    23 ENDIF(ANDROID)
    24 SET(LUA_LIBRARY ${LUA_DEFAULT} CACHE STRING "Lua library to link to; file name without path only!")
    24 SET(LUA_LIBRARY ${LUA_DEFAULT} CACHE STRING "Lua library to link to; file name without path only!")
    25 #UNSET(LUA_DEFAULT)
    25 #UNSET(LUA_DEFAULT)