forked from SWI-Prolog/packages-http
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
136 lines (118 loc) · 4.01 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
cmake_minimum_required(VERSION 3.5)
project(swipl-http)
include("../cmake/PrologPackage.cmake")
if(NOT DEFINED JQUERYDIR)
message("-- Searching for jQuery")
if(NOT CMAKE_CROSSCOMPILING)
set(JQUERYFILE jquery.min.js)
find_path(JQUERYDIR
${JQUERYFILE}
PATHS /usr/share/javascript/jquery
NO_DEFAULT_PATH)
endif()
if(JQUERYDIR AND EXISTS ${JQUERYDIR}/${JQUERYFILE})
message("-- Using system jQuery from ${JQUERYDIR}/${JQUERYFILE}")
else()
message("-- No system jquery.js; using our own")
set(JQUERYDIR web/js)
set(JQUERYFILE jquery-1.11.3.min.js)
endif()
set(JQUERYDIR ${JQUERYDIR} CACHE INTERNAL "Directory for jquery.js")
set(JQUERYFILE ${JQUERYFILE} CACHE INTERNAL "File for jquery.js")
endif()
configure_file(config.h.cmake config.h)
configure_file(jquery.pl.in jquery.pl)
set(HTTP_PLATFORM_FILES)
if(UNIX)
set(HTTP_PLATFORM_FILES http_unix_daemon.pl)
endif()
set(HTTP_PL_FILES
html_write.pl http_client.pl http_header.pl
http_sgml_plugin.pl mimepack.pl mimetype.pl dcg_basics.pl
thread_httpd.pl http_wrapper.pl http_server.pl http_dyn_workers.pl
http_open.pl http_proxy.pl http_session.pl http_error.pl
http_parameters.pl http_dispatch.pl http_authenticate.pl http_log.pl
http_path.pl http_hook.pl html_head.pl http_exception.pl
http_dirindex.pl http_server_files.pl http_pwp.pl http_host.pl
http_openid.pl js_write.pl js_grammar.pl http_cookie.pl http_files.pl
http_cors.pl yadis.pl ax.pl html_quasiquotations.pl
http_load.pl http_multipart_plugin.pl http_digest.pl README.md
${HTTP_PLATFORM_FILES})
set(HTTP_EXAMPLE_FILES
README.md
demo_body.pl demo_client.pl demo_threads.pl
calc.pl demo_files.pl demo_pwp.pl demo_openid.pl
demo_daemon.pl upstart-script.conf systemd-script.service
linux-init-script demo_login.pl demo_rest.pl demo_hello.pl)
prepend(HTTP_EXAMPLE_FILES examples/ ${HTTP_EXAMPLE_FILES})
set(PWP_FILES
context.pwp index.pwp pwp1.pwp pwp2.pwp pwp3.pwp pwp4.pwp
pwp5.pwp pwp6.pwp pwp7.pwp pwp8.pwp pwpdb.pl)
prepend(PWP_FILES examples/pwp/ ${PWP_FILES})
set(ICONS back.png compressed.png c.png folder.png generic.png
layout.png openid-logo-square.png openid-logo-tiny.png)
prepend(ICONS web/icons/ ${ICONS})
swipl_plugin(
http_libs
PL_LIB_SUBDIR http
PL_LIBS ${HTTP_PL_FILES})
swipl_plugin(
http_stream
C_SOURCES http_stream.c THREADED
PL_LIB_SUBDIR http
PL_LIBS http_stream.pl)
swipl_plugin(
json
C_SOURCES json.c
PL_LIB_SUBDIR http
PL_LIBS json.pl json_convert.pl http_json.pl)
swipl_plugin(
websocket
C_SOURCES websocket.c
PL_LIB_SUBDIR http
PL_LIBS websocket.pl hub.pl)
swipl_plugin(
http_css
PL_LIB_SUBDIR http/web/css
PL_LIBS web/css/dirindex.css web/css/openid.css)
swipl_plugin(
http_icons
PL_LIB_SUBDIR http/web/icons
PL_LIBS ${ICONS})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jquery.pl
DESTINATION ${SWIPL_INSTALL_LIBRARY}/http)
if(NOT IS_ABSOLUTE ${JQUERYDIR})
install_src(plugin_http_jquery
FILES ${JQUERYDIR}/${JQUERYFILE}
DESTINATION ${SWIPL_INSTALL_LIBRARY}/http/web/js)
endif()
add_custom_target(http)
add_dependencies(http http_libs http_stream json websocket http_css http_icons)
swipl_examples(${HTTP_EXAMPLE_FILES})
swipl_examples(${PWP_FILES}
SUBDIR pwp)
test_libs(cgi_stream http json multipart proxy websocket
PACKAGES clib sgml plunit ssl zlib
PARENT_LIB)
if(INSTALL_TESTS)
install(FILES examples/demo_body.pl
DESTINATION ${INSTALL_TESTS_DIR}/packages/http/examples)
endif()
pkg_doc(http
LIBSUBDIR
http
SOURCES
json.md
SOURCE post.md --lib=http/html_write
SECTION
websocket.pl hub.pl
SUBSECTION
http_log.pl http_path.pl html_head.pl http_session.pl
http_dispatch.pl http_dirindex.pl http_pwp.pl
http_open.pl http_host.pl http_openid.pl js_write.pl
http_files.pl http_cors.pl mimepack.pl
http_authenticate.pl http_client.pl
http_header.pl http_digest.pl http_dyn_workers.pl
SUBSUBSECTION
${HTTP_PLATFORM_FILES}
DEPENDS ssl)