summaryrefslogtreecommitdiff
path: root/libwaitress/src/CMakeLists.txt
blob: 19858159649a8a91b9146be1a5614e9889374cf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
INCLUDE (CheckFunctionExists)
INCLUDE (CheckLibraryExists)

set (CMAKE_C_FLAGS -Wall)
set (EXTRA_LIBS "")

# required on sunos
CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
	IF(NOT CMAKE_HAVE_CONNECT)
		CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
		IF (CMAKE_LIB_SOCKET_HAS_CONNECT)
			SET (EXTRA_LIBS -lsocket)
		ENDIF (CMAKE_LIB_SOCKET_HAS_CONNECT)
ENDIF(NOT CMAKE_HAVE_CONNECT)

configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
	${CMAKE_CURRENT_BINARY_DIR}/config.h)

include_directories( ${CMAKE_CURRENT_BINARY_DIR} )

add_library (waitress STATIC waitress.c)
target_link_libraries (waitress ${EXTRA_LIBS})