CMakeLists.txt 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. cmake_minimum_required(VERSION 2.6)
  2. PROJECT(procd C)
  3. ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations)
  4. SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
  5. IF(APPLE)
  6. INCLUDE_DIRECTORIES(/opt/local/include)
  7. LINK_DIRECTORIES(/opt/local/lib)
  8. ENDIF()
  9. SET(SOURCES main.c ubus.c service.c instance.c utils.c md5.c hotplug.c state.c mkdev.c early.c inittab.c preinit.c coldplug.c syslog.c log.c watchdog.c signal.c system.c debug.c rcS.c trigger.c measure.c)
  10. find_library(json NAMES json-c json)
  11. SET(LIBS ubox ubus ${json} blobmsg_json json_script)
  12. IF(DEBUG)
  13. ADD_DEFINITIONS(-DDEBUG -g3)
  14. ENDIF()
  15. ADD_EXECUTABLE(procd ${SOURCES})
  16. TARGET_LINK_LIBRARIES(procd ${LIBS})
  17. INSTALL(TARGETS procd
  18. RUNTIME DESTINATION sbin
  19. )
  20. ADD_EXECUTABLE(askfirst askfirst.c)
  21. INSTALL(TARGETS askfirst
  22. RUNTIME DESTINATION sbin
  23. )
  24. ADD_EXECUTABLE(udevtrigger udevtrigger.c)
  25. INSTALL(TARGETS udevtrigger
  26. RUNTIME DESTINATION sbin
  27. )
  28. ADD_EXECUTABLE(logread logread.c)
  29. TARGET_LINK_LIBRARIES(logread ${LIBS})
  30. INSTALL(TARGETS logread
  31. RUNTIME DESTINATION sbin
  32. )