CMakeLists.txt 14 KB

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