cmake_modules/FindLua.cmake
changeset 8075 0ccb218127c3
parent 8072 c803d89ae74d
child 9208 acb2492288e5
equal deleted inserted replaced
8074:768427321cab 8075:0ccb218127c3
    19         ELSE(APPLE)
    19         ELSE(APPLE)
    20             #locate the system's lua library
    20             #locate the system's lua library
    21             FIND_LIBRARY(LUA_DEFAULT NAMES lua51 lua5.1 lua-5.1 lua PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib)
    21             FIND_LIBRARY(LUA_DEFAULT NAMES lua51 lua5.1 lua-5.1 lua PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib)
    22             IF(${LUA_DEFAULT} MATCHES "LUA_DEFAULT-NOTFOUND")
    22             IF(${LUA_DEFAULT} MATCHES "LUA_DEFAULT-NOTFOUND")
    23                 set(LUA_DEFAULT lua)
    23                 set(LUA_DEFAULT lua)
    24                 set(LUA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/misc/liblua)
       
    25             ELSE()
    24             ELSE()
    26                 set(LUA_FOUND true)
    25                 set(LUA_FOUND true)
    27                 message(STATUS "LibLua 5.1 found at ${LUA_DEFAULT}")
    26                 message(STATUS "LibLua 5.1 found at ${LUA_DEFAULT}")
       
    27                 find_path(LUA_INCLUDE_DIR lua.h)
    28                 #remove the path (fpc doesn't like it - why?)
    28                 #remove the path (fpc doesn't like it - why?)
    29                 GET_FILENAME_COMPONENT(LUA_INCLUDE_DIR ${LUA_DEFAULT} PATH)
       
    30                 GET_FILENAME_COMPONENT(LUA_DEFAULT ${LUA_DEFAULT} NAME)
    29                 GET_FILENAME_COMPONENT(LUA_DEFAULT ${LUA_DEFAULT} NAME)
    31             ENDIF()
    30             ENDIF()
    32         ENDIF(APPLE)
    31         ENDIF(APPLE)
    33     ENDIF(WIN32)
    32     ENDIF(WIN32)
    34 ENDIF(ANDROID)
    33 ENDIF(ANDROID)