CMakeLists.txt 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. ##########################################################
  2. # Basic
  3. ##########################################################
  4. cmake_minimum_required(VERSION 3.17)
  5. set(PROJECT_NAME ls_std)
  6. project(${PROJECT_NAME})
  7. ##########################################################
  8. # Compiler
  9. ##########################################################
  10. message("${PROJECT_NAME}: Setting compiler flags...")
  11. set(CMAKE_CXX_STANDARD 11)
  12. ######################################################
  13. # Include Directories
  14. ######################################################
  15. message("${PROJECT_NAME}: Adding include directories...")
  16. include_directories(${CMAKE_CURRENT_LIST_DIR}/test/lib/googletest-1.8.1/googletest/include)
  17. include_directories(${CMAKE_CURRENT_LIST_DIR}/source/lib/nlohmann_json/include/nlohmann)
  18. ######################################################
  19. # Add Other CMake Dependencies
  20. ######################################################
  21. message("${PROJECT_NAME}: Adding additional cmake dependencies...")
  22. add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/test/lib/googletest-1.8.1)
  23. ##########################################################
  24. # Source Files
  25. ##########################################################
  26. set(SOURCE_FILES
  27. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Integer.hpp
  28. ${CMAKE_CURRENT_SOURCE_DIR}/source/base/Class.hpp
  29. ${CMAKE_CURRENT_SOURCE_DIR}/source/base/Class.cpp
  30. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Integer.cpp
  31. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/IBoxing.hpp
  32. ${CMAKE_CURRENT_SOURCE_DIR}/source/exception/IllegalArithmeticOperationException.hpp
  33. ${CMAKE_CURRENT_SOURCE_DIR}/source/base/Types.hpp
  34. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Boolean.hpp
  35. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Boolean.cpp
  36. ${CMAKE_CURRENT_SOURCE_DIR}/source/exception/IllegalArgumentException.hpp
  37. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Float.hpp
  38. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Float.cpp
  39. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Double.hpp
  40. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Double.cpp
  41. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/String.hpp
  42. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/String.cpp
  43. ${CMAKE_CURRENT_SOURCE_DIR}/source/time/Date.hpp
  44. ${CMAKE_CURRENT_SOURCE_DIR}/source/time/Date.cpp
  45. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/File.hpp
  46. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/File.cpp
  47. ${CMAKE_CURRENT_SOURCE_DIR}/source/exception/FileOperationException.hpp
  48. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FilePathSeparatorMatch.hpp
  49. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FilePathSeparator.hpp
  50. ${CMAKE_CURRENT_SOURCE_DIR}/source/utils/STLUtils.hpp
  51. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Long.hpp
  52. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Long.cpp
  53. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/IWriter.hpp
  54. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FileWriter.hpp
  55. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FileWriter.cpp
  56. ${CMAKE_CURRENT_SOURCE_DIR}/source/exception/FileNotFoundException.hpp
  57. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/IReader.hpp
  58. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FileReader.hpp
  59. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FileReader.cpp
  60. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/NewLine.hpp
  61. ${CMAKE_CURRENT_SOURCE_DIR}/source/utils/RegexUtils.hpp
  62. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/IStorable.hpp
  63. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/StorableFile.hpp
  64. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/StorableFile.cpp
  65. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/logging/LogLevel.hpp
  66. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FileOutputStream.hpp
  67. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FileOutputStream.cpp
  68. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/logging/Logger.hpp
  69. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/logging/Logger.cpp
  70. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/logging/LogLevel.cpp
  71. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/logging/LogLevelValue.hpp
  72. ${CMAKE_CURRENT_SOURCE_DIR}/source/serialization/ISerializable.hpp
  73. ${CMAKE_CURRENT_SOURCE_DIR}/source/serialization/boxing/SerializableJSONInteger.hpp
  74. ${CMAKE_CURRENT_SOURCE_DIR}/source/serialization/boxing/SerializableJSONInteger.cpp
  75. ${CMAKE_CURRENT_SOURCE_DIR}/source/serialization/boxing/SerializableJSONLong.hpp
  76. ${CMAKE_CURRENT_SOURCE_DIR}/source/serialization/boxing/SerializableJSONLong.cpp
  77. ${CMAKE_CURRENT_SOURCE_DIR}/source/serialization/boxing/SerializableJSONString.hpp
  78. ${CMAKE_CURRENT_SOURCE_DIR}/source/serialization/boxing/SerializableJSONString.cpp
  79. ${CMAKE_CURRENT_SOURCE_DIR}/source/serialization/boxing/SerializableJSONFloat.hpp
  80. ${CMAKE_CURRENT_SOURCE_DIR}/source/serialization/boxing/SerializableJSONFloat.cpp
  81. ${CMAKE_CURRENT_SOURCE_DIR}/source/serialization/boxing/SerializableJSONDouble.hpp
  82. ${CMAKE_CURRENT_SOURCE_DIR}/source/serialization/boxing/SerializableJSONDouble.cpp
  83. ${CMAKE_CURRENT_SOURCE_DIR}/source/serialization/boxing/SerializableJSONBoolean.hpp
  84. ${CMAKE_CURRENT_SOURCE_DIR}/source/serialization/boxing/SerializableJSONBoolean.cpp
  85. ${CMAKE_CURRENT_SOURCE_DIR}/source/logic/StateMachine.hpp
  86. ${CMAKE_CURRENT_SOURCE_DIR}/source/logic/StateMachine.cpp
  87. ${CMAKE_CURRENT_SOURCE_DIR}/source/logic/State.hpp
  88. ${CMAKE_CURRENT_SOURCE_DIR}/source/logic/State.cpp)
  89. set(TEST_FILES
  90. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/IntegerTest.cpp
  91. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/BooleanTest.cpp
  92. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/FloatTest.cpp
  93. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/DoubleTest.cpp
  94. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/StringTest.cpp
  95. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/time/DateTest.cpp
  96. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileTest.cpp
  97. ${CMAKE_CURRENT_SOURCE_DIR}/test/TestHelper.hpp
  98. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/base/ClassTest.cpp
  99. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/utils/STLUtilsTest.cpp
  100. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/LongTest.cpp
  101. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileWriterTest.cpp
  102. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileReaderTest.cpp
  103. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/utils/RegexUtilsTest.cpp
  104. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/StorableFileTest.cpp
  105. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileOutputStreamTest.cpp
  106. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/logging/LoggerTest.cpp
  107. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/JSONTest.cpp
  108. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/boxing/SerializableJSONIntegerTest.cpp
  109. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/boxing/SerializableJSONLongTest.cpp
  110. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/boxing/SerializableJSONStringTest.cpp
  111. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/boxing/SerializableJSONFloatTest.cpp
  112. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/boxing/SerializableJSONDoubleTest.cpp
  113. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/boxing/SerializableJSONBooleanTest.cpp
  114. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/logic/StateTest.cpp)
  115. ##########################################################
  116. # Build
  117. ##########################################################
  118. message("${PROJECT_NAME}: Building...")
  119. add_executable(${PROJECT_NAME}_test ${TEST_FILES})
  120. add_library(${PROJECT_NAME} ${SOURCE_FILES})
  121. ##########################################################
  122. # Linking
  123. ##########################################################
  124. message("${PROJECT_NAME}: Linking...")
  125. target_link_libraries(${PROJECT_NAME}_test gtest gtest_main ls_std)