CMakeLists.txt 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. ####################################################################################################################
  2. ####################################################################################################################
  3. ####################################################################################################################
  4. # General
  5. ####################################################################################################################
  6. ####################################################################################################################
  7. ####################################################################################################################
  8. ##########################################################
  9. # Basic
  10. ##########################################################
  11. cmake_minimum_required(VERSION 3.17)
  12. project(ls-std VERSION 2023.2.0)
  13. set(MODULE_NAME_BOXING ls-std-boxing)
  14. set(MODULE_NAME_CORE ls-std-core)
  15. set(MODULE_NAME_ENCODING ls-std-encoding)
  16. set(MODULE_NAME_EVENT ls-std-event)
  17. set(MODULE_NAME_IO ls-std-io)
  18. set(MODULE_NAME_TIME ls-std-time)
  19. set(GOOGLE_TEST_MODULE googletest-1.11.0)
  20. set(CLI_NAME_BASE64 cli-base64)
  21. ##########################################################
  22. # Options
  23. ##########################################################
  24. option(LS_STD_BUILD_WITH_TESTS "Build project with tests..." OFF)
  25. option(LS_STD_BUILD_WITH_SUPPORTED_COMPILER "Build project with supported compiler only..." ON)
  26. option(LS_STD_BUILD_STATIC "Build ls-std static library..." ON)
  27. option(LS_STD_BUILD_SHARED "Build ls-std shared library..." OFF)
  28. set(TARGET_COUNTER 0)
  29. if (${LS_STD_BUILD_STATIC})
  30. math(EXPR TARGET_COUNTER "${TARGET_COUNTER} + 1")
  31. set(GOAL "static library")
  32. endif ()
  33. if (${LS_STD_BUILD_SHARED})
  34. math(EXPR TARGET_COUNTER "${TARGET_COUNTER} + 1")
  35. set(GOAL "shared library")
  36. endif ()
  37. message("${PROJECT_NAME}: [Goal] ${GOAL}")
  38. if (TARGET_COUNTER GREATER 1)
  39. message("${PROJECT_NAME}: [Error] only one goal supported at the same time!")
  40. return()
  41. endif ()
  42. if (TARGET_COUNTER EQUAL 0)
  43. message("${PROJECT_NAME}: [Error] no goal selected!")
  44. return()
  45. endif ()
  46. ##########################################################
  47. # Compiler Settings
  48. ##########################################################
  49. message("${PROJECT_NAME}: Setting compiler flags...")
  50. set(CMAKE_CXX_STANDARD 17)
  51. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
  52. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  53. ##########################################################
  54. # Compiler Support
  55. ##########################################################
  56. if(${LS_STD_BUILD_WITH_SUPPORTED_COMPILER})
  57. message("${PROJECT_NAME}: build with compiler support...")
  58. # define supported compilers
  59. if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC OR
  60. ${CMAKE_CXX_COMPILER_ID} STREQUAL GNU OR
  61. ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang OR
  62. ${CMAKE_CXX_COMPILER_ID} STREQUAL AppleClang)
  63. message("${PROJECT_NAME}: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} is supported...")
  64. else()
  65. message("${PROJECT_NAME}: [Error] ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} is not supported... terminated!")
  66. return()
  67. endif ()
  68. endif()
  69. ######################################################
  70. # Include Directories
  71. ######################################################
  72. message("${PROJECT_NAME}: Adding include directories...")
  73. if (${LS_STD_BUILD_WITH_TESTS})
  74. include_directories(${CMAKE_CURRENT_SOURCE_DIR}/test)
  75. include_directories(${CMAKE_CURRENT_LIST_DIR}/test/lib/${GOOGLE_TEST_MODULE}/googletest/include)
  76. include_directories(${CMAKE_CURRENT_LIST_DIR}/test/lib/${GOOGLE_TEST_MODULE}/googlemock/include)
  77. endif ()
  78. include_directories(${CMAKE_CURRENT_LIST_DIR}/include)
  79. ######################################################
  80. # Add Other CMake Dependencies
  81. ######################################################
  82. message("${PROJECT_NAME}: Adding additional cmake dependencies...")
  83. if (${LS_STD_BUILD_WITH_TESTS})
  84. add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/test/lib/${GOOGLE_TEST_MODULE})
  85. endif ()
  86. ####################################################################################################################
  87. ####################################################################################################################
  88. ####################################################################################################################
  89. # Source Files Modularization
  90. ####################################################################################################################
  91. ####################################################################################################################
  92. ####################################################################################################################
  93. set(SOURCE_FILES_BOXING
  94. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/Boolean.cpp
  95. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/Double.cpp
  96. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/Float.cpp
  97. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/Integer.cpp
  98. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/Long.cpp
  99. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/String.cpp)
  100. set(SOURCE_FILES_CORE
  101. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/evaluator/EmptyStringArgumentEvaluator.cpp
  102. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/evaluator/IndexOutOfBoundsEvaluator.cpp
  103. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/evaluator/NullPointerArgumentEvaluator.cpp
  104. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/evaluator/NullPointerEvaluator.cpp
  105. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/EventNotHandledException.cpp
  106. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/EventNotSubscribedException.cpp
  107. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/Exception.cpp
  108. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/ExceptionMessage.cpp
  109. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/FileNotFoundException.cpp
  110. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/FileOperationException.cpp
  111. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/IllegalArgumentException.cpp
  112. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/IllegalArithmeticOperationException.cpp
  113. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/IncompleteJsonException.cpp
  114. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/IndexOutOfBoundsException.cpp
  115. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/NotImplementedException.cpp
  116. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/NullPointerException.cpp
  117. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IBoxing.cpp
  118. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IEncoding.cpp
  119. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IEvaluator.cpp
  120. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IEventSubscriber.cpp
  121. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IListener.cpp
  122. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IReader.cpp
  123. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/ISerializable.cpp
  124. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IStorable.cpp
  125. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IValidator.cpp
  126. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IWriter.cpp
  127. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/Class.cpp
  128. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/ConditionalFunctionExecutor.cpp
  129. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/LibraryVersion.cpp
  130. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/Version.cpp)
  131. set(SOURCE_FILES_ENCODING
  132. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/encoding/Base64.cpp)
  133. set(SOURCE_FILES_EVENT
  134. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/event/serialization/SerializableJsonEvent.cpp
  135. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/event/Event.cpp
  136. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/event/EventHandler.cpp
  137. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/event/EventManager.cpp
  138. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/event/Narrator.cpp)
  139. set(SOURCE_FILES_IO
  140. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/evaluator/FileExistenceEvaluator.cpp
  141. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/logging/Logger.cpp
  142. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/logging/LogLevel.cpp
  143. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairIdentifierArgumentEvaluator.cpp
  144. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairRowArgumentEvaluator.cpp
  145. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairRowListValueArgumentEvaluator.cpp
  146. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairRowSingleValueArgumentEvaluator.cpp
  147. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairSectionArgumentEvaluator.cpp
  148. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairValueArgumentEvaluator.cpp
  149. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairDocument.cpp
  150. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairRow.cpp
  151. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairRowListValue.cpp
  152. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairRowSingleValue.cpp
  153. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairRowValue.cpp
  154. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairSection.cpp
  155. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/reader/SectionPairFileReader.cpp
  156. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/reader/SectionPairFileReaderParameter.cpp
  157. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairDocument.cpp
  158. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairParameter.cpp
  159. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairRow.cpp
  160. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairRowListValue.cpp
  161. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairRowSingleValue.cpp
  162. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairSection.cpp
  163. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairDocumentValidator.cpp
  164. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairFileExtensionValidator.cpp
  165. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairIdentifierValidator.cpp
  166. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairRowListValueValidator.cpp
  167. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairRowSingleValueValidator.cpp
  168. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairRowValidator.cpp
  169. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairSectionValidator.cpp
  170. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairValueValidator.cpp
  171. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/SectionPairMessageFormatter.cpp
  172. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlAttribute.cpp
  173. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlDeclaration.cpp
  174. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlDocument.cpp
  175. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlNode.cpp
  176. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlParseParameter.cpp
  177. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlParser.cpp
  178. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlReader.cpp
  179. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/File.cpp
  180. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FileOutputStream.cpp
  181. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FilePathSeparator.cpp
  182. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FilePathSeparatorMatch.cpp
  183. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FileReader.cpp
  184. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FileWriter.cpp
  185. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/NewLine.cpp
  186. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/StandardOutputWriter.cpp
  187. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/StorableFile.cpp)
  188. set(SOURCE_FILES_TIME
  189. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/time/Date.cpp)
  190. ####################################################################################################################
  191. ####################################################################################################################
  192. ####################################################################################################################
  193. # Unit Test Files Modularization
  194. ####################################################################################################################
  195. ####################################################################################################################
  196. ####################################################################################################################
  197. if (${LS_STD_BUILD_WITH_TESTS})
  198. set(UNIT_TEST_FILES_BOXING
  199. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/BooleanTest.cpp
  200. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/DoubleTest.cpp
  201. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/FloatTest.cpp
  202. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/IntegerTest.cpp
  203. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/LongTest.cpp
  204. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/StringTest.cpp)
  205. set(UNIT_TEST_FILES_CORE
  206. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/evaluator/EmptyStringArgumentEvaluatorTest.cpp
  207. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/evaluator/IndexOutOfBoundsEvaluatorTest.cpp
  208. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/evaluator/NullPointerArgumentEvaluatorTest.cpp
  209. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/evaluator/NullPointerEvaluatorTest.cpp
  210. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/EventNotHandledExceptionTest.cpp
  211. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/EventNotSubscribedExceptionTest.cpp
  212. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/ExceptionMessageTest.cpp
  213. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/FileNotFoundExceptionTest.cpp
  214. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/FileOperationExceptionTest.cpp
  215. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IllegalArgumentExceptionTest.cpp
  216. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IllegalArithmeticOperationExceptionTest.cpp
  217. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IncompleteJsonExceptionTest.cpp
  218. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IndexOutOfBoundsExceptionTest.cpp
  219. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/NotImplementedExceptionTest.cpp
  220. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/NullPointerExceptionTest.cpp
  221. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/ClassTest.cpp
  222. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/ConditionalFunctionExecutorTest.cpp
  223. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/LibraryVersionTest.cpp
  224. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/VersionTest.cpp
  225. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/core/ClassWrapper.cpp
  226. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/core/MathOddValidator.cpp)
  227. set(UNIT_TEST_FILES_ENCODING
  228. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/encoding/Base64Test.cpp)
  229. set(UNIT_TEST_FILES_EVENT
  230. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/serialization/SerializableJsonEventTest.cpp
  231. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/EventHandlerTest.cpp
  232. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/EventManagerTest.cpp
  233. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/EventTest.cpp
  234. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/NarratorTest.cpp
  235. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/Colour.cpp
  236. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/DailyNewsAgency.cpp
  237. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/GossipNewsAgency.cpp
  238. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/GossipNewsEvent.cpp
  239. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/NewsAgency.cpp
  240. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/SeriousNewsEvent.cpp
  241. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/TestDataCar.cpp
  242. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/TestDataMercedesCar.cpp)
  243. set(UNIT_TEST_FILES_IO
  244. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/evaluator/FileExistenceEvaluatorTest.cpp
  245. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/logging/LoggerTest.cpp
  246. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/logging/LogLevelTest.cpp
  247. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairIdentifierArgumentEvaluatorTest.cpp
  248. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairRowArgumentEvaluatorTest.cpp
  249. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairRowListValueArgumentEvaluatorTest.cpp
  250. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairRowSingleValueArgumentEvaluatorTest.cpp
  251. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairSectionArgumentEvaluatorTest.cpp
  252. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairValueArgumentEvaluatorTest.cpp
  253. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/model/SectionPairDocumentTest.cpp
  254. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/model/SectionPairRowListValueTest.cpp
  255. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/model/SectionPairRowSingleValueTest.cpp
  256. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/model/SectionPairRowTest.cpp
  257. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/model/SectionPairSectionTest.cpp
  258. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/reader/SectionPairFileReaderParameterTest.cpp
  259. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/reader/SectionPairFileReaderTest.cpp
  260. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/serialization/SerializableSectionPairDocumentTest.cpp
  261. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/serialization/SerializableSectionPairParameterTest.cpp
  262. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/serialization/SerializableSectionPairRowListValueTest.cpp
  263. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/serialization/SerializableSectionPairRowSingleValueTest.cpp
  264. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/serialization/SerializableSectionPairRowTest.cpp
  265. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/serialization/SerializableSectionPairSectionTest.cpp
  266. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairDocumentValidatorTest.cpp
  267. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairFileExtensionValidatorTest.cpp
  268. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairIdentifierValidatorTest.cpp
  269. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairRowListValueValidatorTest.cpp
  270. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairRowSingleValueValidatorTest.cpp
  271. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairRowValidatorTest.cpp
  272. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairSectionValidatorTest.cpp
  273. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairValueValidatorTest.cpp
  274. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/SectionPairMessageFormatterTest.cpp
  275. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlAttributeTest.cpp
  276. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlDeclarationTest.cpp
  277. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlDocumentTest.cpp
  278. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlNodeTest.cpp
  279. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlParseParameterTest.cpp
  280. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlParserTest.cpp
  281. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlParserTestWrapperTest.cpp
  282. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlReaderTest.cpp
  283. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileOutputStreamTest.cpp
  284. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileReaderTest.cpp
  285. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileTest.cpp
  286. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileWriterTest.cpp
  287. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/StandardOutputWriterTest.cpp
  288. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/StorableFileTest.cpp
  289. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/section-pair/SectionPairDocumentProvider.cpp
  290. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/section-pair/SectionPairSectionProvider.cpp
  291. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/section-pair/SerializableSectionPairRowProvider.cpp
  292. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/xml/TestDataFactory.cpp
  293. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/xml/XmlParserTestWrapper.cpp
  294. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/MockFileExistenceEvaluator.cpp
  295. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/MockFileReader.cpp)
  296. set(UNIT_TEST_FILES_SERIALIZATION
  297. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/JsonTest.cpp)
  298. set(UNIT_TEST_FILES_TIME
  299. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/time/DateTest.cpp)
  300. endif ()
  301. ####################################################################################################################
  302. ####################################################################################################################
  303. ####################################################################################################################
  304. # Unit Test Suite Builds
  305. ####################################################################################################################
  306. ####################################################################################################################
  307. ####################################################################################################################
  308. ##########################################################
  309. # Unit Build Tests (boxing)
  310. ##########################################################
  311. if (${LS_STD_BUILD_WITH_TESTS})
  312. message("${MODULE_NAME_BOXING}: Building unit tests...")
  313. add_executable(${MODULE_NAME_BOXING}-unit-test ${UNIT_TEST_FILES_BOXING})
  314. endif ()
  315. ##########################################################
  316. # Unit Build Tests (core)
  317. ##########################################################
  318. if (${LS_STD_BUILD_WITH_TESTS})
  319. message("${MODULE_NAME_CORE}: Building unit tests...")
  320. add_executable(${MODULE_NAME_CORE}-unit-test ${UNIT_TEST_FILES_CORE})
  321. endif ()
  322. ##########################################################
  323. # Unit Build Tests (encoding)
  324. ##########################################################
  325. if (${LS_STD_BUILD_WITH_TESTS})
  326. message("${MODULE_NAME_ENCODING}: Building unit tests...")
  327. add_executable(${MODULE_NAME_ENCODING}-unit-test ${UNIT_TEST_FILES_ENCODING})
  328. endif ()
  329. ##########################################################
  330. # Unit Build Tests (event)
  331. ##########################################################
  332. if (${LS_STD_BUILD_WITH_TESTS})
  333. message("${MODULE_NAME_EVENT}: Building unit tests...")
  334. add_executable(${MODULE_NAME_EVENT}-unit-test ${UNIT_TEST_FILES_EVENT})
  335. endif ()
  336. ##########################################################
  337. # Unit Build Tests (io)
  338. ##########################################################
  339. if (${LS_STD_BUILD_WITH_TESTS})
  340. message("${MODULE_NAME_IO}: Building unit tests...")
  341. add_executable(${MODULE_NAME_IO}-unit-test
  342. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/TestHelper.cpp
  343. ${UNIT_TEST_FILES_IO})
  344. endif ()
  345. ##########################################################
  346. # Unit Build Tests (time)
  347. ##########################################################
  348. if (${LS_STD_BUILD_WITH_TESTS})
  349. message("${MODULE_NAME_TIME}: Building unit tests...")
  350. add_executable(${MODULE_NAME_TIME}-unit-test ${UNIT_TEST_FILES_TIME})
  351. endif ()
  352. ##########################################################
  353. # Unit Build Tests (all)
  354. ##########################################################
  355. if (${LS_STD_BUILD_WITH_TESTS})
  356. message("${PROJECT_NAME}: Building unit tests...")
  357. add_executable(${PROJECT_NAME}-unit-test
  358. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/TestHelper.cpp
  359. ${UNIT_TEST_FILES_BOXING}
  360. ${UNIT_TEST_FILES_CORE}
  361. ${UNIT_TEST_FILES_ENCODING}
  362. ${UNIT_TEST_FILES_EVENT}
  363. ${UNIT_TEST_FILES_IO}
  364. ${UNIT_TEST_FILES_SERIALIZATION}
  365. ${UNIT_TEST_FILES_TIME})
  366. endif ()
  367. ####################################################################################################################
  368. ####################################################################################################################
  369. ####################################################################################################################
  370. # Integration Test Files Modularization
  371. ####################################################################################################################
  372. ####################################################################################################################
  373. ####################################################################################################################
  374. if (${LS_STD_BUILD_WITH_TESTS})
  375. set(INTEGRATION_TEST_FILES_IO
  376. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/reader/SectionPairFileReaderIT.cpp)
  377. endif ()
  378. ####################################################################################################################
  379. ####################################################################################################################
  380. ####################################################################################################################
  381. # Integration Test Suite Builds
  382. ####################################################################################################################
  383. ####################################################################################################################
  384. ####################################################################################################################
  385. ##########################################################
  386. # Integration Build Tests (io)
  387. ##########################################################
  388. if (${LS_STD_BUILD_WITH_TESTS})
  389. message("${MODULE_NAME_IO}: Building integration tests...")
  390. add_executable(${MODULE_NAME_IO}-integration-test
  391. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/TestHelper.cpp
  392. ${INTEGRATION_TEST_FILES_IO})
  393. endif ()
  394. ####################################################################################################################
  395. ####################################################################################################################
  396. ####################################################################################################################
  397. # Whole Test Suite Builds
  398. ####################################################################################################################
  399. ####################################################################################################################
  400. ####################################################################################################################
  401. if (${LS_STD_BUILD_WITH_TESTS})
  402. message("${PROJECT_NAME}: Building all tests...")
  403. add_executable(${PROJECT_NAME}-test
  404. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/TestHelper.cpp
  405. ${UNIT_TEST_FILES_BOXING}
  406. ${UNIT_TEST_FILES_CORE}
  407. ${UNIT_TEST_FILES_ENCODING}
  408. ${UNIT_TEST_FILES_EVENT}
  409. ${UNIT_TEST_FILES_IO}
  410. ${INTEGRATION_TEST_FILES_IO}
  411. ${UNIT_TEST_FILES_SERIALIZATION}
  412. ${UNIT_TEST_FILES_TIME})
  413. endif ()
  414. ####################################################################################################################
  415. ####################################################################################################################
  416. ####################################################################################################################
  417. # Build Library Binaries
  418. ####################################################################################################################
  419. ####################################################################################################################
  420. ####################################################################################################################
  421. ##########################################################
  422. # Build Library (boxing)
  423. ##########################################################
  424. message("${PROJECT_NAME}: Building ${MODULE_NAME_BOXING} library version ${PROJECT_VERSION}...")
  425. if (${LS_STD_BUILD_STATIC})
  426. add_library("${MODULE_NAME_BOXING}" STATIC ${SOURCE_FILES_BOXING})
  427. set_target_properties("${MODULE_NAME_BOXING}" PROPERTIES DEBUG_POSTFIX "-d")
  428. endif ()
  429. if (${LS_STD_BUILD_SHARED})
  430. add_library("${MODULE_NAME_BOXING}" SHARED ${SOURCE_FILES_BOXING})
  431. target_link_libraries("${MODULE_NAME_BOXING}" ${MODULE_NAME_CORE})
  432. set_target_properties("${MODULE_NAME_BOXING}" PROPERTIES DEBUG_POSTFIX "-d")
  433. endif ()
  434. ##########################################################
  435. # Build Library (core)
  436. ##########################################################
  437. message("${PROJECT_NAME}: Building ${MODULE_NAME_CORE} library version ${PROJECT_VERSION}...")
  438. if (${LS_STD_BUILD_STATIC})
  439. add_library("${MODULE_NAME_CORE}" STATIC ${SOURCE_FILES_CORE})
  440. set_target_properties("${MODULE_NAME_CORE}" PROPERTIES DEBUG_POSTFIX "-d")
  441. endif ()
  442. if (${LS_STD_BUILD_SHARED})
  443. add_library("${MODULE_NAME_CORE}" SHARED ${SOURCE_FILES_CORE})
  444. set_target_properties("${MODULE_NAME_CORE}" PROPERTIES DEBUG_POSTFIX "-d")
  445. endif ()
  446. ##########################################################
  447. # Build Library (encoding)
  448. ##########################################################
  449. message("${PROJECT_NAME}: Building ${MODULE_NAME_ENCODING} library version ${PROJECT_VERSION}...")
  450. if (${LS_STD_BUILD_STATIC})
  451. add_library("${MODULE_NAME_ENCODING}" STATIC ${SOURCE_FILES_ENCODING})
  452. set_target_properties("${MODULE_NAME_ENCODING}" PROPERTIES DEBUG_POSTFIX "-d")
  453. endif ()
  454. if (${LS_STD_BUILD_SHARED})
  455. add_library("${MODULE_NAME_ENCODING}" SHARED ${SOURCE_FILES_ENCODING})
  456. target_link_libraries("${MODULE_NAME_ENCODING}" ${MODULE_NAME_CORE})
  457. set_target_properties("${MODULE_NAME_ENCODING}" PROPERTIES DEBUG_POSTFIX "-d")
  458. endif ()
  459. # CLI base64
  460. add_executable(${CLI_NAME_BASE64}
  461. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/encoding/cli/cli-base64-main.cpp)
  462. ##########################################################
  463. # Build Library (event)
  464. ##########################################################
  465. message("${PROJECT_NAME}: Building ${MODULE_NAME_EVENT} library version ${PROJECT_VERSION}...")
  466. if (${LS_STD_BUILD_STATIC})
  467. add_library("${MODULE_NAME_EVENT}" STATIC ${SOURCE_FILES_EVENT})
  468. set_target_properties("${MODULE_NAME_EVENT}" PROPERTIES DEBUG_POSTFIX "-d")
  469. endif ()
  470. if (${LS_STD_BUILD_SHARED})
  471. add_library("${MODULE_NAME_EVENT}" SHARED ${SOURCE_FILES_EVENT})
  472. target_link_libraries("${MODULE_NAME_EVENT}" ${MODULE_NAME_CORE})
  473. set_target_properties("${MODULE_NAME_EVENT}" PROPERTIES DEBUG_POSTFIX "-d")
  474. endif ()
  475. ##########################################################
  476. # Build Library (io)
  477. ##########################################################
  478. message("${PROJECT_NAME}: Building ${MODULE_NAME_IO} library version ${PROJECT_VERSION}...")
  479. if (${LS_STD_BUILD_STATIC})
  480. add_library("${MODULE_NAME_IO}" STATIC ${SOURCE_FILES_IO})
  481. set_target_properties("${MODULE_NAME_IO}" PROPERTIES DEBUG_POSTFIX "-d")
  482. endif ()
  483. if (${LS_STD_BUILD_SHARED})
  484. add_library("${MODULE_NAME_IO}" SHARED ${SOURCE_FILES_IO})
  485. target_link_libraries("${MODULE_NAME_IO}" ${MODULE_NAME_CORE})
  486. set_target_properties("${MODULE_NAME_IO}" PROPERTIES DEBUG_POSTFIX "-d")
  487. endif ()
  488. ##########################################################
  489. # Build Library (time)
  490. ##########################################################
  491. message("${PROJECT_NAME}: Building ${MODULE_NAME_TIME} library version ${PROJECT_VERSION}...")
  492. if (${LS_STD_BUILD_STATIC})
  493. add_library("${MODULE_NAME_TIME}" STATIC ${SOURCE_FILES_TIME})
  494. set_target_properties("${MODULE_NAME_TIME}" PROPERTIES DEBUG_POSTFIX "-d")
  495. endif ()
  496. if (${LS_STD_BUILD_SHARED})
  497. add_library("${MODULE_NAME_TIME}" SHARED ${SOURCE_FILES_TIME})
  498. target_link_libraries("${MODULE_NAME_TIME}" ${MODULE_NAME_CORE})
  499. set_target_properties("${MODULE_NAME_TIME}" PROPERTIES DEBUG_POSTFIX "-d")
  500. endif ()
  501. ####################################################################################################################
  502. ####################################################################################################################
  503. ####################################################################################################################
  504. # Unit Test Suite: Linking
  505. ####################################################################################################################
  506. ####################################################################################################################
  507. ####################################################################################################################
  508. ##########################################################
  509. # Unit Linking (boxing)
  510. ##########################################################
  511. if (${LS_STD_BUILD_WITH_TESTS})
  512. message("${MODULE_NAME_BOXING}: Linking libraries for unit test application...")
  513. target_link_libraries(${MODULE_NAME_BOXING}-unit-test
  514. gtest
  515. gtest_main
  516. "${MODULE_NAME_BOXING}"
  517. "${MODULE_NAME_CORE}")
  518. endif ()
  519. ##########################################################
  520. # Unit Linking (core)
  521. ##########################################################
  522. if (${LS_STD_BUILD_WITH_TESTS})
  523. message("${MODULE_NAME_CORE}: Linking libraries for unit test application...")
  524. target_link_libraries(${MODULE_NAME_CORE}-unit-test
  525. gtest
  526. gmock
  527. gtest_main
  528. "${MODULE_NAME_CORE}")
  529. endif ()
  530. ##########################################################
  531. # Unit Linking (encoding)
  532. ##########################################################
  533. if (${LS_STD_BUILD_WITH_TESTS})
  534. message("${MODULE_NAME_ENCODING}: Linking libraries for unit test application...")
  535. target_link_libraries(${MODULE_NAME_ENCODING}-unit-test
  536. gtest
  537. gtest_main
  538. "${MODULE_NAME_ENCODING}"
  539. "${MODULE_NAME_CORE}")
  540. endif ()
  541. ##########################################################
  542. # Unit Linking (event)
  543. ##########################################################
  544. if (${LS_STD_BUILD_WITH_TESTS})
  545. message("${MODULE_NAME_EVENT}: Linking libraries for unit test application...")
  546. target_link_libraries(${MODULE_NAME_EVENT}-unit-test
  547. gtest
  548. gtest_main
  549. "${MODULE_NAME_EVENT}"
  550. "${MODULE_NAME_CORE}")
  551. endif ()
  552. ##########################################################
  553. # Unit Linking (io)
  554. ##########################################################
  555. if (${LS_STD_BUILD_WITH_TESTS})
  556. message("${MODULE_NAME_IO}: Linking libraries for unit test application...")
  557. target_link_libraries(${MODULE_NAME_IO}-unit-test
  558. gtest
  559. gmock
  560. gtest_main
  561. "${MODULE_NAME_IO}"
  562. "${MODULE_NAME_CORE}")
  563. endif ()
  564. ##########################################################
  565. # Unit Linking (time)
  566. ##########################################################
  567. if (${LS_STD_BUILD_WITH_TESTS})
  568. message("${MODULE_NAME_TIME}: Linking libraries for unit test application...")
  569. target_link_libraries(${MODULE_NAME_TIME}-unit-test
  570. gtest
  571. gtest_main
  572. "${MODULE_NAME_TIME}"
  573. "${MODULE_NAME_CORE}")
  574. endif ()
  575. ##########################################################
  576. # Unit Linking (all)
  577. ##########################################################
  578. if (${LS_STD_BUILD_WITH_TESTS})
  579. message("${PROJECT_NAME}: Linking libraries for unit test application...")
  580. target_link_libraries(${PROJECT_NAME}-unit-test
  581. gtest
  582. gmock
  583. gtest_main
  584. "${MODULE_NAME_BOXING}"
  585. "${MODULE_NAME_ENCODING}"
  586. "${MODULE_NAME_EVENT}"
  587. "${MODULE_NAME_IO}"
  588. "${MODULE_NAME_TIME}"
  589. "${MODULE_NAME_CORE}")
  590. endif ()
  591. ####################################################################################################################
  592. ####################################################################################################################
  593. ####################################################################################################################
  594. # Integration Test Suite: Linking
  595. ####################################################################################################################
  596. ####################################################################################################################
  597. ####################################################################################################################
  598. ##########################################################
  599. # Integration Linking (io)
  600. ##########################################################
  601. if (${LS_STD_BUILD_WITH_TESTS})
  602. message("${MODULE_NAME_IO}: Linking libraries for integration test application...")
  603. target_link_libraries(${MODULE_NAME_IO}-integration-test
  604. gtest
  605. gtest_main
  606. "${MODULE_NAME_IO}"
  607. "${MODULE_NAME_CORE}")
  608. endif ()
  609. ####################################################################################################################
  610. ####################################################################################################################
  611. ####################################################################################################################
  612. # Whole Test Suite: Linking
  613. ####################################################################################################################
  614. ####################################################################################################################
  615. ####################################################################################################################
  616. if (${LS_STD_BUILD_WITH_TESTS})
  617. message("${PROJECT_NAME}: Linking libraries for whole test application...")
  618. target_link_libraries(${PROJECT_NAME}-test
  619. gtest
  620. gmock
  621. gtest_main
  622. "${MODULE_NAME_BOXING}"
  623. "${MODULE_NAME_ENCODING}"
  624. "${MODULE_NAME_EVENT}"
  625. "${MODULE_NAME_IO}"
  626. "${MODULE_NAME_TIME}"
  627. "${MODULE_NAME_CORE}")
  628. endif ()
  629. ####################################################################################################################
  630. ####################################################################################################################
  631. ####################################################################################################################
  632. # CLI - Base64: Linking
  633. ####################################################################################################################
  634. ####################################################################################################################
  635. ####################################################################################################################
  636. target_link_libraries(${CLI_NAME_BASE64}
  637. "${MODULE_NAME_ENCODING}"
  638. "${MODULE_NAME_CORE}")