Blame modules/fcgid/CMakeLists.txt

Packit Service f9aed3
# Licensed to the Apache Software Foundation (ASF) under one or more
Packit Service f9aed3
# contributor license agreements.  See the NOTICE file distributed with
Packit Service f9aed3
# this work for additional information regarding copyright ownership.
Packit Service f9aed3
# The ASF licenses this file to You under the Apache License, Version 2.0
Packit Service f9aed3
# (the "License"); you may not use this file except in compliance with
Packit Service f9aed3
# the License.  You may obtain a copy of the License at
Packit Service f9aed3
#
Packit Service f9aed3
#     http://www.apache.org/licenses/LICENSE-2.0
Packit Service f9aed3
#
Packit Service f9aed3
# Unless required by applicable law or agreed to in writing, software
Packit Service f9aed3
# distributed under the License is distributed on an "AS IS" BASIS,
Packit Service f9aed3
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit Service f9aed3
# See the License for the specific language governing permissions and
Packit Service f9aed3
# limitations under the License.
Packit Service f9aed3
#
Packit Service f9aed3
# Read the section on cmake builds in README-FCGID.
Packit Service f9aed3
Packit Service f9aed3
PROJECT(mod_fcgid C)
Packit Service f9aed3
Packit Service f9aed3
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
Packit Service f9aed3
Packit Service f9aed3
IF(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/lib/libhttpd.lib)
Packit Service f9aed3
  MESSAGE(FATAL_ERROR "libhttpd.lib was not found in prefix ${CMAKE_INSTALL_PREFIX}")
Packit Service f9aed3
ENDIF()
Packit Service f9aed3
Packit Service f9aed3
# Select APR trunk (libapr-2.lib) if it exists in PREFIX/lib; otherwise, select
Packit Service f9aed3
# APR 1.x + APR-util 1.x
Packit Service f9aed3
IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/libapr-2.lib")
Packit Service f9aed3
  SET(apr_libraries
Packit Service f9aed3
      ${CMAKE_INSTALL_PREFIX}/lib/libapr-2.lib)
Packit Service f9aed3
ELSEIF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib")
Packit Service f9aed3
  SET(apr_libraries
Packit Service f9aed3
      ${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib
Packit Service f9aed3
      ${CMAKE_INSTALL_PREFIX}/lib/libaprutil-1.lib)
Packit Service f9aed3
ELSE()
Packit Service f9aed3
  MESSAGE(FATAL_ERROR "APR libraries were not found in prefix ${CMAKE_INSTALL_PREFIX}")
Packit Service f9aed3
ENDIF()
Packit Service f9aed3
Packit Service f9aed3
# Misc. options
Packit Service f9aed3
OPTION(INSTALL_PDB "Install .pdb file (if generated)" ON)
Packit Service f9aed3
Packit Service f9aed3
SET(mod_fcgid_sources
Packit Service f9aed3
    fcgid_bridge.c      fcgid_bucket.c      fcgid_conf.c        fcgid_filter.c
Packit Service f9aed3
    fcgid_pm_main.c     fcgid_pm_win.c      fcgid_proc_win.c    fcgid_proctbl_win.c
Packit Service f9aed3
    fcgid_protocol.c    fcgid_spawn_ctl.c   mod_fcgid.c         mod_fcgid.rc
Packit Service f9aed3
)
Packit Service f9aed3
INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/include)
Packit Service f9aed3
ADD_LIBRARY(mod_fcgid SHARED ${mod_fcgid_sources})
Packit Service f9aed3
# magic base address taken from traditional Windows build
Packit Service f9aed3
SET_TARGET_PROPERTIES(mod_fcgid PROPERTIES SUFFIX .so LINK_FLAGS /base:0x46430000)
Packit Service f9aed3
TARGET_LINK_LIBRARIES(mod_fcgid ${CMAKE_INSTALL_PREFIX}/lib/libhttpd.lib ${apr_libraries})
Packit Service f9aed3
INSTALL(TARGETS mod_fcgid RUNTIME DESTINATION modules)
Packit Service f9aed3
IF(INSTALL_PDB)
Packit Service f9aed3
  INSTALL(FILES ${CMAKE_BINARY_DIR}/mod_fcgid.pdb DESTINATION modules
Packit Service f9aed3
          CONFIGURATIONS RelWithDebInfo Debug)
Packit Service f9aed3
ENDIF()