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.

56 lines
1.6 KiB

12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
  1. CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
  2. cmake_policy(VERSION 2.6.0)
  3. SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
  4. INCLUDE(CheckIncludeFiles)
  5. INCLUDE(CheckLibraryExists)
  6. INCLUDE(FindPkgConfig)
  7. INCLUDE(AddTargetProperties)
  8. PROJECT(fcgi-cgi C)
  9. SET(PACKAGE_VERSION 0.2.2)
  10. IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
  11. 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)
  12. ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
  13. # libev
  14. FIND_PACKAGE(LibEV REQUIRED)
  15. # GLIB 2
  16. pkg_check_modules (GLIB2 REQUIRED glib-2.0)
  17. INCLUDE_DIRECTORIES(${GLIB2_INCLUDES_DIRS})
  18. SET(MAIN_SOURCE fastcgi.c fcgi-cgi.c)
  19. SET(PACKAGE_NAME ${CMAKE_PROJECT_NAME})
  20. SET(PACKAGE_VERSION ${PACKAGE_VERSION})
  21. CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h ESCAPE_QUOTES)
  22. ADD_DEFINITIONS(-DHAVE_CONFIG_H)
  23. INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
  24. add_executable(fcgi-cgi ${MAIN_SOURCE})
  25. ADD_TARGET_PROPERTIES(fcgi-cgi COMPILE_FLAGS "-std=gnu99 -Wall -g -Wshadow -W -pedantic -fPIC")
  26. # libev
  27. TARGET_LINK_LIBRARIES(fcgi-cgi ${LIBEV_LDFLAGS})
  28. ADD_TARGET_PROPERTIES(fcgi-cgi COMPILE_FLAGS ${LIBEV_CFLAGS})
  29. # GLIB 2
  30. TARGET_LINK_LIBRARIES(fcgi-cgi ${GLIB2_LDFLAGS})
  31. ADD_TARGET_PROPERTIES(fcgi-cgi COMPILE_FLAGS ${GLIB2_CFLAGS})
  32. INSTALL(TARGETS fcgi-cgi DESTINATION bin)
  33. # man page
  34. SET(CMAKE_MAN_DIR "share/man" CACHE STRING
  35. "Install location for man pages (relative to prefix).")
  36. MARK_AS_ADVANCED(CMAKE_MAN_DIR)
  37. INSTALL(FILES fcgi-cgi.1 DESTINATION ${CMAKE_MAN_DIR}/man1)