uloop: fix a regression in timeout handling
[project/libubox.git] / lua / CMakeLists.txt
index 04abe0c..34c9ab1 100644 (file)
@@ -5,21 +5,13 @@ PROJECT(uloop C)
 SET(CMAKE_INSTALL_PREFIX /)
 
 IF(NOT LUA_CFLAGS)
 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()
+       pkg_search_module(LUA lua5.1 lua-5.1)
 ENDIF()
 
 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -I.. ${LUA_CFLAGS})
 LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/..)
 
 IF(APPLE)
 ENDIF()
 
 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -I.. ${LUA_CFLAGS})
 LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/..)
 
 IF(APPLE)
-       ADD_DEFINITIONS(-I/opt/local/include)
        SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -undefined dynamic_lookup")
 ENDIF(APPLE)
 
        SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -undefined dynamic_lookup")
 ENDIF(APPLE)