CMakeLists.txt 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. ######################################################
  18. # Add Other CMake Dependencies
  19. ######################################################
  20. message("${PROJECT_NAME}: Adding additional cmake dependencies...")
  21. add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/test/lib/googletest-1.8.1)
  22. ##########################################################
  23. # Source Files
  24. ##########################################################
  25. set(SOURCE_FILES
  26. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Integer.hpp
  27. ${CMAKE_CURRENT_SOURCE_DIR}/source/base/Class.hpp
  28. ${CMAKE_CURRENT_SOURCE_DIR}/source/base/Class.cpp
  29. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Integer.cpp
  30. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/IBoxing.hpp
  31. ${CMAKE_CURRENT_SOURCE_DIR}/source/exception/IllegalArithmeticOperationException.hpp
  32. ${CMAKE_CURRENT_SOURCE_DIR}/source/base/Types.hpp
  33. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Boolean.hpp
  34. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Boolean.cpp
  35. ${CMAKE_CURRENT_SOURCE_DIR}/source/exception/IllegalArgumentException.hpp
  36. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Float.hpp
  37. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Float.cpp
  38. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Double.hpp
  39. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Double.cpp
  40. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/String.hpp
  41. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/String.cpp
  42. ${CMAKE_CURRENT_SOURCE_DIR}/source/time/Date.hpp
  43. ${CMAKE_CURRENT_SOURCE_DIR}/source/time/Date.cpp
  44. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/File.hpp
  45. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/File.cpp
  46. ${CMAKE_CURRENT_SOURCE_DIR}/source/exception/FileOperationException.hpp
  47. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FilePathSeparatorMatch.hpp
  48. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FilePathSeparator.hpp
  49. ${CMAKE_CURRENT_SOURCE_DIR}/source/utils/STLUtils.hpp
  50. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Long.hpp
  51. ${CMAKE_CURRENT_SOURCE_DIR}/source/boxing/Long.cpp
  52. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/IWriter.hpp
  53. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FileWriter.hpp
  54. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FileWriter.cpp
  55. ${CMAKE_CURRENT_SOURCE_DIR}/source/exception/FileNotFoundException.hpp
  56. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/IReader.hpp
  57. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FileReader.hpp
  58. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/FileReader.cpp
  59. ${CMAKE_CURRENT_SOURCE_DIR}/source/io/NewLine.hpp
  60. ${CMAKE_CURRENT_SOURCE_DIR}/source/utils/RegexUtils.hpp)
  61. set(TEST_FILES
  62. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/IntegerTest.cpp
  63. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/BooleanTest.cpp
  64. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/FloatTest.cpp
  65. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/DoubleTest.cpp
  66. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/StringTest.cpp
  67. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/time/DateTest.cpp
  68. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileTest.cpp
  69. ${CMAKE_CURRENT_SOURCE_DIR}/test/TestHelper.hpp
  70. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/base/ClassTest.cpp
  71. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/utils/STLUtilsTest.cpp
  72. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/boxing/LongTest.cpp
  73. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileWriterTest.cpp
  74. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileReaderTest.cpp
  75. ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/utils/RegexUtilsTest.cpp)
  76. ##########################################################
  77. # Build
  78. ##########################################################
  79. message("${PROJECT_NAME}: Building...")
  80. add_executable(${PROJECT_NAME}_test ${TEST_FILES})
  81. add_library(${PROJECT_NAME} ${SOURCE_FILES})
  82. ##########################################################
  83. # Linking
  84. ##########################################################
  85. message("${PROJECT_NAME}: Linking...")
  86. target_link_libraries(${PROJECT_NAME}_test gtest gtest_main ls_std)