include(FetchContent) FetchContent_Declare( googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG release-1.12.1 ) # For Windows: Prevent overriding the parent project's compiler/linker settings set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) FetchContent_MakeAvailable(googletest) enable_testing() add_executable( OrthPolTEST OrthPolTEST.cpp ExplicitExpressions.cpp ExplicitExpressions.h ) target_link_libraries( OrthPolTEST GTest::gtest_main ) target_include_directories(OrthPolTEST PUBLIC ${PROJECT_SOURCE_DIR}) include(GoogleTest) gtest_discover_tests(OrthPolTEST) # cmake_minimum_required(VERSION 3.0) # project(OrthPolTEST) # find_package(GTest REQUIRED) # find_package(Threads REQUIRED) # set(CMAKE_CXX_STANDARD 11) # set(CMAKE_CXX_STANDARD_REQUIRED on) # include_directories( # ${GTEST_INCLUDE_DIRS} # ) # add_executable( # OrthPolTEST ./OrthPolTEST.cpp # ) # target_link_libraries( # OrthPolTEST ${GTEST_LIBRARIES} Threads::Threads) # enable_testing() # add_test(OrthPolTEST "./OrthPolTEST")