comparison Resources/CMake/LuaConfiguration.cmake @ 3833:a3e38994d95a

compilation on mips qemu
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 15 Apr 2020 14:45:52 +0200
parents 01905b67f8b5
children
comparison
equal deleted inserted replaced
3832:ab9a0d1e0cc1 3833:a3e38994d95a
98 ${LUA_SOURCES_DIR}/src/linit.c 98 ${LUA_SOURCES_DIR}/src/linit.c
99 ) 99 )
100 100
101 source_group(ThirdParty\\Lua REGULAR_EXPRESSION ${LUA_SOURCES_DIR}/.*) 101 source_group(ThirdParty\\Lua REGULAR_EXPRESSION ${LUA_SOURCES_DIR}/.*)
102 102
103 elseif (CMAKE_CROSSCOMPILING AND
104 "${CMAKE_SYSTEM_VERSION}" STREQUAL "CrossToolNg")
105
106 set(LUA_VERSIONS 5.3 5.2 5.1)
107
108 unset(LUA_VERSION)
109 foreach(version IN ITEMS ${LUA_VERSIONS})
110 CHECK_INCLUDE_FILE(lua${version}/lua.h HAVE_LUA${version}_H)
111 if (HAVE_LUA${version}_H)
112 set(LUA_VERSION ${version})
113 break()
114 endif()
115 endforeach()
116
117 if (NOT LUA_VERSION)
118 message(FATAL_ERROR "Please install the liblua-dev package")
119 endif()
120
121 CHECK_LIBRARY_EXISTS(lua${LUA_VERSION} "lua_call" "${LUA_LIB_DIR}" HAVE_LUA_LIB)
122 if (NOT HAVE_LUA_LIB)
123 message(FATAL_ERROR "Please install the liblua package")
124 endif()
125
126 include_directories(${CROSSTOOL_NG_IMAGE}/usr/include/lua${LUA_VERSION})
127 link_libraries(lua${LUA_VERSION})
128
103 else() 129 else()
104 include(FindLua) 130 include(FindLua)
105 131
106 if (NOT LUA_FOUND) 132 if (NOT LUA_FOUND)
107 message(FATAL_ERROR "Please install the liblua-dev package") 133 message(FATAL_ERROR "Please install the liblua-dev package")