CMakeLists.txt 1017 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. include(FetchContent)
  2. FetchContent_Declare(
  3. googletest
  4. GIT_REPOSITORY https://github.com/google/googletest.git
  5. GIT_TAG release-1.12.1
  6. )
  7. # For Windows: Prevent overriding the parent project's compiler/linker settings
  8. set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
  9. FetchContent_MakeAvailable(googletest)
  10. enable_testing()
  11. add_executable(
  12. OrthPolTEST
  13. OrthPolTEST.cpp
  14. )
  15. target_link_libraries(
  16. OrthPolTEST
  17. GTest::gtest_main
  18. )
  19. target_include_directories(OrthPolTEST PUBLIC ${PROJECT_SOURCE_DIR})
  20. include(GoogleTest)
  21. gtest_discover_tests(OrthPolTEST)
  22. # cmake_minimum_required(VERSION 3.0)
  23. # project(OrthPolTEST)
  24. # find_package(GTest REQUIRED)
  25. # find_package(Threads REQUIRED)
  26. # set(CMAKE_CXX_STANDARD 11)
  27. # set(CMAKE_CXX_STANDARD_REQUIRED on)
  28. # include_directories(
  29. # ${GTEST_INCLUDE_DIRS}
  30. # )
  31. # add_executable(
  32. # OrthPolTEST ./OrthPolTEST.cpp
  33. # )
  34. # target_link_libraries(
  35. # OrthPolTEST ${GTEST_LIBRARIES} Threads::Threads)
  36. # enable_testing()
  37. # add_test(OrthPolTEST "./OrthPolTEST")