spawns FastCGI processes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

55 lines
2.0 KiB

  1. CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
  2. cmake_policy(VERSION 2.6.0)
  3. MACRO(ADD_TARGET_PROPERTIES _target _name _properties)
  4. SET(_properties ${ARGV})
  5. LIST(REMOVE_AT _properties 0)
  6. LIST(REMOVE_AT _properties 0)
  7. GET_TARGET_PROPERTY(_old_properties ${_target} ${_name})
  8. #MESSAGE("adding property to ${_target} ${_name}: ${_properties}")
  9. IF(NOT _old_properties)
  10. # in case it's NOTFOUND
  11. SET(_old_properties)
  12. ELSE(NOT _old_properties)
  13. SET(_old_properties "${_old_properties} ")
  14. ENDIF(NOT _old_properties)
  15. SET_TARGET_PROPERTIES(${_target} PROPERTIES ${_name} "${_old_properties}${_properties}")
  16. ENDMACRO(ADD_TARGET_PROPERTIES)
  17. PROJECT(spawn-fcgi)
  18. SET(PACKAGE_VERSION 2.0.0)
  19. OPTION(USE_LIMITS "Enable /etc/security/limits.conf support" ON)
  20. IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
  21. SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
  22. ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
  23. # GLIB 2
  24. INCLUDE(FindPkgConfig)
  25. pkg_check_modules (GLIB2 REQUIRED glib-2.0)
  26. SET(GLIB_INCLUDES ${GLIB2_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS}/glib-2.0/ ${GLIB2_INCLUDE_DIRS}/glib-2.0/include/)
  27. INCLUDE_DIRECTORIES(${GLIB_INCLUDES})
  28. SET(MAIN_SOURCE spawn-fcgi.c)
  29. IF(USE_LIMITS)
  30. SET(MAIN_SOURCE ${MAIN_SOURCE} pam_limits.c)
  31. ADD_DEFINITIONS(-DUSE_LIMITS)
  32. ENDIF(USE_LIMITS)
  33. SET(PACKAGE_NAME ${CMAKE_PROJECT_NAME})
  34. SET(PACKAGE_VERSION ${PACKAGE_VERSION})
  35. CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h ESCAPE_QUOTES)
  36. ADD_DEFINITIONS(-DHAVE_CONFIG_H)
  37. INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
  38. add_executable(spawn-fcgi ${MAIN_SOURCE})
  39. ADD_TARGET_PROPERTIES(spawn-fcgi COMPILE_FLAGS "-std=gnu99 -Wall -g -Wshadow -W -pedantic -fPIC -D_GNU_SOURCE")
  40. # GLIB 2
  41. ADD_TARGET_PROPERTIES(spawn-fcgi LINK_FLAGS "${GLIB2_LDFLAGS}")
  42. ADD_TARGET_PROPERTIES(spawn-fcgi COMPILE_FLAGS "${GLIB2_CFLAGS_OTHER}")
  43. INSTALL(TARGETS spawn-fcgi DESTINATION bin)