CMakeLists.txt 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. ExplicitExpressions.cpp
  15. ExplicitExpressions.h
  16. )
  17. target_link_libraries(
  18. OrthPolTEST
  19. GTest::gtest_main
  20. )
  21. target_include_directories(OrthPolTEST PUBLIC ${PROJECT_SOURCE_DIR})
  22. include(GoogleTest)
  23. gtest_discover_tests(OrthPolTEST)
  24. # cmake_minimum_required(VERSION 3.0)
  25. # project(OrthPolTEST)
  26. # find_package(GTest REQUIRED)
  27. # find_package(Threads REQUIRED)
  28. # set(CMAKE_CXX_STANDARD 11)
  29. # set(CMAKE_CXX_STANDARD_REQUIRED on)
  30. # include_directories(
  31. # ${GTEST_INCLUDE_DIRS}
  32. # )
  33. # add_executable(
  34. # OrthPolTEST ./OrthPolTEST.cpp
  35. # )
  36. # target_link_libraries(
  37. # OrthPolTEST ${GTEST_LIBRARIES} Threads::Threads)
  38. # enable_testing()
  39. # add_test(OrthPolTEST "./OrthPolTEST")