add cmake for civetweb.
This commit is contained in:
@@ -1,33 +1,32 @@
|
|||||||
cmake_minimum_required(VERSION 2.8.11)
|
cmake_minimum_required (VERSION 3.0)
|
||||||
|
|
||||||
include (libwolfssl)
|
project(libcivetweb-cpp)
|
||||||
include (libcivetweb)
|
|
||||||
|
|
||||||
project(libcivetweb)
|
set (CMAKE_MODULE_PATH "${MODULE_PATH}")
|
||||||
|
set (CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DUSE_YASSL -DNO_SSL_DL)
|
include (br)
|
||||||
|
|
||||||
|
include_directories($ENV{SRC_DIR}/src/3P/civetweb/include)
|
||||||
|
|
||||||
file(
|
file(
|
||||||
GLOB
|
GLOB
|
||||||
source_files
|
source_files
|
||||||
../../src/civetweb.c
|
$ENV{SRC_DIR}/src/3P/civetweb/src/civetweb.c
|
||||||
../../src/CivetServer.cpp
|
$ENV{SRC_DIR}/src/3P/civetweb/src/CivetServer.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Werror=strict-aliasing")
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "-W -Wall -O2 -Iinclude")
|
add_library(civetweb-cpp SHARED ${source_files})
|
||||||
|
|
||||||
add_library(
|
target_link_libraries (civetweb-cpp
|
||||||
civetweb
|
|
||||||
SHARED
|
|
||||||
${source_files}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries (civetweb
|
|
||||||
LINK_PUBLIC
|
LINK_PUBLIC
|
||||||
wolfssl
|
|
||||||
pthread
|
pthread
|
||||||
m
|
m
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories (civetweb PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user