[OpenWrt-Devel] [PATCH 2/2] ubus: lua: use built in pkg-config support for alternatives
Karl Palsson
karlp at tweak.net.au
Fri Apr 29 09:53:59 EDT 2016
From: Karl Palsson <karlp at etactica.com>
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 at remake.is>
---
Same patch as in libubox & uci
lua/CMakeLists.txt | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/lua/CMakeLists.txt b/lua/CMakeLists.txt
index e4821bf..abf4929 100644
--- a/lua/CMakeLists.txt
+++ b/lua/CMakeLists.txt
@@ -5,14 +5,8 @@ PROJECT(ubus C)
SET(CMAKE_INSTALL_PREFIX /)
IF(NOT LUA_CFLAGS)
- FIND_PROGRAM(PKG_CONFIG pkg-config)
- IF(PKG_CONFIG)
- EXECUTE_PROCESS(
- COMMAND pkg-config --silence-errors --cflags lua5.1
- OUTPUT_VARIABLE LUA_CFLAGS
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- ENDIF()
+ INCLUDE(FindPkgConfig)
+ pkg_search_module(LUA lua5.1 lua-5.1)
ENDIF()
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -I.. ${LUA_CFLAGS})
--
2.4.11
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list