Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown CMake command "gtest_discover_tests" #2

Open
mnchapel opened this issue Jul 26, 2022 · 0 comments
Open

Unknown CMake command "gtest_discover_tests" #2

mnchapel opened this issue Jul 26, 2022 · 0 comments

Comments

@mnchapel
Copy link

Hi @josephgarnier

I got the following error when I activate the Test Generator Module and run CMake:

CMake Error at cmake/helpers/TestGenModule.cmake:215 (gtest_discover_tests):
  Unknown CMake command "gtest_discover_tests".

Please add include(GoogleTest) before gtest_discover_tests at the end of the cmake/helpers/TestGenModule.cmake file:

include(GoogleTest)

# Automatically add tests by querying the compiled test executable for available tests
message(STATUS "Discover and add tests to the target \"${${PROJECT_NAME}_TEST_BIN_TARGET}.\"")
gtest_discover_tests("${${PROJECT_NAME}_TEST_BIN_TARGET}"
	WORKING_DIRECTORY "${${PROJECT_NAME}_TESTS_DIR}"
)

Thank you,
MN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant