INCLUDE(FindPackageHandleStandardArgs)

IF (NOT LUA51_INCLUDE_DIR)
    FIND_PATH(LUA51_INCLUDE_DIR
        NAMES lua.h
        HINTS $ENV{LUA51_DIR}
        PATH_SUFFIXES lua5.1
    )
ENDIF()

IF (NOT LUA51_LIBRARIES)
    FIND_LIBRARY(LUA51_LIBRARIES lua5.1 HINTS $ENV{LUA51_DIR})
ENDIF()

MARK_AS_ADVANCED(LUA51_INCLUDE_DIR)
MARK_AS_ADVANCED(LUA51_LIBRARIES)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(
    Lua51
    DEFAULT_MSG
    LUA51_LIBRARIES
    LUA51_INCLUDE_DIR
)

