CMakeLists.txt 47 KB

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