CMakeLists.txt 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. #######################################################################################################
  2. ## oatpp
  3. add_library(oatpp
  4. oatpp/algorithm/CRC.cpp
  5. oatpp/algorithm/CRC.hpp
  6. oatpp/codegen/ApiClient_define.hpp
  7. oatpp/codegen/ApiClient_undef.hpp
  8. oatpp/codegen/api_controller/base_define.hpp
  9. oatpp/codegen/api_controller/base_undef.hpp
  10. oatpp/codegen/api_controller/auth_define.hpp
  11. oatpp/codegen/api_controller/auth_undef.hpp
  12. oatpp/codegen/api_controller/bundle_define.hpp
  13. oatpp/codegen/api_controller/bundle_undef.hpp
  14. oatpp/codegen/api_controller/cors_define.hpp
  15. oatpp/codegen/api_controller/cors_undef.hpp
  16. oatpp/codegen/ApiController_define.hpp
  17. oatpp/codegen/ApiController_undef.hpp
  18. oatpp/codegen/DbClient_define.hpp
  19. oatpp/codegen/DbClient_undef.hpp
  20. oatpp/codegen/dto/base_define.hpp
  21. oatpp/codegen/dto/base_undef.hpp
  22. oatpp/codegen/dto/enum_define.hpp
  23. oatpp/codegen/dto/enum_undef.hpp
  24. oatpp/codegen/DTO_define.hpp
  25. oatpp/codegen/DTO_undef.hpp
  26. oatpp/core/Types.hpp
  27. oatpp/core/async/utils/FastQueue.hpp
  28. oatpp/core/async/Coroutine.cpp
  29. oatpp/core/async/Coroutine.hpp
  30. oatpp/core/async/CoroutineWaitList.cpp
  31. oatpp/core/async/CoroutineWaitList.hpp
  32. oatpp/core/async/Error.cpp
  33. oatpp/core/async/Error.hpp
  34. oatpp/core/async/Executor.cpp
  35. oatpp/core/async/Executor.hpp
  36. oatpp/core/async/Lock.cpp
  37. oatpp/core/async/Lock.hpp
  38. oatpp/core/async/Processor.cpp
  39. oatpp/core/async/Processor.hpp
  40. oatpp/core/async/worker/Worker.cpp
  41. oatpp/core/async/worker/Worker.hpp
  42. oatpp/core/async/worker/IOEventWorker_common.cpp
  43. oatpp/core/async/worker/IOEventWorker_kqueue.cpp
  44. oatpp/core/async/worker/IOEventWorker_epoll.cpp
  45. oatpp/core/async/worker/IOEventWorker_stub.cpp
  46. oatpp/core/async/worker/IOEventWorker.hpp
  47. oatpp/core/async/worker/IOWorker.cpp
  48. oatpp/core/async/worker/IOWorker.hpp
  49. oatpp/core/async/worker/TimerWorker.cpp
  50. oatpp/core/async/worker/TimerWorker.hpp
  51. oatpp/core/base/CommandLineArguments.cpp
  52. oatpp/core/base/CommandLineArguments.hpp
  53. oatpp/core/base/Config.hpp
  54. oatpp/core/base/Countable.cpp
  55. oatpp/core/base/Countable.hpp
  56. oatpp/core/base/Environment.cpp
  57. oatpp/core/base/Environment.hpp
  58. oatpp/core/base/ObjectHandle.hpp
  59. oatpp/core/concurrency/SpinLock.cpp
  60. oatpp/core/concurrency/SpinLock.hpp
  61. oatpp/core/concurrency/Thread.cpp
  62. oatpp/core/concurrency/Thread.hpp
  63. oatpp/core/IODefinitions.cpp
  64. oatpp/core/IODefinitions.hpp
  65. oatpp/core/data/buffer/FIFOBuffer.cpp
  66. oatpp/core/data/buffer/FIFOBuffer.hpp
  67. oatpp/core/data/buffer/IOBuffer.cpp
  68. oatpp/core/data/buffer/IOBuffer.hpp
  69. oatpp/core/data/buffer/Processor.cpp
  70. oatpp/core/data/buffer/Processor.hpp
  71. oatpp/core/data/mapping/ObjectMapper.cpp
  72. oatpp/core/data/mapping/ObjectMapper.hpp
  73. oatpp/core/data/mapping/TypeResolver.cpp
  74. oatpp/core/data/mapping/TypeResolver.hpp
  75. oatpp/core/data/mapping/type/Any.cpp
  76. oatpp/core/data/mapping/type/Any.hpp
  77. oatpp/core/data/mapping/type/Collection.hpp
  78. oatpp/core/data/mapping/type/Enum.cpp
  79. oatpp/core/data/mapping/type/Enum.hpp
  80. oatpp/core/data/mapping/type/List.cpp
  81. oatpp/core/data/mapping/type/List.hpp
  82. oatpp/core/data/mapping/type/Map.hpp
  83. oatpp/core/data/mapping/type/PairList.cpp
  84. oatpp/core/data/mapping/type/PairList.hpp
  85. oatpp/core/data/mapping/type/Object.cpp
  86. oatpp/core/data/mapping/type/Object.hpp
  87. oatpp/core/data/mapping/type/Primitive.cpp
  88. oatpp/core/data/mapping/type/Primitive.hpp
  89. oatpp/core/data/mapping/type/Type.cpp
  90. oatpp/core/data/mapping/type/Type.hpp
  91. oatpp/core/data/mapping/type/UnorderedMap.cpp
  92. oatpp/core/data/mapping/type/UnorderedMap.hpp
  93. oatpp/core/data/mapping/type/UnorderedSet.cpp
  94. oatpp/core/data/mapping/type/UnorderedSet.hpp
  95. oatpp/core/data/mapping/type/Vector.cpp
  96. oatpp/core/data/mapping/type/Vector.hpp
  97. oatpp/core/data/resource/File.cpp
  98. oatpp/core/data/resource/File.hpp
  99. oatpp/core/data/resource/InMemoryData.cpp
  100. oatpp/core/data/resource/InMemoryData.hpp
  101. oatpp/core/data/resource/Resource.hpp
  102. oatpp/core/data/resource/TemporaryFile.cpp
  103. oatpp/core/data/resource/TemporaryFile.hpp
  104. oatpp/core/data/share/LazyStringMap.hpp
  105. oatpp/core/data/share/MemoryLabel.cpp
  106. oatpp/core/data/share/MemoryLabel.hpp
  107. oatpp/core/data/share/StringTemplate.cpp
  108. oatpp/core/data/share/StringTemplate.hpp
  109. oatpp/core/data/stream/BufferStream.cpp
  110. oatpp/core/data/stream/BufferStream.hpp
  111. oatpp/core/data/stream/FIFOStream.cpp
  112. oatpp/core/data/stream/FIFOStream.hpp
  113. oatpp/core/data/stream/FileStream.cpp
  114. oatpp/core/data/stream/FileStream.hpp
  115. oatpp/core/data/stream/Stream.cpp
  116. oatpp/core/data/stream/Stream.hpp
  117. oatpp/core/data/stream/StreamBufferedProxy.cpp
  118. oatpp/core/data/stream/StreamBufferedProxy.hpp
  119. oatpp/core/data/Bundle.cpp
  120. oatpp/core/data/Bundle.hpp
  121. oatpp/core/macro/basic.hpp
  122. oatpp/core/macro/codegen.hpp
  123. oatpp/core/macro/component.hpp
  124. oatpp/core/parser/Caret.cpp
  125. oatpp/core/parser/Caret.hpp
  126. oatpp/core/parser/ParsingError.cpp
  127. oatpp/core/parser/ParsingError.hpp
  128. oatpp/core/provider/Invalidator.hpp
  129. oatpp/core/provider/Pool.hpp
  130. oatpp/core/provider/Provider.hpp
  131. oatpp/core/utils/Binary.cpp
  132. oatpp/core/utils/Binary.hpp
  133. oatpp/core/utils/ConversionUtils.cpp
  134. oatpp/core/utils/ConversionUtils.hpp
  135. oatpp/core/utils/Random.cpp
  136. oatpp/core/utils/Random.hpp
  137. oatpp/core/utils/String.cpp
  138. oatpp/core/utils/String.hpp
  139. oatpp/encoding/Base64.cpp
  140. oatpp/encoding/Base64.hpp
  141. oatpp/encoding/Hex.cpp
  142. oatpp/encoding/Hex.hpp
  143. oatpp/encoding/Unicode.cpp
  144. oatpp/encoding/Unicode.hpp
  145. oatpp/network/monitor/ConnectionInactivityChecker.cpp
  146. oatpp/network/monitor/ConnectionInactivityChecker.hpp
  147. oatpp/network/monitor/ConnectionMaxAgeChecker.cpp
  148. oatpp/network/monitor/ConnectionMaxAgeChecker.hpp
  149. oatpp/network/monitor/ConnectionMonitor.cpp
  150. oatpp/network/monitor/ConnectionMonitor.hpp
  151. oatpp/network/monitor/MetricsChecker.hpp
  152. oatpp/network/monitor/StatCollector.hpp
  153. oatpp/network/tcp/client/ConnectionProvider.cpp
  154. oatpp/network/tcp/client/ConnectionProvider.hpp
  155. oatpp/network/tcp/server/ConnectionProvider.cpp
  156. oatpp/network/tcp/server/ConnectionProvider.hpp
  157. oatpp/network/tcp/Connection.cpp
  158. oatpp/network/tcp/Connection.hpp
  159. oatpp/network/virtual_/Interface.cpp
  160. oatpp/network/virtual_/Interface.hpp
  161. oatpp/network/virtual_/Pipe.cpp
  162. oatpp/network/virtual_/Pipe.hpp
  163. oatpp/network/virtual_/Socket.cpp
  164. oatpp/network/virtual_/Socket.hpp
  165. oatpp/network/virtual_/client/ConnectionProvider.cpp
  166. oatpp/network/virtual_/client/ConnectionProvider.hpp
  167. oatpp/network/virtual_/server/ConnectionProvider.cpp
  168. oatpp/network/virtual_/server/ConnectionProvider.hpp
  169. oatpp/network/Address.cpp
  170. oatpp/network/Address.hpp
  171. oatpp/network/ConnectionHandler.hpp
  172. oatpp/network/ConnectionPool.cpp
  173. oatpp/network/ConnectionPool.hpp
  174. oatpp/network/ConnectionProvider.cpp
  175. oatpp/network/ConnectionProvider.hpp
  176. oatpp/network/ConnectionProviderSwitch.cpp
  177. oatpp/network/ConnectionProviderSwitch.hpp
  178. oatpp/network/Server.cpp
  179. oatpp/network/Server.hpp
  180. oatpp/network/Url.cpp
  181. oatpp/network/Url.hpp
  182. oatpp/orm/Connection.hpp
  183. oatpp/orm/DbClient.cpp
  184. oatpp/orm/DbClient.hpp
  185. oatpp/orm/Executor.cpp
  186. oatpp/orm/Executor.hpp
  187. oatpp/orm/QueryResult.cpp
  188. oatpp/orm/QueryResult.hpp
  189. oatpp/orm/SchemaMigration.cpp
  190. oatpp/orm/SchemaMigration.hpp
  191. oatpp/orm/Transaction.cpp
  192. oatpp/orm/Transaction.hpp
  193. oatpp/parser/json/Beautifier.cpp
  194. oatpp/parser/json/Beautifier.hpp
  195. oatpp/parser/json/Utils.cpp
  196. oatpp/parser/json/Utils.hpp
  197. oatpp/parser/json/mapping/Deserializer.cpp
  198. oatpp/parser/json/mapping/Deserializer.hpp
  199. oatpp/parser/json/mapping/ObjectMapper.cpp
  200. oatpp/parser/json/mapping/ObjectMapper.hpp
  201. oatpp/parser/json/mapping/Serializer.cpp
  202. oatpp/parser/json/mapping/Serializer.hpp
  203. oatpp/web/client/ApiClient.cpp
  204. oatpp/web/client/ApiClient.hpp
  205. oatpp/web/client/HttpRequestExecutor.cpp
  206. oatpp/web/client/HttpRequestExecutor.hpp
  207. oatpp/web/client/RequestExecutor.cpp
  208. oatpp/web/client/RequestExecutor.hpp
  209. oatpp/web/client/RetryPolicy.cpp
  210. oatpp/web/client/RetryPolicy.hpp
  211. oatpp/web/mime/multipart/FileProvider.cpp
  212. oatpp/web/mime/multipart/FileProvider.hpp
  213. oatpp/web/mime/multipart/InMemoryDataProvider.cpp
  214. oatpp/web/mime/multipart/InMemoryDataProvider.hpp
  215. oatpp/web/mime/multipart/Multipart.cpp
  216. oatpp/web/mime/multipart/Multipart.hpp
  217. oatpp/web/mime/multipart/Part.cpp
  218. oatpp/web/mime/multipart/Part.hpp
  219. oatpp/web/mime/multipart/PartList.cpp
  220. oatpp/web/mime/multipart/PartList.hpp
  221. oatpp/web/mime/multipart/PartReader.cpp
  222. oatpp/web/mime/multipart/PartReader.hpp
  223. oatpp/web/mime/multipart/Reader.cpp
  224. oatpp/web/mime/multipart/Reader.hpp
  225. oatpp/web/mime/multipart/StatefulParser.cpp
  226. oatpp/web/mime/multipart/StatefulParser.hpp
  227. oatpp/web/mime/multipart/TemporaryFileProvider.cpp
  228. oatpp/web/mime/multipart/TemporaryFileProvider.hpp
  229. oatpp/web/protocol/CommunicationError.cpp
  230. oatpp/web/protocol/CommunicationError.hpp
  231. oatpp/web/protocol/http/Http.cpp
  232. oatpp/web/protocol/http/Http.hpp
  233. oatpp/web/protocol/http/incoming/BodyDecoder.cpp
  234. oatpp/web/protocol/http/incoming/BodyDecoder.hpp
  235. oatpp/web/protocol/http/incoming/Request.cpp
  236. oatpp/web/protocol/http/incoming/Request.hpp
  237. oatpp/web/protocol/http/incoming/RequestHeadersReader.cpp
  238. oatpp/web/protocol/http/incoming/RequestHeadersReader.hpp
  239. oatpp/web/protocol/http/incoming/Response.cpp
  240. oatpp/web/protocol/http/incoming/Response.hpp
  241. oatpp/web/protocol/http/incoming/ResponseHeadersReader.cpp
  242. oatpp/web/protocol/http/incoming/ResponseHeadersReader.hpp
  243. oatpp/web/protocol/http/incoming/SimpleBodyDecoder.cpp
  244. oatpp/web/protocol/http/incoming/SimpleBodyDecoder.hpp
  245. oatpp/web/protocol/http/outgoing/Body.cpp
  246. oatpp/web/protocol/http/outgoing/Body.hpp
  247. oatpp/web/protocol/http/outgoing/BufferBody.cpp
  248. oatpp/web/protocol/http/outgoing/BufferBody.hpp
  249. oatpp/web/protocol/http/outgoing/MultipartBody.cpp
  250. oatpp/web/protocol/http/outgoing/MultipartBody.hpp
  251. oatpp/web/protocol/http/outgoing/StreamingBody.cpp
  252. oatpp/web/protocol/http/outgoing/StreamingBody.hpp
  253. oatpp/web/protocol/http/outgoing/Request.cpp
  254. oatpp/web/protocol/http/outgoing/Request.hpp
  255. oatpp/web/protocol/http/outgoing/Response.cpp
  256. oatpp/web/protocol/http/outgoing/Response.hpp
  257. oatpp/web/protocol/http/outgoing/ResponseFactory.cpp
  258. oatpp/web/protocol/http/outgoing/ResponseFactory.hpp
  259. oatpp/web/protocol/http/encoding/Chunked.cpp
  260. oatpp/web/protocol/http/encoding/Chunked.hpp
  261. oatpp/web/protocol/http/encoding/ProviderCollection.cpp
  262. oatpp/web/protocol/http/encoding/ProviderCollection.hpp
  263. oatpp/web/protocol/http/encoding/EncoderProvider.hpp
  264. oatpp/web/protocol/http/utils/CommunicationUtils.cpp
  265. oatpp/web/protocol/http/utils/CommunicationUtils.hpp
  266. oatpp/web/server/AsyncHttpConnectionHandler.cpp
  267. oatpp/web/server/AsyncHttpConnectionHandler.hpp
  268. oatpp/web/server/HttpConnectionHandler.cpp
  269. oatpp/web/server/HttpConnectionHandler.hpp
  270. oatpp/web/server/HttpProcessor.cpp
  271. oatpp/web/server/HttpProcessor.hpp
  272. oatpp/web/server/HttpRequestHandler.hpp
  273. oatpp/web/server/HttpRouter.cpp
  274. oatpp/web/server/HttpRouter.hpp
  275. oatpp/web/server/api/ApiController.cpp
  276. oatpp/web/server/api/ApiController.hpp
  277. oatpp/web/server/api/Endpoint.cpp
  278. oatpp/web/server/api/Endpoint.hpp
  279. oatpp/web/server/handler/AuthorizationHandler.cpp
  280. oatpp/web/server/handler/AuthorizationHandler.hpp
  281. oatpp/web/server/handler/ErrorHandler.cpp
  282. oatpp/web/server/handler/ErrorHandler.hpp
  283. oatpp/web/server/interceptor/AllowCorsGlobal.cpp
  284. oatpp/web/server/interceptor/AllowCorsGlobal.hpp
  285. oatpp/web/server/interceptor/RequestInterceptor.hpp
  286. oatpp/web/server/interceptor/ResponseInterceptor.hpp
  287. oatpp/web/url/mapping/Pattern.cpp
  288. oatpp/web/url/mapping/Pattern.hpp
  289. oatpp/web/url/mapping/Router.hpp
  290. )
  291. set_target_properties(oatpp PROPERTIES
  292. CXX_STANDARD 11
  293. CXX_EXTENSIONS OFF
  294. CXX_STANDARD_REQUIRED ON
  295. )
  296. if (MSVC)
  297. target_compile_options(oatpp PRIVATE /permissive-)
  298. endif()
  299. set(CMAKE_THREAD_PREFER_PTHREAD ON)
  300. find_package(Threads REQUIRED)
  301. #######################################################################################################
  302. ## Link external libraries
  303. SET(OATPP_ADD_LINK_LIBS "")
  304. if(MSVC OR MINGW)
  305. SET(OATPP_ADD_LINK_LIBS wsock32 ws2_32)
  306. elseif(NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
  307. if(OATPP_LINK_ATOMIC)
  308. SET(OATPP_ADD_LINK_LIBS atomic)
  309. endif()
  310. endif()
  311. message("OATPP_ADD_LINK_LIBS=${OATPP_ADD_LINK_LIBS}")
  312. target_link_libraries(oatpp PUBLIC ${CMAKE_THREAD_LIBS_INIT}
  313. ${OATPP_ADD_LINK_LIBS}
  314. )
  315. target_include_directories(oatpp PUBLIC
  316. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
  317. )
  318. #######################################################################################################
  319. ## oatpp-test
  320. if(OATPP_LINK_TEST_LIBRARY)
  321. add_library(oatpp-test
  322. oatpp-test/Checker.cpp
  323. oatpp-test/Checker.hpp
  324. oatpp-test/UnitTest.cpp
  325. oatpp-test/UnitTest.hpp
  326. oatpp-test/web/ClientServerTestRunner.hpp
  327. )
  328. set_target_properties(oatpp-test PROPERTIES
  329. CXX_STANDARD 11
  330. CXX_EXTENSIONS OFF
  331. CXX_STANDARD_REQUIRED ON
  332. )
  333. if (MSVC)
  334. target_compile_options(oatpp-test PRIVATE /permissive-)
  335. endif()
  336. target_link_libraries(oatpp-test PUBLIC oatpp)
  337. target_include_directories(oatpp-test PUBLIC
  338. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
  339. )
  340. add_dependencies(oatpp-test oatpp)
  341. endif()
  342. #######################################################################################################
  343. ## Install targets
  344. if(OATPP_INSTALL)
  345. include("../cmake/module-install.cmake")
  346. endif()