lua: allow overriding of LUA_CFLAGS
authorFelix Fietkau <nbd@openwrt.org>
Thu, 15 Sep 2011 14:41:57 +0000 (16:41 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 15 Sep 2011 14:42:01 +0000 (16:42 +0200)
lua/CMakeLists.txt

index 7edfd0a00133a0d8b34b8ced55e768a3bb77d30f..63c6a40cc27408618e8fbf53e56f642a7096aa35 100644 (file)
@@ -4,13 +4,15 @@ PROJECT(uci C)
 
 SET(CMAKE_INSTALL_PREFIX /)
 
-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
-       )
+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()
 ENDIF()
 
 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -I.. ${LUA_CFLAGS})