24.09., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

FindLua.cmake 800 Bytes
Newer Older
1 2 3 4 5 6 7
# Try to find LUA library and include path. Once done this will define:
# LUA_FOUND
# LUA_DEFINITIONS
# LUA_INCLUDE_DIR
# LUA_LIBRARY

IF(WIN32)
8 9 10
    # For now Lua needs to be built as part of CAMPVis on Windows
    IF(CAMPVIS_BUILD_LIB_LUA)
        SET(LUA_DIR "${CampvisHome}/ext/lua" CACHE PATH "If Lua is not found, set this path")
11

12
        SET(LUA_INCLUDE_DIR "${LUA_DIR}/src" "${CMAKE_BINARY_DIR}/ext/lua")
13

14 15 16 17 18 19 20
        IF(LUA_INCLUDE_DIR)
            SET(LUA_LIBRARY liblua)
            SET(LUA_FOUND TRUE)
        ELSE()
            SET(LUA_FOUND FALSE)
        ENDIF()
    ENDIF(CAMPVIS_BUILD_LIB_LUA)
21 22 23 24 25 26 27

ELSE(WIN32)
    # TODO: not tested
    MESSAGE(FATAL_ERROR "FindLua.cmake doesn't support platforms other than Windows yet")
ENDIF(WIN32)

MARK_AS_ADVANCED(LUA_DIR LUA_INCLUDE_DIR LUA_LIBRARY)