1
0
forked from blue/pica
pica/cmake/FindFCGI.cmake

32 lines
1014 B
CMake

#SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
#SPDX-License-Identifier: GPL-3.0-or-later
find_library(FCGI_LIBRARIES fcgi NAMES FCGI libfcgi)
find_library(FCGI++_LIBRARIES fcgi++ NAMES FCGI++ libfcgi++)
if (FCGI_LIBRARIES AND FCGI++_LIBRARIES)
set(FCGI_FOUND TRUE)
endif()
if (FCGI_FOUND)
add_library(FCGI::FCGI SHARED IMPORTED)
set_target_properties(FCGI::FCGI PROPERTIES
IMPORTED_LOCATION "${FCGI_LIBRARIES}"
INTERFACE_LINK_LIBRARIES "${FCGI_LIBRARIES}"
)
add_library(FCGI::FCGI++ SHARED IMPORTED)
set_target_properties(FCGI::FCGI++ PROPERTIES
IMPORTED_LOCATION "${FCGI++_LIBRARIES}"
INTERFACE_LINK_LIBRARIES "${FCGI++_LIBRARIES}"
)
if (NOT FCGI_FIND_QUIETLY)
message(STATUS "Found FCGI library: ${FCGI_LIBRARIES}")
message(STATUS "Found FCGI++ library: ${FCGI++_LIBRARIES}")
endif ()
else ()
if (FCGI_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find FCGI development files")
endif ()
endif ()