CMakeLists.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. #
  2. # Copyright (c) 2008-2020 the Urho3D project.
  3. #
  4. # Permission is hereby granted, free of charge, to any person obtaining a copy
  5. # of this software and associated documentation files (the "Software"), to deal
  6. # in the Software without restriction, including without limitation the rights
  7. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. # copies of the Software, and to permit persons to whom the Software is
  9. # furnished to do so, subject to the following conditions:
  10. #
  11. # The above copyright notice and this permission notice shall be included in
  12. # all copies or substantial portions of the Software.
  13. #
  14. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. # THE SOFTWARE.
  21. #
  22. # Define target name
  23. set (TARGET_NAME libwebsockets)
  24. ########
  25. set(LWS_WITH_BUNDLED_ZLIB_DEFAULT OFF)
  26. if (WIN32)
  27. set(LWS_WITH_BUNDLED_ZLIB_DEFAULT ON)
  28. endif ()
  29. set(LWS_ROLE_RAW 1)
  30. set(LWS_WITH_POLL 1)
  31. if (ESP_PLATFORM)
  32. set(LWS_ESP_PLATFORM 1)
  33. set(CMAKE_TOOLCHAIN_FILE contrib/cross-esp32.cmake)
  34. set(LWIP_PROVIDE_ERRNO 1)
  35. endif ()
  36. #
  37. # Select features recommended for PC distro packaging
  38. #
  39. option(LWS_WITH_DISTRO_RECOMMENDED "Enable features recommended for distro packaging" OFF)
  40. option(LWS_FOR_GITOHASHI "Enable features recommended for use with gitohashi" OFF)
  41. #
  42. # Compiler features
  43. #
  44. option(DISABLE_WERROR "Avoid treating compiler warnings as fatal errors" OFF)
  45. #
  46. # Major individual features
  47. #
  48. option(LWS_WITH_CLIENT "Compile with network-related code" ON)
  49. option(LWS_WITH_NETWORK "Compile with network-related code" ON)
  50. option(LWS_ROLE_H1 "Compile with support for http/1 (needed for ws)" ON)
  51. option(LWS_ROLE_WS "Compile with support for websockets" ON)
  52. option(LWS_ROLE_MQTT "Build with support for MQTT client" OFF)
  53. option(LWS_ROLE_DBUS "Compile with support for DBUS" OFF)
  54. option(LWS_ROLE_RAW_PROXY "Raw packet proxy" OFF)
  55. option(LWS_ROLE_RAW_FILE "Compile with support for raw files" OFF)
  56. option(LWS_WITH_HTTP2 "Compile with server support for HTTP/2" OFF)
  57. option(LWS_WITH_LWSWS "Libwebsockets Webserver" OFF)
  58. option(LWS_WITH_CGI "Include CGI (spawn process with network-connected stdin/out/err) APIs" OFF)
  59. option(LWS_IPV6 "Compile with support for ipv6" OFF)
  60. option(LWS_UNIX_SOCK "Compile with support for UNIX domain socket if OS supports it" ON)
  61. option(LWS_WITH_PLUGINS "Support plugins for protocols and extensions (implies LWS_WITH_PLUGINS_API)" OFF)
  62. option(LWS_WITH_HTTP_PROXY "Support for active HTTP proxying" OFF)
  63. option(LWS_WITH_ZIP_FOPS "Support serving pre-zipped files" OFF)
  64. option(LWS_WITH_SOCKS5 "Allow use of SOCKS5 proxy on client connections" OFF)
  65. option(LWS_WITH_PEER_LIMITS "Track peers and restrict resources a single peer can allocate" OFF)
  66. option(LWS_WITH_ACCESS_LOG "Support generating Apache-compatible access logs" OFF)
  67. option(LWS_WITH_RANGES "Support http ranges (RFC7233)" OFF)
  68. option(LWS_WITH_SERVER_STATUS "Support json + jscript server monitoring" OFF)
  69. option(LWS_WITH_SERVER "Support json + jscript server monitoring" ON)
  70. option(LWS_WITH_THREADPOOL "Managed worker thread pool support (relies on pthreads)" OFF)
  71. option(LWS_WITH_HTTP_STREAM_COMPRESSION "Support HTTP stream compression" OFF)
  72. option(LWS_WITH_HTTP_BROTLI "Also offer brotli http stream compression (requires LWS_WITH_HTTP_STREAM_COMPRESSION)" OFF)
  73. option(LWS_WITH_ACME "Enable support for ACME automatic cert acquisition + maintenance (letsencrypt etc)" OFF)
  74. option(LWS_WITH_HUBBUB "Enable libhubbub rewriting support" OFF)
  75. option(LWS_WITH_ALSA "Enable alsa audio example" OFF)
  76. option(LWS_WITH_GTK "Enable gtk example" OFF)
  77. option(LWS_WITH_FTS "Full Text Search support" OFF)
  78. option(LWS_WITH_SYS_ASYNC_DNS "Nonblocking internal IPv4 + IPv6 DNS resolver" OFF)
  79. option(LWS_WITH_SYS_NTPCLIENT "Build in tiny ntpclient good for tls date validation and run via lws_system" OFF)
  80. option(LWS_WITH_SYS_DHCP_CLIENT "Build in tiny DHCP client" OFF)
  81. option(LWS_WITH_HTTP_BASIC_AUTH "Support Basic Auth" OFF)
  82. option(LWS_WITH_HTTP_UNCOMMON_HEADERS "Include less common http header support" ON)
  83. option(LWS_WITH_SYS_STATE "lws_system state support" ON)
  84. option(LWS_WITH_SYS_SMD "Lws System Message Distribution" ON)
  85. #
  86. # Secure Streams
  87. #
  88. option(LWS_WITH_SECURE_STREAMS "Secure Streams protocol-agnostic API" OFF)
  89. option(LWS_WITH_SECURE_STREAMS_PROXY_API "Secure Streams support to work across processes" OFF)
  90. option(LWS_WITH_SECURE_STREAMS_SYS_AUTH_API_AMAZON_COM "Auth support for api.amazon.com" OFF)
  91. option(LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY "Secure Streams Policy is hardcoded only" OFF)
  92. #
  93. # CTest options
  94. #
  95. #
  96. # If you build with LWS_WITH_MINIMAL_EXAMPLES, you can use CTest / make test to run
  97. # examples that can give a pass/fail response. By default it runs tests both against
  98. # a local server peer and warmcat.com, if your CI wants to do the tests but does not
  99. # have internet routing, then you can still run a subset of tests with CTest / make
  100. # test that only does local tests by disabling this option.
  101. #
  102. option(LWS_CTEST_INTERNET_AVAILABLE "CTest will performs tests that need the Internet" ON)
  103. #
  104. # TLS library options... all except mbedTLS are basically OpenSSL variants.
  105. #
  106. option(LWS_WITH_SSL "Include SSL support (defaults to OpenSSL or similar, mbedTLS if LWS_WITH_MBEDTLS is set)" OFF)
  107. option(LWS_WITH_MBEDTLS "Use mbedTLS (>=2.0) replacement for OpenSSL. When setting this, you also may need to specify LWS_MBEDTLS_LIBRARIES and LWS_MBEDTLS_INCLUDE_DIRS" OFF)
  108. option(LWS_WITH_BORINGSSL "Use BoringSSL replacement for OpenSSL" OFF)
  109. option(LWS_WITH_CYASSL "Use CyaSSL replacement for OpenSSL. When setting this, you also need to specify LWS_CYASSL_LIBRARIES and LWS_CYASSL_INCLUDE_DIRS" OFF)
  110. option(LWS_WITH_WOLFSSL "Use wolfSSL replacement for OpenSSL. When setting this, you also need to specify LWS_WOLFSSL_LIBRARIES and LWS_WOLFSSL_INCLUDE_DIRS" OFF)
  111. option(LWS_SSL_CLIENT_USE_OS_CA_CERTS "SSL support should make use of the OS-installed CA root certs" OFF)
  112. #
  113. # Event library options (may select multiple, or none for default poll()
  114. #
  115. option(LWS_WITH_LIBEV "Compile with support for libev" OFF)
  116. option(LWS_WITH_LIBUV "Compile with support for libuv" OFF)
  117. option(LWS_WITH_LIBEVENT "Compile with support for libevent" OFF)
  118. option(LWS_WITH_GLIB "Compile with support for glib event loop" OFF)
  119. if (UNIX)
  120. # since v4.1, on unix platforms default is build any event libs as runtime plugins
  121. option(LWS_WITH_EVLIB_PLUGINS "Compile event lib support into runtime-selected plugins" ON)
  122. else ()
  123. # otherwise default to linking the event lib(s) to libwebsockets.so
  124. option(LWS_WITH_EVLIB_PLUGINS "Compile event lib support into runtime-selected plugins" OFF)
  125. endif ()
  126. #
  127. # LWS Drivers
  128. #
  129. option(LWS_WITH_DRIVERS "With generic drivers for gpio, i2c, display etc" OFF)
  130. #
  131. # Static / Dynamic build options
  132. #
  133. option(LWS_WITH_STATIC "Build the static version of the library" ON)
  134. option(LWS_WITH_SHARED "Build the shared version of the library" OFF)
  135. option(LWS_LINK_TESTAPPS_DYNAMIC "Link the test apps to the shared version of the library. Default is to link statically" OFF)
  136. option(LWS_STATIC_PIC "Build the static version of the library with position-independent code" OFF)
  137. #
  138. # Specific platforms
  139. #
  140. option(LWS_WITH_ESP32 "Build for ESP32" OFF)
  141. option(LWS_PLAT_OPTEE "Build for OPTEE" OFF)
  142. option(LWS_PLAT_FREERTOS "Build for FreeRTOS" OFF)
  143. option(LWS_PLAT_ANDROID "Android flavour of unix platform" OFF)
  144. #
  145. # Client / Server / Test Apps build control
  146. #
  147. option(LWS_WITHOUT_CLIENT "Don't build the client part of the library" OFF)
  148. option(LWS_WITHOUT_SERVER "Don't build the server part of the library" OFF)
  149. option(LWS_WITHOUT_TESTAPPS "Don't build the libwebsocket-test-apps" ON)
  150. option(LWS_WITHOUT_TEST_SERVER "Don't build the test server" ON)
  151. option(LWS_WITHOUT_TEST_SERVER_EXTPOLL "Don't build the test server version that uses external poll" ON)
  152. option(LWS_WITHOUT_TEST_PING "Don't build the ping test application" ON)
  153. option(LWS_WITHOUT_TEST_CLIENT "Don't build the client test application" ON)
  154. #
  155. # Extensions (permessage-deflate)
  156. #
  157. option(LWS_WITHOUT_EXTENSIONS "Don't compile with extensions" ON)
  158. #
  159. # Helpers + misc
  160. #
  161. option(LWS_WITHOUT_BUILTIN_GETIFADDRS "Don't use the BSD getifaddrs implementation from libwebsockets if it is missing (this will result in a compilation error) ... The default is to assume that your libc provides it. On some systems such as uclibc it doesn't exist." OFF)
  162. option(LWS_FALLBACK_GETHOSTBYNAME "Also try to do dns resolution using gethostbyname if getaddrinfo fails" OFF)
  163. option(LWS_WITHOUT_BUILTIN_SHA1 "Don't build the lws sha-1 (eg, because openssl will provide it" OFF)
  164. option(LWS_WITHOUT_DAEMONIZE "Don't build the daemonization api" ON)
  165. option(LWS_SSL_SERVER_WITH_ECDH_CERT "Include SSL server use ECDH certificate" OFF)
  166. option(LWS_WITH_LEJP "With the Lightweight JSON Parser" ON)
  167. option(LWS_WITH_SQLITE3 "Require SQLITE3 support" OFF)
  168. option(LWS_WITH_STRUCT_JSON "Generic struct serialization to and from JSON" OFF)
  169. option(LWS_WITH_STRUCT_SQLITE3 "Generic struct serialization to and from SQLITE3" OFF)
  170. # broken atm
  171. #option(LWS_WITH_SMTP "Provide SMTP support" OFF)
  172. if (LWS_WITH_ESP32)
  173. option(LWS_WITH_DIR "Directory scanning api support" OFF)
  174. option(LWS_WITH_LEJP_CONF "With LEJP configuration parser as used by lwsws" OFF)
  175. else()
  176. option(LWS_WITH_DIR "Directory scanning api support" ON)
  177. option(LWS_WITH_LEJP_CONF "With LEJP configuration parser as used by lwsws" ON)
  178. endif()
  179. option(LWS_WITH_NO_LOGS "Disable all logging other than _err and _user from being compiled in" OFF)
  180. set(LWS_LOGGING_BITFIELD_SET 0 CACHE STRING "Bitfield describing which log levels to force included into the build")
  181. set(LWS_LOGGING_BITFIELD_CLEAR 0 CACHE STRING "Bitfield describing which log levels to force removed from the build")
  182. option(LWS_LOGS_TIMESTAMP "Timestamp at start of logs" ON)
  183. option(LWS_AVOID_SIGPIPE_IGN "Android 7+ reportedly needs this" OFF)
  184. option(LWS_WITH_STATS "Keep statistics of lws internal operations" OFF)
  185. option(LWS_WITH_JOSE "JSON Web Signature / Encryption / Keys (RFC7515/6/) API" OFF)
  186. option(LWS_WITH_GENCRYPTO "Enable support for Generic Crypto apis independent of TLS backend" OFF)
  187. option(LWS_WITH_SELFTESTS "Selftests run at context creation" OFF)
  188. option(LWS_WITH_GCOV "Build with gcc gcov coverage instrumentation" OFF)
  189. option(LWS_WITH_EXPORT_LWSTARGETS "Export libwebsockets CMake targets. Disable if they conflict with an outer cmake project." ON)
  190. option(LWS_REPRODUCIBLE "Build libwebsockets reproducible. It removes the build user and hostname from the build" ON)
  191. option(LWS_WITH_MINIMAL_EXAMPLES "Also build the normally standalone minimal examples, for QA" OFF)
  192. option(LWS_WITH_LWSAC "lwsac Chunk Allocation api" ON)
  193. option(LWS_WITH_CUSTOM_HEADERS "Store and allow querying custom HTTP headers (H1 only)" ON)
  194. option(LWS_WITH_DISKCACHE "Hashed cache directory with lazy LRU deletion to size limit" OFF)
  195. option(LWS_WITH_ASAN "Build with gcc runtime sanitizer options enabled (needs libasan)" OFF)
  196. option(LWS_WITH_LEJP_CONF "With LEJP configuration parser as used by lwsws" OFF)
  197. option(LWS_WITH_ZLIB "Include zlib support (required for extensions)" OFF)
  198. option(LWS_WITH_BUNDLED_ZLIB "Use bundled zlib version (Windows only)" ${LWS_WITH_BUNDLED_ZLIB_DEFAULT})
  199. option(LWS_WITH_MINIZ "Use miniz instead of zlib" OFF)
  200. option(LWS_WITH_DEPRECATED_THINGS "Temporary workaround for deprecated apis" OFF)
  201. option(LWS_WITH_SEQUENCER "lws_seq_t support" ON)
  202. option(LWS_WITH_EXTERNAL_POLL "Support external POLL integration using callback messages (not recommended)" OFF)
  203. option(LWS_WITH_LWS_DSH "Support lws_dsh_t Disordered Shared Heap" OFF)
  204. option(LWS_CLIENT_HTTP_PROXYING "Support external http proxies for client connections" ON)
  205. option(LWS_WITH_FILE_OPS "Support file operations vfs" ON)
  206. option(LWS_WITH_DETAILED_LATENCY "Record detailed latency stats for each read and write" OFF)
  207. option(LWS_WITH_UDP "Platform supports UDP" ON)
  208. option(LWS_WITH_SPAWN "Spawn subprocesses with piped stdin/out/stderr" OFF)
  209. option(LWS_WITH_FSMOUNT "Overlayfs and fallback mounting apis" OFF)
  210. option(LWS_WITH_FANALYZER "Enable gcc -fanalyzer if compiler supports" OFF)
  211. option(LWS_HTTP_HEADERS_ALL "Override header reduction optimization and include all like older lws versions" OFF)
  212. option(LWS_WITH_SUL_DEBUGGING "Enable zombie lws_sul checking on object deletion" OFF)
  213. option(LWS_WITH_PLUGINS_API "Build generic lws_plugins apis (see LWS_WITH_PLUGINS to also build protocol plugins)" OFF)
  214. #
  215. # to use miniz, enable both LWS_WITH_ZLIB and LWS_WITH_MINIZ
  216. #
  217. # End of user settings
  218. #
  219. # sets of sub-options implied by other options
  220. #
  221. set(LIB_LIST "")
  222. set(LIB_LIST_AT_END)
  223. set(LWS_LIBRARIES)
  224. set(LWS_LIBRARY_VERSION "4.1.3")
  225. set(LWS_LIBRARY_VERSION_MAJOR 4)
  226. set(LWS_LIBRARY_VERSION_MINOR 1)
  227. set(LWS_LIBRARY_VERSION_PATCH 3)
  228. CHECK_FUNCTION_EXISTS(fork LWS_HAVE_FORK)
  229. CHECK_FUNCTION_EXISTS(getenv LWS_HAVE_GETENV)
  230. CHECK_FUNCTION_EXISTS(malloc LWS_HAVE_MALLOC)
  231. CHECK_FUNCTION_EXISTS(memset LWS_HAVE_MEMSET)
  232. CHECK_FUNCTION_EXISTS(realloc LWS_HAVE_REALLOC)
  233. CHECK_FUNCTION_EXISTS(socket LWS_HAVE_SOCKET)
  234. CHECK_FUNCTION_EXISTS(strerror LWS_HAVE_STRERROR)
  235. CHECK_FUNCTION_EXISTS(vfork LWS_HAVE_VFORK)
  236. CHECK_FUNCTION_EXISTS(execvpe LWS_HAVE_EXECVPE)
  237. CHECK_FUNCTION_EXISTS(getifaddrs LWS_HAVE_GETIFADDRS)
  238. CHECK_FUNCTION_EXISTS(snprintf LWS_HAVE_SNPRINTF)
  239. CHECK_FUNCTION_EXISTS(_snprintf LWS_HAVE__SNPRINTF)
  240. CHECK_FUNCTION_EXISTS(_vsnprintf LWS_HAVE__VSNPRINTF)
  241. CHECK_FUNCTION_EXISTS(getloadavg LWS_HAVE_GETLOADAVG)
  242. CHECK_FUNCTION_EXISTS(atoll LWS_HAVE_ATOLL)
  243. CHECK_FUNCTION_EXISTS(_atoi64 LWS_HAVE__ATOI64)
  244. CHECK_FUNCTION_EXISTS(_stat32i64 LWS_HAVE__STAT32I64)
  245. CHECK_FUNCTION_EXISTS(clock_gettime LWS_HAVE_CLOCK_GETTIME)
  246. # Modfied for Urho3D to allow building libwebsockets with SSL support
  247. if (URHO3D_SSL)
  248. message(STATUS "Adding SSL support for libwebsockets")
  249. set(LWS_OPENSSL_SUPPORT ON)
  250. set(LWS_WITH_SSL ON)
  251. set(LWS_WITH_TLS ON)
  252. else ()
  253. set(LWS_OPENSSL_SUPPORT OFF)
  254. set(LWS_WITH_SSL OFF)
  255. set(LWS_WITH_TLS OFF)
  256. endif ()
  257. include(CMakeLists-implied-options.txt)
  258. macro(exports_to_parent_scope)
  259. foreach(file ${SOURCES})
  260. list(APPEND SOURCE_FILES "lib/${file}")
  261. endforeach(file)
  262. set(SOURCE_FILES ${SOURCE_FILES} PARENT_SCOPE)
  263. if (LIB_LIST)
  264. set(LIB_LIST ${LIB_LIST} PARENT_SCOPE)
  265. endif()
  266. get_property(_CURR DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
  267. set(_CMAKE_INC_LIST ${_CURR} PARENT_SCOPE)
  268. if (LWS_LIB_BUILD_INC_PATHS)
  269. set(LWS_LIB_BUILD_INC_PATHS ${LWS_LIB_BUILD_INC_PATHS} PARENT_SCOPE)
  270. endif()
  271. endmacro()
  272. macro(export_to_parent_intermediate)
  273. foreach(file ${SOURCES})
  274. list(APPEND SOURCE_FILES "lib/${file}")
  275. endforeach(file)
  276. set(SOURCE_FILES ${SOURCE_FILES} PARENT_SCOPE)
  277. if (LIB_LIST)
  278. set(LIB_LIST ${LIB_LIST} PARENT_SCOPE)
  279. endif()
  280. set(_CMAKE_INC_LIST ${_CMAKE_INC_LIST} PARENT_SCOPE)
  281. if (LWS_LIB_BUILD_INC_PATHS)
  282. set(LWS_LIB_BUILD_INC_PATHS ${LWS_LIB_BUILD_INC_PATHS} PARENT_SCOPE)
  283. endif()
  284. endmacro()
  285. macro(add_subdir_include_directories arg1)
  286. add_subdirectory(${arg1})
  287. # include_directories(${_CMAKE_INC_LIST})
  288. # list(APPEND INCLUDE_DIRECTORIES ${_CMAKE_INC_LIST})
  289. list(APPEND INCLUDE_DIRS lib/${arg1} lib/system/${arg1} lib/roles/${arg1})
  290. set(INCLUDE_DIRS ${INCLUDE_DIRS} PARENT_SCOPE)
  291. endmacro()
  292. macro(add_subdir_include_dirs arg1)
  293. add_subdirectory(${arg1})
  294. list(APPEND INCLUDE_DIRS lib/${arg1} lib/system/${arg1} lib/role/${arg1})
  295. set(INCLUDE_DIRS ${INCLUDE_DIRS} PARENT_SCOPE)
  296. # list(APPEND LWS_LIB_BUILD_INC_PATHS ${_CMAKE_INC_LIST})
  297. # list(APPEND INCLUDE_DIRECTORIES ${_CMAKE_INC_LIST})
  298. endmacro()
  299. ########
  300. if (NOT WIN32)
  301. include(cmake/LwsCheckRequirements.cmake)
  302. require_pthreads(requirements)
  303. endif ()
  304. # Define source files
  305. add_subdirectory(lib)
  306. #define_source_files (RECURSE GLOB_CPP_PATTERNS lib/*.c GLOB_H_PATTERNS src/*.h)
  307. # Generate libwebsockets configuration file with defined macros
  308. configure_file(
  309. ${CMAKE_CURRENT_SOURCE_DIR}/cmake/lws_config.h.in
  310. "${CMAKE_CURRENT_SOURCE_DIR}/include/lws_config.h")
  311. configure_file(
  312. ${CMAKE_CURRENT_SOURCE_DIR}/cmake/lws_config_private.h.in
  313. "${CMAKE_CURRENT_SOURCE_DIR}/include/lws_config_private.h")
  314. #add_custom_command(
  315. # OUTPUT include/lws_config.h
  316. # ${CMAKE_SOURCE_DIR}/include/libwebsockets
  317. # ${CMAKE_SOURCE_DIR}/include/libwebsockets.h
  318. # COMMENT "Creating build include dir"
  319. # COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets.h
  320. # ${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets.h
  321. # COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets/
  322. # ${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets
  323. # COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/lws_config.h
  324. # ${CMAKE_CURRENT_BINARY_DIR}/include/lws_config.h
  325. # MAIN_DEPENDENCY ${PROJECT_BINARY_DIR}/lws_config.h
  326. #)
  327. list (APPEND INCLUDE_DIRS include)
  328. message (STATUS SOURCEFILES "${SOURCE_FILESs} - ${INCLUDE_DIRS}")
  329. # Setup target
  330. setup_library ()
  331. # Install headers for building the Urho3D library
  332. install_header_files (DIRECTORY include/ DESTINATION ${DEST_INCLUDE_DIR}/ThirdParty/libwebsockets FILES_MATCHING PATTERN *.h BUILD_TREE_ONLY) # Note: the trailing slash is significant