@@ -19,6 +19,11 @@ if(RT_LIBRARY)
19
19
set (RT_LIBRARIES ${RT_LIBRARY} )
20
20
endif ()
21
21
22
+ if (builtin_civetweb)
23
+ set (_civetweb_src civetweb/civetweb.c)
24
+ set (_civetweb_libs ${RT_LIBRARIES} )
25
+ endif ()
26
+
22
27
ROOT_STANDARD_LIBRARY_PACKAGE(RHTTP
23
28
HEADERS
24
29
THttpCallArg.h
@@ -42,62 +47,69 @@ ROOT_STANDARD_LIBRARY_PACKAGE(RHTTP
42
47
src/THttpWSHandler.cxx
43
48
src/TRootSniffer.cxx
44
49
src/TRootSnifferStore.cxx
45
- civetweb/civetweb.c
50
+ ${_civetweb_src}
46
51
LIBRARIES
47
52
ZLIB::ZLIB
48
- ${RT_LIBRARIES }
53
+ ${_civetweb_libs }
49
54
${FASTCGI_LIBRARY}
50
55
${CMAKE_DL_LIBS}
51
56
DEPENDENCIES
52
57
RIO
53
58
Thread
54
59
)
55
60
56
- if (ssl)
57
- target_include_directories (RHTTP SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR} )
58
- endif ()
61
+ if (builtin_civetweb)
62
+ target_include_directories (RHTTP PRIVATE civetweb)
59
63
60
- if (FASTCGI_FOUND )
61
- target_include_directories (RHTTP PRIVATE ${FASTCGI_INCLUDE_DIR } )
62
- endif ()
64
+ if (ssl )
65
+ target_include_directories (RHTTP SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR } )
66
+ endif ()
63
67
64
- target_compile_definitions (RHTTP PRIVATE -DUSE_WEBSOCKET)
68
+ target_compile_definitions (RHTTP PRIVATE -DUSE_WEBSOCKET)
65
69
66
- if (NOT MSVC )
67
- target_compile_definitions (RHTTP PRIVATE -DUSE_X_DOM_SOCKET)
68
- endif ()
70
+ if (NOT MSVC )
71
+ target_compile_definitions (RHTTP PRIVATE -DUSE_X_DOM_SOCKET)
72
+ endif ()
69
73
70
- if (ssl)
71
- if (OPENSSL_VERSION)
72
- string (REPLACE "." ";" lst ${OPENSSL_VERSION} )
73
- list (GET lst 0 ssl_major)
74
- list (GET lst 1 ssl_minor)
75
- endif ()
74
+ if (ssl)
75
+ if (OPENSSL_VERSION)
76
+ string (REPLACE "." ";" lst ${OPENSSL_VERSION} )
77
+ list (GET lst 0 ssl_major)
78
+ list (GET lst 1 ssl_minor)
79
+ endif ()
76
80
77
- if ((${ssl_major} EQUAL "1" ) AND (${ssl_minor} EQUAL "1" ))
78
- MESSAGE (STATUS "Use SSL API VERSION 1.1 for civetweb" )
79
- target_compile_definitions (RHTTP PUBLIC -DOPENSSL_API_1_1)
80
- set (link_ssl ON )
81
- elseif ((${ssl_major} EQUAL "3" ) AND ((${ssl_minor} EQUAL "0" ) OR (${ssl_minor} EQUAL "1" )))
82
- MESSAGE (STATUS "Use SSL API VERSION 3.${ssl_minor} for civetweb" )
83
- target_compile_definitions (RHTTP PUBLIC -DOPENSSL_API_3_0)
84
- set (link_ssl ON )
85
- elseif ((${ssl_major} EQUAL "1" ) AND (${ssl_minor} EQUAL "0" ))
86
- MESSAGE (STATUS "Use SSL API VERSION 1.0 for civetweb" )
87
- target_compile_definitions (RHTTP PUBLIC -DOPENSSL_API_1_0)
88
- set (link_ssl ON )
81
+ if ((${ssl_major} EQUAL "1" ) AND (${ssl_minor} EQUAL "1" ))
82
+ MESSAGE (STATUS "Use SSL API VERSION 1.1 for civetweb" )
83
+ target_compile_definitions (RHTTP PUBLIC -DOPENSSL_API_1_1)
84
+ set (link_ssl ON )
85
+ elseif ((${ssl_major} EQUAL "3" ) AND ((${ssl_minor} EQUAL "0" ) OR (${ssl_minor} EQUAL "1" )))
86
+ MESSAGE (STATUS "Use SSL API VERSION 3.${ssl_minor} for civetweb" )
87
+ target_compile_definitions (RHTTP PUBLIC -DOPENSSL_API_3_0)
88
+ set (link_ssl ON )
89
+ elseif ((${ssl_major} EQUAL "1" ) AND (${ssl_minor} EQUAL "0" ))
90
+ MESSAGE (STATUS "Use SSL API VERSION 1.0 for civetweb" )
91
+ target_compile_definitions (RHTTP PUBLIC -DOPENSSL_API_1_0)
92
+ set (link_ssl ON )
93
+ else ()
94
+ MESSAGE (WARNING "Not able to recognize SSL version ${OPENSSL_VERSION} , disable SSL" )
95
+ target_compile_definitions (RHTTP PUBLIC -DNO_SSL)
96
+ endif ()
97
+ if (link_ssl)
98
+ target_compile_definitions (RHTTP PUBLIC -DNO_SSL_DL)
99
+ target_link_libraries (RHTTP PRIVATE ${OPENSSL_LIBRARIES} )
100
+ endif ()
89
101
else ()
90
- MESSAGE (WARNING "Not able to recognize SSL version ${OPENSSL_VERSION} , disable SSL" )
91
102
target_compile_definitions (RHTTP PUBLIC -DNO_SSL)
92
103
endif ()
93
- if (link_ssl)
94
- target_compile_definitions (RHTTP PUBLIC -DNO_SSL_DL)
95
- target_link_libraries (RHTTP PRIVATE ${OPENSSL_LIBRARIES} )
96
- endif ()
104
+
97
105
else ()
98
- target_compile_definitions (RHTTP PUBLIC -DNO_SSL)
99
- endif ()
106
+ message (STATUS "Linking with ${civetweb_LIBRARIES} includes from ${civetweb_INCLUDE_DIR} " )
107
+ target_include_directories (RHTTP SYSTEM PRIVATE ${civetweb_INCLUDE_DIR} )
108
+ target_link_libraries (RHTTP PRIVATE ${civetweb_LIBRARIES} )
109
+ endif (builtin_civetweb)
100
110
101
- if (NOT FASTCGI_FOUND)
111
+ if (FASTCGI_FOUND)
112
+ target_include_directories (RHTTP PRIVATE ${FASTCGI_INCLUDE_DIR} )
113
+ else ()
102
114
target_compile_definitions (RHTTP PUBLIC -DHTTP_WITHOUT_FASTCGI)
103
115
endif ()
0 commit comments