CMakeLists.txt 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  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.1.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/ExceptionMessage.cpp
  108. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/FileNotFoundException.cpp
  109. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/FileOperationException.cpp
  110. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/IllegalArgumentException.cpp
  111. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/IllegalArithmeticOperationException.cpp
  112. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/IncompleteJsonException.cpp
  113. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/IndexOutOfBoundsException.cpp
  114. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/NullPointerException.cpp
  115. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/WrongCallException.cpp
  116. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IBoxing.cpp
  117. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IEncoding.cpp
  118. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IEvaluator.cpp
  119. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IEventSubscriber.cpp
  120. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IListener.cpp
  121. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IReader.cpp
  122. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/ISerializable.cpp
  123. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IStorable.cpp
  124. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IValidator.cpp
  125. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IWriter.cpp
  126. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/Class.cpp
  127. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/ConditionalFunctionExecutor.cpp
  128. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/LibraryVersion.cpp
  129. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/Version.cpp)
  130. set(SOURCE_FILES_ENCODING
  131. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/encoding/Base64.cpp)
  132. set(SOURCE_FILES_EVENT
  133. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/event/serialization/SerializableJsonEvent.cpp
  134. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/event/Event.cpp
  135. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/event/EventHandler.cpp
  136. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/event/EventManager.cpp
  137. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/event/Narrator.cpp)
  138. set(SOURCE_FILES_IO
  139. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/logging/Logger.cpp
  140. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/logging/LogLevel.cpp
  141. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairIdentifierArgumentEvaluator.cpp
  142. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairRowArgumentEvaluator.cpp
  143. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairRowListValueArgumentEvaluator.cpp
  144. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairRowSingleValueArgumentEvaluator.cpp
  145. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairSectionArgumentEvaluator.cpp
  146. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/evaluator/SectionPairValueArgumentEvaluator.cpp
  147. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairDocument.cpp
  148. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairRow.cpp
  149. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairRowListValue.cpp
  150. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairRowSingleValue.cpp
  151. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairRowValue.cpp
  152. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/model/SectionPairSection.cpp
  153. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairIdentifierValidator.cpp
  154. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairRowListValueValidator.cpp
  155. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairRowSingleValueValidator.cpp
  156. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairRowValidator.cpp
  157. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairSectionValidator.cpp
  158. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/validator/SectionPairValueValidator.cpp
  159. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairDocument.cpp
  160. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairParameter.cpp
  161. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairRow.cpp
  162. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairRowListValue.cpp
  163. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairRowSingleValue.cpp
  164. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/section-pair/serialization/SerializableSectionPairSection.cpp
  165. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlAttribute.cpp
  166. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlDeclaration.cpp
  167. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlDocument.cpp
  168. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlNode.cpp
  169. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlParseParameter.cpp
  170. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlParser.cpp
  171. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/xml/XmlReader.cpp
  172. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/File.cpp
  173. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FileOutputStream.cpp
  174. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FilePathSeparator.cpp
  175. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FilePathSeparatorMatch.cpp
  176. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FileReader.cpp
  177. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/FileWriter.cpp
  178. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/NewLine.cpp
  179. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/StandardOutputWriter.cpp
  180. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/io/StorableFile.cpp)
  181. set(SOURCE_FILES_TIME
  182. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/time/Date.cpp)
  183. ####################################################################################################################
  184. ####################################################################################################################
  185. ####################################################################################################################
  186. # Test Files Modularization
  187. ####################################################################################################################
  188. ####################################################################################################################
  189. ####################################################################################################################
  190. if (${LS_STD_BUILD_WITH_TESTS})
  191. set(TEST_FILES_BOXING
  192. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/BooleanTest.cpp
  193. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/DoubleTest.cpp
  194. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/FloatTest.cpp
  195. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/IntegerTest.cpp
  196. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/LongTest.cpp
  197. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/StringTest.cpp)
  198. set(TEST_FILES_CORE
  199. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/evaluator/EmptyStringArgumentEvaluatorTest.cpp
  200. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/evaluator/IndexOutOfBoundsEvaluatorTest.cpp
  201. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/evaluator/NullPointerArgumentEvaluatorTest.cpp
  202. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/evaluator/NullPointerEvaluatorTest.cpp
  203. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/EventNotHandledExceptionTest.cpp
  204. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/EventNotSubscribedExceptionTest.cpp
  205. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/ExceptionMessageTest.cpp
  206. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/FileNotFoundExceptionTest.cpp
  207. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/FileOperationExceptionTest.cpp
  208. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IllegalArgumentExceptionTest.cpp
  209. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IllegalArithmeticOperationExceptionTest.cpp
  210. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IncompleteJsonExceptionTest.cpp
  211. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IndexOutOfBoundsExceptionTest.cpp
  212. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/NullPointerExceptionTest.cpp
  213. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/WrongCallExceptionTest.cpp
  214. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/ClassTest.cpp
  215. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/ConditionalFunctionExecutorTest.cpp
  216. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/LibraryVersionTest.cpp
  217. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/VersionTest.cpp
  218. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/core/ClassWrapper.cpp
  219. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/core/MathOddValidator.cpp)
  220. set(TEST_FILES_ENCODING
  221. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/encoding/Base64Test.cpp)
  222. set(TEST_FILES_EVENT
  223. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/serialization/SerializableJsonEventTest.cpp
  224. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/EventHandlerTest.cpp
  225. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/EventManagerTest.cpp
  226. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/EventTest.cpp
  227. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/event/NarratorTest.cpp
  228. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/Colour.cpp
  229. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/DailyNewsAgency.cpp
  230. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/GossipNewsAgency.cpp
  231. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/GossipNewsEvent.cpp
  232. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/NewsAgency.cpp
  233. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/SeriousNewsEvent.cpp
  234. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/TestDataCar.cpp
  235. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/event/TestDataMercedesCar.cpp)
  236. set(TEST_FILES_IO
  237. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/logging/LoggerTest.cpp
  238. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/logging/LogLevelTest.cpp
  239. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairIdentifierArgumentEvaluatorTest.cpp
  240. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairRowArgumentEvaluatorTest.cpp
  241. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairRowListValueArgumentEvaluatorTest.cpp
  242. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairRowSingleValueArgumentEvaluatorTest.cpp
  243. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairSectionArgumentEvaluatorTest.cpp
  244. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/evaluator/SectionPairValueArgumentEvaluatorTest.cpp
  245. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairIdentifierValidatorTest.cpp
  246. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairRowListValueValidatorTest.cpp
  247. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairRowSingleValueValidatorTest.cpp
  248. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairRowValidatorTest.cpp
  249. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairSectionValidatorTest.cpp
  250. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/validator/SectionPairValueValidatorTest.cpp
  251. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/model/SectionPairDocumentTest.cpp
  252. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/model/SectionPairRowListValueTest.cpp
  253. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/model/SectionPairRowSingleValueTest.cpp
  254. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/model/SectionPairRowTest.cpp
  255. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/model/SectionPairSectionTest.cpp
  256. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/serialization/SerializableSectionPairDocumentTest.cpp
  257. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/serialization/SerializableSectionPairParameterTest.cpp
  258. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/serialization/SerializableSectionPairRowListValueTest.cpp
  259. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/serialization/SerializableSectionPairRowSingleValueTest.cpp
  260. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/serialization/SerializableSectionPairRowTest.cpp
  261. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/section-pair/serialization/SerializableSectionPairSectionTest.cpp
  262. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlAttributeTest.cpp
  263. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlDeclarationTest.cpp
  264. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlDocumentTest.cpp
  265. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlNodeTest.cpp
  266. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlParseParameterTest.cpp
  267. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlParserTest.cpp
  268. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlParserTestWrapperTest.cpp
  269. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/xml/XmlReaderTest.cpp
  270. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileOutputStreamTest.cpp
  271. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileReaderTest.cpp
  272. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileTest.cpp
  273. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileWriterTest.cpp
  274. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/StandardOutputWriterTest.cpp
  275. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/StorableFileTest.cpp
  276. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/section-pair/SectionPairDocumentProvider.cpp
  277. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/section-pair/SectionPairSectionProvider.cpp
  278. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/section-pair/SerializableSectionPairRowProvider.cpp
  279. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/xml/TestDataFactory.cpp
  280. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/xml/XmlParserTestWrapper.cpp)
  281. set(TEST_FILES_SERIALIZATION
  282. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/JsonTest.cpp)
  283. set(TEST_FILES_TIME
  284. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/time/DateTest.cpp)
  285. endif ()
  286. ####################################################################################################################
  287. ####################################################################################################################
  288. ####################################################################################################################
  289. # Test Suite Builds
  290. ####################################################################################################################
  291. ####################################################################################################################
  292. ####################################################################################################################
  293. ##########################################################
  294. # Build Tests (boxing)
  295. ##########################################################
  296. if (${LS_STD_BUILD_WITH_TESTS})
  297. message("${MODULE_NAME_BOXING}: Building tests...")
  298. add_executable(${MODULE_NAME_BOXING}-test ${TEST_FILES_BOXING})
  299. endif ()
  300. ##########################################################
  301. # Build Tests (core)
  302. ##########################################################
  303. if (${LS_STD_BUILD_WITH_TESTS})
  304. message("${MODULE_NAME_CORE}: Building tests...")
  305. add_executable(${MODULE_NAME_CORE}-test ${TEST_FILES_CORE})
  306. endif ()
  307. ##########################################################
  308. # Build Tests (encoding)
  309. ##########################################################
  310. if (${LS_STD_BUILD_WITH_TESTS})
  311. message("${MODULE_NAME_ENCODING}: Building tests...")
  312. add_executable(${MODULE_NAME_ENCODING}-test ${TEST_FILES_ENCODING})
  313. endif ()
  314. ##########################################################
  315. # Build Tests (event)
  316. ##########################################################
  317. if (${LS_STD_BUILD_WITH_TESTS})
  318. message("${MODULE_NAME_EVENT}: Building tests...")
  319. add_executable(${MODULE_NAME_EVENT}-test ${TEST_FILES_EVENT})
  320. endif ()
  321. ##########################################################
  322. # Build Tests (io)
  323. ##########################################################
  324. if (${LS_STD_BUILD_WITH_TESTS})
  325. message("${MODULE_NAME_IO}: Building tests...")
  326. add_executable(${MODULE_NAME_IO}-test
  327. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/TestHelper.cpp
  328. ${TEST_FILES_IO})
  329. endif ()
  330. ##########################################################
  331. # Build Tests (time)
  332. ##########################################################
  333. if (${LS_STD_BUILD_WITH_TESTS})
  334. message("${MODULE_NAME_TIME}: Building tests...")
  335. add_executable(${MODULE_NAME_TIME}-test ${TEST_FILES_TIME})
  336. endif ()
  337. ##########################################################
  338. # Build Tests (all)
  339. ##########################################################
  340. if (${LS_STD_BUILD_WITH_TESTS})
  341. message("${PROJECT_NAME}: Building tests...")
  342. add_executable(${PROJECT_NAME}-test
  343. ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/TestHelper.cpp
  344. ${TEST_FILES_BOXING}
  345. ${TEST_FILES_CORE}
  346. ${TEST_FILES_ENCODING}
  347. ${TEST_FILES_EVENT}
  348. ${TEST_FILES_IO}
  349. ${TEST_FILES_SERIALIZATION}
  350. ${TEST_FILES_TIME})
  351. endif ()
  352. ####################################################################################################################
  353. ####################################################################################################################
  354. ####################################################################################################################
  355. # Build Library Binaries
  356. ####################################################################################################################
  357. ####################################################################################################################
  358. ####################################################################################################################
  359. ##########################################################
  360. # Build Library (boxing)
  361. ##########################################################
  362. message("${PROJECT_NAME}: Building ${MODULE_NAME_BOXING} library version ${PROJECT_VERSION}...")
  363. if (${LS_STD_BUILD_STATIC})
  364. add_library("${MODULE_NAME_BOXING}" STATIC ${SOURCE_FILES_BOXING})
  365. set_target_properties("${MODULE_NAME_BOXING}" PROPERTIES DEBUG_POSTFIX "-d")
  366. endif ()
  367. if (${LS_STD_BUILD_SHARED})
  368. add_library("${MODULE_NAME_BOXING}" SHARED ${SOURCE_FILES_BOXING})
  369. target_link_libraries("${MODULE_NAME_BOXING}" ${MODULE_NAME_CORE})
  370. set_target_properties("${MODULE_NAME_BOXING}" PROPERTIES DEBUG_POSTFIX "-d")
  371. endif ()
  372. ##########################################################
  373. # Build Library (core)
  374. ##########################################################
  375. message("${PROJECT_NAME}: Building ${MODULE_NAME_CORE} library version ${PROJECT_VERSION}...")
  376. if (${LS_STD_BUILD_STATIC})
  377. add_library("${MODULE_NAME_CORE}" STATIC ${SOURCE_FILES_CORE})
  378. set_target_properties("${MODULE_NAME_CORE}" PROPERTIES DEBUG_POSTFIX "-d")
  379. endif ()
  380. if (${LS_STD_BUILD_SHARED})
  381. add_library("${MODULE_NAME_CORE}" SHARED ${SOURCE_FILES_CORE})
  382. set_target_properties("${MODULE_NAME_CORE}" PROPERTIES DEBUG_POSTFIX "-d")
  383. endif ()
  384. ##########################################################
  385. # Build Library (encoding)
  386. ##########################################################
  387. message("${PROJECT_NAME}: Building ${MODULE_NAME_ENCODING} library version ${PROJECT_VERSION}...")
  388. if (${LS_STD_BUILD_STATIC})
  389. add_library("${MODULE_NAME_ENCODING}" STATIC ${SOURCE_FILES_ENCODING})
  390. set_target_properties("${MODULE_NAME_ENCODING}" PROPERTIES DEBUG_POSTFIX "-d")
  391. endif ()
  392. if (${LS_STD_BUILD_SHARED})
  393. add_library("${MODULE_NAME_ENCODING}" SHARED ${SOURCE_FILES_ENCODING})
  394. set_target_properties("${MODULE_NAME_ENCODING}" PROPERTIES DEBUG_POSTFIX "-d")
  395. endif ()
  396. # CLI base64
  397. add_executable(${CLI_NAME_BASE64}
  398. ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/encoding/cli/cli-base64-main.cpp)
  399. ##########################################################
  400. # Build Library (event)
  401. ##########################################################
  402. message("${PROJECT_NAME}: Building ${MODULE_NAME_EVENT} library version ${PROJECT_VERSION}...")
  403. if (${LS_STD_BUILD_STATIC})
  404. add_library("${MODULE_NAME_EVENT}" STATIC ${SOURCE_FILES_EVENT})
  405. set_target_properties("${MODULE_NAME_EVENT}" PROPERTIES DEBUG_POSTFIX "-d")
  406. endif ()
  407. if (${LS_STD_BUILD_SHARED})
  408. add_library("${MODULE_NAME_EVENT}" SHARED ${SOURCE_FILES_EVENT})
  409. target_link_libraries("${MODULE_NAME_EVENT}" ${MODULE_NAME_CORE})
  410. set_target_properties("${MODULE_NAME_EVENT}" PROPERTIES DEBUG_POSTFIX "-d")
  411. endif ()
  412. ##########################################################
  413. # Build Library (io)
  414. ##########################################################
  415. message("${PROJECT_NAME}: Building ${MODULE_NAME_IO} library version ${PROJECT_VERSION}...")
  416. if (${LS_STD_BUILD_STATIC})
  417. add_library("${MODULE_NAME_IO}" STATIC ${SOURCE_FILES_IO})
  418. set_target_properties("${MODULE_NAME_IO}" PROPERTIES DEBUG_POSTFIX "-d")
  419. endif ()
  420. if (${LS_STD_BUILD_SHARED})
  421. add_library("${MODULE_NAME_IO}" SHARED ${SOURCE_FILES_IO})
  422. target_link_libraries("${MODULE_NAME_IO}" ${MODULE_NAME_CORE})
  423. set_target_properties("${MODULE_NAME_IO}" PROPERTIES DEBUG_POSTFIX "-d")
  424. endif ()
  425. ##########################################################
  426. # Build Library (time)
  427. ##########################################################
  428. message("${PROJECT_NAME}: Building ${MODULE_NAME_TIME} library version ${PROJECT_VERSION}...")
  429. if (${LS_STD_BUILD_STATIC})
  430. add_library("${MODULE_NAME_TIME}" STATIC ${SOURCE_FILES_TIME})
  431. set_target_properties("${MODULE_NAME_TIME}" PROPERTIES DEBUG_POSTFIX "-d")
  432. endif ()
  433. if (${LS_STD_BUILD_SHARED})
  434. add_library("${MODULE_NAME_TIME}" SHARED ${SOURCE_FILES_TIME})
  435. target_link_libraries("${MODULE_NAME_TIME}" ${MODULE_NAME_CORE})
  436. set_target_properties("${MODULE_NAME_TIME}" PROPERTIES DEBUG_POSTFIX "-d")
  437. endif ()
  438. ####################################################################################################################
  439. ####################################################################################################################
  440. ####################################################################################################################
  441. # Test Suite: Linking
  442. ####################################################################################################################
  443. ####################################################################################################################
  444. ####################################################################################################################
  445. ##########################################################
  446. # Linking (boxing)
  447. ##########################################################
  448. if (${LS_STD_BUILD_WITH_TESTS})
  449. message("${MODULE_NAME_BOXING}: Linking libraries for test application...")
  450. target_link_libraries(${MODULE_NAME_BOXING}-test
  451. gtest
  452. gmock
  453. gtest_main
  454. "${MODULE_NAME_BOXING}"
  455. "${MODULE_NAME_CORE}")
  456. endif ()
  457. ##########################################################
  458. # Linking (core)
  459. ##########################################################
  460. if (${LS_STD_BUILD_WITH_TESTS})
  461. message("${MODULE_NAME_CORE}: Linking libraries for test application...")
  462. target_link_libraries(${MODULE_NAME_CORE}-test
  463. gtest
  464. gmock
  465. gtest_main
  466. "${MODULE_NAME_CORE}")
  467. endif ()
  468. ##########################################################
  469. # Linking (encoding)
  470. ##########################################################
  471. if (${LS_STD_BUILD_WITH_TESTS})
  472. message("${MODULE_NAME_ENCODING}: Linking libraries for test application...")
  473. target_link_libraries(${MODULE_NAME_ENCODING}-test
  474. gtest
  475. gmock
  476. gtest_main
  477. "${MODULE_NAME_ENCODING}"
  478. "${MODULE_NAME_CORE}")
  479. endif ()
  480. ##########################################################
  481. # Linking (event)
  482. ##########################################################
  483. if (${LS_STD_BUILD_WITH_TESTS})
  484. message("${MODULE_NAME_EVENT}: Linking libraries for test application...")
  485. target_link_libraries(${MODULE_NAME_EVENT}-test
  486. gtest
  487. gmock
  488. gtest_main
  489. "${MODULE_NAME_EVENT}"
  490. "${MODULE_NAME_CORE}")
  491. endif ()
  492. ##########################################################
  493. # Linking (io)
  494. ##########################################################
  495. if (${LS_STD_BUILD_WITH_TESTS})
  496. message("${MODULE_NAME_IO}: Linking libraries for test application...")
  497. target_link_libraries(${MODULE_NAME_IO}-test
  498. gtest
  499. gmock
  500. gtest_main
  501. "${MODULE_NAME_IO}"
  502. "${MODULE_NAME_CORE}")
  503. endif ()
  504. ##########################################################
  505. # Linking (time)
  506. ##########################################################
  507. if (${LS_STD_BUILD_WITH_TESTS})
  508. message("${MODULE_NAME_TIME}: Linking libraries for test application...")
  509. target_link_libraries(${MODULE_NAME_TIME}-test
  510. gtest
  511. gmock
  512. gtest_main
  513. "${MODULE_NAME_TIME}"
  514. "${MODULE_NAME_CORE}")
  515. endif ()
  516. ##########################################################
  517. # Linking (all)
  518. ##########################################################
  519. if (${LS_STD_BUILD_WITH_TESTS})
  520. message("${PROJECT_NAME}: Linking libraries for test application...")
  521. target_link_libraries(${PROJECT_NAME}-test
  522. gtest
  523. gmock
  524. gtest_main
  525. "${MODULE_NAME_BOXING}"
  526. "${MODULE_NAME_ENCODING}"
  527. "${MODULE_NAME_EVENT}"
  528. "${MODULE_NAME_IO}"
  529. "${MODULE_NAME_TIME}"
  530. "${MODULE_NAME_CORE}")
  531. endif ()
  532. ####################################################################################################################
  533. ####################################################################################################################
  534. ####################################################################################################################
  535. # CLI - Base64: Linking
  536. ####################################################################################################################
  537. ####################################################################################################################
  538. ####################################################################################################################
  539. target_link_libraries(${CLI_NAME_BASE64}
  540. "${MODULE_NAME_ENCODING}"
  541. "${MODULE_NAME_CORE}")