-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
45 lines (35 loc) · 1.28 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cmake_minimum_required(VERSION 3.14)
project(httpserver VERSION 1.4.2)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{CXXFLAGS} $ENV{CPPFLAGS}")
set(CMAKE_CXX_STANDARD 14) # -std=c++14
option(BUILD_EXAMPLE "Build example code" OFF)
include(deps.cmake)
#add_compile_definitions(BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED=1)
find_package(Boost COMPONENTS system thread regex)
find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
include_directories(./ ${OPENSSL_INCLUDE_DIRS})
file(GLOB CPP_FILES httpserver/*/*.cpp httpserver/*.cpp)
file(GLOB HPP_FILES httpserver/*/*.h httpserver/*.h)
add_library(${PROJECT_NAME} STATIC ${CPP_FILES} ${HPP_FILES})
target_include_directories(${PROJECT_NAME} PUBLIC ./)
target_link_libraries(${PROJECT_NAME}
${Boost_LIBRARIES}
OpenSSL::SSL
OpenSSL::Crypto
d3util
pthread
ZLIB::ZLIB
)
#include(jsoncpp.cmake)
#target_include_directories(${PROJECT_NAME} PUBLIC ${JSONCPP_INCLUDE})
if(BUILD_EXAMPLE)
add_subdirectory(exemplo)
endif()
if( CMAKE_COMPILER_IS_MINGW )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -Wa,-mbig-obj")
elseif( MSVC )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif()
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
install(FILES ${HPP_FILES} DESTINATION include/${PROJECT_NAME})