libubox: lua: use pkg-config built in module to search for alternatives
Different distributions have different names for the lua 5.1 package. Use cmake's built in pkg-config support to search for the first one, rather than running it explicitly and searching for a single version. Signed-off-by: Karl Palsson <karlp@remake.is>
This commit is contained in:
parent
10429bccd0
commit
682e071ef7
1 changed files with 1 additions and 8 deletions
|
@ -5,14 +5,7 @@ PROJECT(uloop C)
|
||||||
SET(CMAKE_INSTALL_PREFIX /)
|
SET(CMAKE_INSTALL_PREFIX /)
|
||||||
|
|
||||||
IF(NOT LUA_CFLAGS)
|
IF(NOT LUA_CFLAGS)
|
||||||
FIND_PROGRAM(PKG_CONFIG pkg-config)
|
pkg_search_module(LUA lua5.1 lua-5.1)
|
||||||
IF(PKG_CONFIG)
|
|
||||||
EXECUTE_PROCESS(
|
|
||||||
COMMAND pkg-config --silence-errors --cflags lua5.1
|
|
||||||
OUTPUT_VARIABLE LUA_CFLAGS
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
)
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -I.. ${LUA_CFLAGS})
|
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -I.. ${LUA_CFLAGS})
|
||||||
|
|
Loading…
Reference in a new issue