CMakeLists.txt 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. ##########################################################
  2. # Basic
  3. ##########################################################
  4. cmake_minimum_required(VERSION 3.17)
  5. project(ls_std VERSION 2022.1.0)
  6. set(MODULE_NAME_BOXING ls_std_boxing)
  7. set(MODULE_NAME_CORE ls_std_core)
  8. set(MODULE_NAME_ENCODING ls_std_encoding)
  9. set(MODULE_NAME_EVENT ls_std_event)
  10. set(MODULE_NAME_IO ls_std_io)
  11. set(MODULE_NAME_LOGIC ls_std_logic)
  12. set(MODULE_NAME_TIME ls_std_time)
  13. ##########################################################
  14. # Options
  15. ##########################################################
  16. option(LS_STD_BUILD_WITH_TESTS "Build project with tests..." OFF)
  17. option(LS_STD_BUILD_STATIC "Build ls_std static library..." ON)
  18. option(LS_STD_BUILD_SHARED "Build ls_std shared library..." OFF)
  19. option(LS_STD_BUILD_MODULE "Build ls_std module library..." OFF)
  20. ##########################################################
  21. # Compiler Settings
  22. ##########################################################
  23. message("${PROJECT_NAME}: Setting compiler flags...")
  24. set(CMAKE_CXX_STANDARD 11)
  25. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
  26. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  27. ######################################################
  28. # Include Directories
  29. ######################################################
  30. message("${PROJECT_NAME}: Adding include directories...")
  31. if (${LS_STD_BUILD_WITH_TESTS})
  32. include_directories(${CMAKE_CURRENT_SOURCE_DIR}/test)
  33. include_directories(${CMAKE_CURRENT_LIST_DIR}/test/lib/googletest-1.8.1/googletest/include)
  34. include_directories(${CMAKE_CURRENT_LIST_DIR}/test/lib/googletest-1.8.1/googlemock/include)
  35. endif ()
  36. include_directories(${CMAKE_CURRENT_LIST_DIR}/include)
  37. ######################################################
  38. # Add Other CMake Dependencies
  39. ######################################################
  40. message("${PROJECT_NAME}: Adding additional cmake dependencies...")
  41. if (${LS_STD_BUILD_WITH_TESTS})
  42. add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/test/lib/googletest-1.8.1)
  43. endif ()
  44. ##########################################################
  45. # Source Files
  46. ##########################################################
  47. set(SOURCE_FILES_BOXING
  48. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/boxing/Boolean.cpp
  49. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/boxing/Double.cpp
  50. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/boxing/Float.cpp
  51. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/boxing/Integer.cpp
  52. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/boxing/Long.cpp
  53. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/boxing/String.cpp)
  54. set(SOURCE_FILES_CORE
  55. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/core/Class.cpp
  56. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/core/Version.cpp)
  57. set(SOURCE_FILES_ENCODING
  58. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/encoding/Base64.cpp)
  59. set(SOURCE_FILES_EVENT
  60. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/event/serialization/SerializableJsonEvent.cpp
  61. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/event/Event.cpp
  62. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/event/EventHandler.cpp
  63. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/event/EventManager.cpp
  64. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/event/Narrator.cpp)
  65. set(SOURCE_FILES_IO
  66. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/kv/KvDocument.cpp
  67. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/kv/KvFileReader.cpp
  68. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/kv/KvPair.cpp
  69. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/kv/KvParser.cpp
  70. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/logging/Logger.cpp
  71. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/logging/LogLevel.cpp
  72. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XmlAttribute.cpp
  73. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XmlDeclaration.cpp
  74. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XmlDocument.cpp
  75. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XmlNode.cpp
  76. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XmlParser.cpp
  77. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/xml/XmlReader.cpp
  78. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/File.cpp
  79. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/FileOutputStream.cpp
  80. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/FileReader.cpp
  81. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/FileWriter.cpp
  82. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/StandardOutputWriter.cpp
  83. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/io/StorableFile.cpp)
  84. set(SOURCE_FILES_LOGIC
  85. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/serialization/SerializableJsonState.cpp
  86. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/serialization/SerializableJsonStateConnection.cpp
  87. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/serialization/SerializableJsonStateMachine.cpp
  88. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/State.cpp
  89. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/StateConnection.cpp
  90. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/logic/StateMachine.cpp)
  91. set(SOURCE_FILES_TIME
  92. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls_std/time/Date.cpp)
  93. if (${LS_STD_BUILD_WITH_TESTS})
  94. set(TEST_FILES_BOXING
  95. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/BooleanTest.cpp
  96. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/DoubleTest.cpp
  97. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/FloatTest.cpp
  98. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/IntegerTest.cpp
  99. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/LongTest.cpp
  100. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/StringTest.cpp)
  101. set(TEST_FILES_CORE
  102. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/EventNotHandledExceptionTest.cpp
  103. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/EventNotSubscribedExceptionTest.cpp
  104. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/FileNotFoundExceptionTest.cpp
  105. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/FileOperationExceptionTest.cpp
  106. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IllegalArgumentExceptionTest.cpp
  107. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IllegalArithmeticOperationExceptionTest.cpp
  108. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IncompleteJsonExceptionTest.cpp
  109. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/NullPointerExceptionTest.cpp
  110. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/utils/RegexUtilsTest.cpp
  111. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/utils/STLUtilsTest.cpp
  112. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/ClassTest.cpp
  113. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/LibraryVersionTest.cpp
  114. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/VersionTest.cpp)
  115. set(TEST_FILES_ENCODING
  116. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/encoding/Base64Test.cpp)
  117. set(TEST_FILES_EVENT
  118. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/serialization/SerializableJsonEventTest.cpp
  119. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/EventHandlerTest.cpp
  120. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/EventManagerTest.cpp
  121. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/EventTest.cpp
  122. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/NarratorTest.cpp
  123. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/Colour.cpp
  124. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/DailyNewsAgency.cpp
  125. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/GossipNewsAgency.cpp
  126. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/GossipNewsEvent.cpp
  127. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/NewsAgency.cpp
  128. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/SeriousNewsEvent.cpp
  129. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/TestDataCar.cpp
  130. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/TestDataMercedesCar.cpp)
  131. set(TEST_FILES_IO
  132. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/kv/KvDocumentTest.cpp
  133. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/kv/KvFileReaderTest.cpp
  134. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/kv/KvPairTest.cpp
  135. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/kv/KvParserTest.cpp
  136. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/logging/LoggerTest.cpp
  137. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/logging/LogLevelTest.cpp
  138. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlAttributeTest.cpp
  139. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlDeclarationTest.cpp
  140. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlDocumentTest.cpp
  141. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlNodeTest.cpp
  142. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlParserTest.cpp
  143. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlParserTestWrapperTest.cpp
  144. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlReaderTest.cpp
  145. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileOutputStreamTest.cpp
  146. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileReaderTest.cpp
  147. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileTest.cpp
  148. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileWriterTest.cpp
  149. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/StandardOutputWriterTest.cpp
  150. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/StorableFileTest.cpp
  151. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/xml/TestDataFactory.cpp
  152. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/xml/XmlParserTestWrapper.cpp)
  153. set(TEST_FILES_LOGIC
  154. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/serialization/SerializableJsonStateConnectionTest.cpp
  155. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/serialization/SerializableJsonStateMachineTest.cpp
  156. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/serialization/SerializableJsonStateTest.cpp
  157. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/StateConnectionTest.cpp
  158. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/StateMachineTest.cpp
  159. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/StateTest.cpp
  160. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/logic/TestDataFactory.cpp)
  161. set(TEST_FILES_SERIALIZATION
  162. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/JsonTest.cpp)
  163. set(TEST_FILES_TIME
  164. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/time/DateTest.cpp)
  165. endif ()
  166. ##########################################################
  167. # Build Tests (boxing)
  168. ##########################################################
  169. if (${LS_STD_BUILD_WITH_TESTS})
  170. message("${MODULE_NAME_BOXING}: Building tests...")
  171. add_executable(${MODULE_NAME_BOXING}_test ${TEST_FILES_BOXING})
  172. endif ()
  173. ##########################################################
  174. # Build Tests (core)
  175. ##########################################################
  176. if (${LS_STD_BUILD_WITH_TESTS})
  177. message("${MODULE_NAME_CORE}: Building tests...")
  178. add_executable(${MODULE_NAME_CORE}_test ${TEST_FILES_CORE})
  179. endif ()
  180. ##########################################################
  181. # Build Tests (encoding)
  182. ##########################################################
  183. if (${LS_STD_BUILD_WITH_TESTS})
  184. message("${MODULE_NAME_ENCODING}: Building tests...")
  185. add_executable(${MODULE_NAME_ENCODING}_test ${TEST_FILES_ENCODING})
  186. endif ()
  187. ##########################################################
  188. # Build Tests (event)
  189. ##########################################################
  190. if (${LS_STD_BUILD_WITH_TESTS})
  191. message("${MODULE_NAME_EVENT}: Building tests...")
  192. add_executable(${MODULE_NAME_EVENT}_test ${TEST_FILES_EVENT})
  193. endif ()
  194. ##########################################################
  195. # Build Tests (io)
  196. ##########################################################
  197. if (${LS_STD_BUILD_WITH_TESTS})
  198. message("${MODULE_NAME_IO}: Building tests...")
  199. add_executable(${MODULE_NAME_IO}_test ${TEST_FILES_IO})
  200. endif ()
  201. ##########################################################
  202. # Build Tests (logic)
  203. ##########################################################
  204. if (${LS_STD_BUILD_WITH_TESTS})
  205. message("${MODULE_NAME_LOGIC}: Building tests...")
  206. add_executable(${MODULE_NAME_LOGIC}_test ${TEST_FILES_LOGIC})
  207. endif ()
  208. ##########################################################
  209. # Build Tests (time)
  210. ##########################################################
  211. if (${LS_STD_BUILD_WITH_TESTS})
  212. message("${MODULE_NAME_TIME}: Building tests...")
  213. add_executable(${MODULE_NAME_TIME}_test ${TEST_FILES_TIME})
  214. endif ()
  215. ##########################################################
  216. # Build Tests
  217. ##########################################################
  218. if (${LS_STD_BUILD_WITH_TESTS})
  219. message("${PROJECT_NAME}: Building tests...")
  220. add_executable(${PROJECT_NAME}_test
  221. ${TEST_FILES_BOXING}
  222. ${TEST_FILES_CORE}
  223. ${TEST_FILES_ENCODING}
  224. ${TEST_FILES_EVENT}
  225. ${TEST_FILES_IO}
  226. ${TEST_FILES_LOGIC}
  227. ${TEST_FILES_SERIALIZATION}
  228. ${TEST_FILES_TIME})
  229. endif ()
  230. ##########################################################
  231. # Build Library (boxing)
  232. ##########################################################
  233. message("${PROJECT_NAME}: Building ${MODULE_NAME_BOXING} library version ${PROJECT_VERSION}...")
  234. if (${LS_STD_BUILD_STATIC})
  235. add_library("${MODULE_NAME_BOXING}" STATIC ${SOURCE_FILES_BOXING})
  236. set_target_properties("${MODULE_NAME_BOXING}" PROPERTIES DEBUG_POSTFIX "_d")
  237. endif ()
  238. if (${LS_STD_BUILD_SHARED})
  239. add_library("${MODULE_NAME_BOXING}" SHARED ${SOURCE_FILES_BOXING})
  240. set_target_properties("${MODULE_NAME_BOXING}" PROPERTIES DEBUG_POSTFIX "_d")
  241. endif ()
  242. if (${LS_STD_BUILD_MODULE})
  243. add_library("${MODULE_NAME_BOXING}" MODULE ${SOURCE_FILES_BOXING})
  244. set_target_properties("${MODULE_NAME_BOXING}" PROPERTIES DEBUG_POSTFIX "_d")
  245. endif ()
  246. ##########################################################
  247. # Build Library (core)
  248. ##########################################################
  249. message("${PROJECT_NAME}: Building ${MODULE_NAME_CORE} library version ${PROJECT_VERSION}...")
  250. if (${LS_STD_BUILD_STATIC})
  251. add_library("${MODULE_NAME_CORE}" STATIC ${SOURCE_FILES_CORE})
  252. set_target_properties("${MODULE_NAME_CORE}" PROPERTIES DEBUG_POSTFIX "_d")
  253. endif ()
  254. ##########################################################
  255. # Build Library (encoding)
  256. ##########################################################
  257. message("${PROJECT_NAME}: Building ${MODULE_NAME_ENCODING} library version ${PROJECT_VERSION}...")
  258. if (${LS_STD_BUILD_STATIC})
  259. add_library("${MODULE_NAME_ENCODING}" STATIC ${SOURCE_FILES_ENCODING})
  260. set_target_properties("${MODULE_NAME_ENCODING}" PROPERTIES DEBUG_POSTFIX "_d")
  261. endif ()
  262. ##########################################################
  263. # Build Library (event)
  264. ##########################################################
  265. message("${PROJECT_NAME}: Building ${MODULE_NAME_EVENT} library version ${PROJECT_VERSION}...")
  266. if (${LS_STD_BUILD_STATIC})
  267. add_library("${MODULE_NAME_EVENT}" STATIC ${SOURCE_FILES_EVENT})
  268. set_target_properties("${MODULE_NAME_EVENT}" PROPERTIES DEBUG_POSTFIX "_d")
  269. endif ()
  270. ##########################################################
  271. # Build Library (io)
  272. ##########################################################
  273. message("${PROJECT_NAME}: Building ${MODULE_NAME_IO} library version ${PROJECT_VERSION}...")
  274. if (${LS_STD_BUILD_STATIC})
  275. add_library("${MODULE_NAME_IO}" STATIC ${SOURCE_FILES_IO})
  276. set_target_properties("${MODULE_NAME_IO}" PROPERTIES DEBUG_POSTFIX "_d")
  277. endif ()
  278. ##########################################################
  279. # Build Library (logic)
  280. ##########################################################
  281. message("${PROJECT_NAME}: Building ${MODULE_NAME_LOGIC} library version ${PROJECT_VERSION}...")
  282. if (${LS_STD_BUILD_STATIC})
  283. add_library("${MODULE_NAME_LOGIC}" STATIC ${SOURCE_FILES_LOGIC})
  284. set_target_properties("${MODULE_NAME_LOGIC}" PROPERTIES DEBUG_POSTFIX "_d")
  285. endif ()
  286. ##########################################################
  287. # Build Library (time)
  288. ##########################################################
  289. message("${PROJECT_NAME}: Building ${MODULE_NAME_TIME} library version ${PROJECT_VERSION}...")
  290. if (${LS_STD_BUILD_STATIC})
  291. add_library("${MODULE_NAME_TIME}" STATIC ${SOURCE_FILES_TIME})
  292. set_target_properties("${MODULE_NAME_TIME}" PROPERTIES DEBUG_POSTFIX "_d")
  293. endif ()
  294. ##########################################################
  295. # Linking (boxing)
  296. ##########################################################
  297. if (${LS_STD_BUILD_WITH_TESTS})
  298. message("${MODULE_NAME_BOXING}: Linking libraries for test application...")
  299. target_link_libraries(${MODULE_NAME_BOXING}_test
  300. gtest
  301. gmock
  302. gtest_main
  303. "${MODULE_NAME_BOXING}"
  304. "${MODULE_NAME_CORE}")
  305. endif ()
  306. ##########################################################
  307. # Linking (core)
  308. ##########################################################
  309. if (${LS_STD_BUILD_WITH_TESTS})
  310. message("${MODULE_NAME_CORE}: Linking libraries for test application...")
  311. target_link_libraries(${MODULE_NAME_CORE}_test
  312. gtest
  313. gmock
  314. gtest_main
  315. "${MODULE_NAME_CORE}")
  316. endif ()
  317. ##########################################################
  318. # Linking (encoding)
  319. ##########################################################
  320. if (${LS_STD_BUILD_WITH_TESTS})
  321. message("${MODULE_NAME_ENCODING}: Linking libraries for test application...")
  322. target_link_libraries(${MODULE_NAME_ENCODING}_test
  323. gtest
  324. gmock
  325. gtest_main
  326. "${MODULE_NAME_ENCODING}"
  327. "${MODULE_NAME_CORE}")
  328. endif ()
  329. ##########################################################
  330. # Linking (event)
  331. ##########################################################
  332. if (${LS_STD_BUILD_WITH_TESTS})
  333. message("${MODULE_NAME_EVENT}: Linking libraries for test application...")
  334. target_link_libraries(${MODULE_NAME_EVENT}_test
  335. gtest
  336. gmock
  337. gtest_main
  338. "${MODULE_NAME_EVENT}"
  339. "${MODULE_NAME_CORE}")
  340. endif ()
  341. ##########################################################
  342. # Linking (io)
  343. ##########################################################
  344. if (${LS_STD_BUILD_WITH_TESTS})
  345. message("${MODULE_NAME_IO}: Linking libraries for test application...")
  346. target_link_libraries(${MODULE_NAME_IO}_test
  347. gtest
  348. gmock
  349. gtest_main
  350. "${MODULE_NAME_IO}"
  351. "${MODULE_NAME_CORE}")
  352. endif ()
  353. ##########################################################
  354. # Linking (logic)
  355. ##########################################################
  356. if (${LS_STD_BUILD_WITH_TESTS})
  357. message("${MODULE_NAME_LOGIC}: Linking libraries for test application...")
  358. target_link_libraries(${MODULE_NAME_LOGIC}_test
  359. gtest
  360. gmock
  361. gtest_main
  362. "${MODULE_NAME_LOGIC}"
  363. "${MODULE_NAME_CORE}")
  364. endif ()
  365. ##########################################################
  366. # Linking (time)
  367. ##########################################################
  368. if (${LS_STD_BUILD_WITH_TESTS})
  369. message("${MODULE_NAME_TIME}: Linking libraries for test application...")
  370. target_link_libraries(${MODULE_NAME_TIME}_test
  371. gtest
  372. gmock
  373. gtest_main
  374. "${MODULE_NAME_TIME}"
  375. "${MODULE_NAME_CORE}")
  376. endif ()
  377. ##########################################################
  378. # Linking
  379. ##########################################################
  380. if (${LS_STD_BUILD_WITH_TESTS})
  381. message("${PROJECT_NAME}: Linking libraries for test application...")
  382. target_link_libraries(${PROJECT_NAME}_test
  383. gtest
  384. gmock
  385. gtest_main
  386. "${MODULE_NAME_CORE}"
  387. "${MODULE_NAME_BOXING}"
  388. "${MODULE_NAME_ENCODING}"
  389. "${MODULE_NAME_EVENT}"
  390. "${MODULE_NAME_IO}"
  391. "${MODULE_NAME_LOGIC}"
  392. "${MODULE_NAME_TIME}")
  393. endif ()