File: CMakeLists.txt

package info (click to toggle)
mapcache 1.14.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,844 kB
  • sloc: ansic: 33,609; xml: 889; sh: 183; makefile: 61; python: 48
file content (35 lines) | stat: -rw-r--r-- 1,159 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
option(WITH_CGI "Choose if CGI executable should be built" ON)
option(WITH_FCGI "Choose if CGI executable should support FastCGI" ON)

if(WITH_CGI)
  if(NOT DEFINED CMAKE_INSTALL_CGIBINDIR)
     set(CMAKE_INSTALL_CGIBINDIR ${CMAKE_INSTALL_BINDIR})
  endif(NOT DEFINED CMAKE_INSTALL_CGIBINDIR)

  add_executable(mapcache.fcgi mapcache.c)
  target_link_libraries(mapcache.fcgi mapcache)
  
  if(WITH_FCGI)
    find_package(FCGI)
    if(FCGI_FOUND)
      include_directories(${FCGI_INCLUDE_DIR})
      target_link_libraries(mapcache.fcgi ${FCGI_LIBRARY})
      set (USE_FASTCGI 1)
    else(FCGI_FOUND)
      report_optional_not_found(FCGI)
    endif(FCGI_FOUND)
  endif (WITH_FCGI)
  
configure_file (
  "${PROJECT_SOURCE_DIR}/cgi/mapcache-cgi-config.h.in"
  "${PROJECT_BINARY_DIR}/cgi/mapcache-cgi-config.h"
  )
include_directories("${PROJECT_BINARY_DIR}/cgi/")
  
  message(STATUS "* CGI Configuration Options:")
  status_optional_component("FastCGI" "${USE_FASTCGI}" "${FCGI_LIBRARY}")
  
  INSTALL(TARGETS mapcache.fcgi RUNTIME DESTINATION ${CMAKE_INSTALL_CGIBINDIR})
else(WITH_CGI)
   message(STATUS "* CGI Configuration Options: DISABLED")
endif(WITH_CGI)