From: Felix Fietkau Date: Thu, 15 Sep 2011 14:39:05 +0000 (+0200) Subject: lua: use pkg-config to find the correct lua cflags X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1ba4eb1ad1f8e3bc72f2eac8dbde546a87d1d653;p=project%2Fuci.git lua: use pkg-config to find the correct lua cflags --- diff --git a/lua/CMakeLists.txt b/lua/CMakeLists.txt index a532fc1..7edfd0a 100644 --- a/lua/CMakeLists.txt +++ b/lua/CMakeLists.txt @@ -4,7 +4,16 @@ PROJECT(uci C) SET(CMAKE_INSTALL_PREFIX /) -ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -I..) +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() + +ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -I.. ${LUA_CFLAGS}) LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/..) IF(APPLE)