• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/jsonpath/CMakeLists.txt

  1 cmake_minimum_required(VERSION 2.6)
  2 
  3 PROJECT(jsonpath C)
  4 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-error=unused-variable -ffunction-sections -D_GNU_SOURCE)
  5 
  6 IF(NOT APPLE)
  7   SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,--gc-sections")
  8 ENDIF()
  9 
 10 find_library(json NAMES json-c json)
 11 
 12 IF(DEBUG)
 13   ADD_DEFINITIONS(-DDEBUG -g3)
 14 ENDIF()
 15 
 16 INCLUDE(FindPkgConfig)
 17 PKG_CHECK_MODULES(JSONC json-c json)
 18 IF(JSONC_FOUND)
 19   ADD_DEFINITIONS(-DJSONC)
 20   INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS})
 21 ENDIF()
 22 
 23 ADD_CUSTOM_COMMAND(
 24   OUTPUT contrib/lemon
 25   DEPENDS contrib/lemon.c contrib/lempar.c
 26   COMMAND gcc -o contrib/lemon contrib/lemon.c
 27   COMMENT "Generating lemon parser generator"
 28 )
 29 
 30 ADD_CUSTOM_COMMAND(
 31   OUTPUT parser.c
 32   DEPENDS parser.y contrib/lemon
 33   COMMAND ./contrib/lemon parser.y
 34   COMMENT "Generating parser.c"
 35 )
 36 
 37 FIND_PATH(ubox_include_dir libubox/list.h)
 38 INCLUDE_DIRECTORIES(${ubox_include_dir})
 39 
 40 SET_PROPERTY(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "lemon;parser.h;parser.out")
 41 SET_SOURCE_FILES_PROPERTIES("parser.c" PROPERTIES GENERATED TRUE)
 42 ADD_EXECUTABLE(jsonpath main.c ast.c lexer.c parser.c matcher.c)
 43 TARGET_LINK_LIBRARIES(jsonpath ubox ${json})
 44 
 45 INSTALL(TARGETS jsonpath RUNTIME DESTINATION bin)

This page was automatically generated by LXR 0.3.1.  •  OpenWrt