CMakeLists.txt 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. set(TEST_FILES
  80. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/IntegerTest.cpp
  81. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/BooleanTest.cpp
  82. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/FloatTest.cpp
  83. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/DoubleTest.cpp
  84. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/StringTest.cpp
  85. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/time/DateTest.cpp
  86. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileTest.cpp
  87. ${CMAKE_CURRENT_SOURCE_DIR}/test/TestHelper.hpp
  88. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/base/ClassTest.cpp
  89. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/utils/STLUtilsTest.cpp
  90. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/LongTest.cpp
  91. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileWriterTest.cpp
  92. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileReaderTest.cpp
  93. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/utils/RegexUtilsTest.cpp
  94. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/StorableFileTest.cpp
  95. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileOutputStreamTest.cpp
  96. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/logging/LoggerTest.cpp
  97. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/JSONTest.cpp
  98. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/boxing/SerializableJSONIntegerTest.cpp
  99. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/boxing/SerializableJSONLongTest.cpp
  100. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/serialization/boxing/SerializableJSONStringTest.cpp)
  101. ##########################################################
  102. # Build
  103. ##########################################################
  104. message("${PROJECT_NAME}: Building...")
  105. add_executable(${PROJECT_NAME}_test ${TEST_FILES})
  106. add_library(${PROJECT_NAME} ${SOURCE_FILES})
  107. ##########################################################
  108. # Linking
  109. ##########################################################
  110. message("${PROJECT_NAME}: Linking...")
  111. target_link_libraries(${PROJECT_NAME}_test gtest gtest_main ls_std)