-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
executable file
·53 lines (41 loc) · 1.39 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
46
47
48
49
50
51
52
53
cmake_minimum_required(VERSION 3.5)
project(httq LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${Qt_VERSION_MAJOR} COMPONENTS Core Network WebSockets REQUIRED)
set(src
include/httq/AbstractServer.h
include/httq/AbstractHandler.h
include/httq/AbstractBodyHandler.h
include/httq/BodyReader.h
include/httq/DataStream.h
include/httq/HandlerServer.h
include/httq/HttpRequest.h
include/httq/Logger.h
AbstractServer.cpp
AbstractHandler.cpp
AbstractBodyHandler.cpp
BodyReader.cpp
DataStream.cpp
HandlerServer.cpp
HttpRequest.cpp
Logger.cpp
)
add_library(httq SHARED ${src})
# testing! - for brew installed packages under macOS
include_directories("/opt/homebrew/include/")
link_directories("/opt/homebrew/lib/")
#include_directories("/usr/local/include/")
#link_directories("/usr/local/lib/")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/
DESTINATION include
FILES_MATCHING PATTERN "*.h")
target_include_directories(httq PRIVATE include/)
include(GNUInstallDirs)
install(TARGETS httq
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
target_link_libraries(httq http_parser Qt${Qt_VERSION_MAJOR}::Core Qt${Qt_VERSION_MAJOR}::Network Qt${Qt_VERSION_MAJOR}::WebSockets)