cmake_minimum_required (VERSION 3.0)

project(libcivetweb-cpp)

set (CMAKE_MODULE_PATH "${MODULE_PATH}")
set (CMAKE_CXX_STANDARD 11)

include (br)

include_directories($ENV{SRC_DIR}/src/3P/civetweb/include)

file(
	GLOB
	source_files
	$ENV{SRC_DIR}/src/3P/civetweb/src/civetweb.c
	$ENV{SRC_DIR}/src/3P/civetweb/src/CivetServer.cpp
)

set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Werror=strict-aliasing")

add_library(civetweb-cpp SHARED ${source_files})

target_link_libraries (civetweb-cpp 
	LINK_PUBLIC
	pthread
	m
	)

install (TARGETS civetweb-cpp LIBRARY DESTINATION local/lib)

file (GLOB headers $ENV{SRC_DIR}/src/3P/civetweb/include/*.h)
install (FILES ${headers} DESTINATION include/civetweb)
