No tests found when using gtest with cmake/ctest

后端 未结 2 755
南笙
南笙 2020-12-16 16:57

I have a project with the following structure:

linalg
├── build
├── CMakeLists.txt
├── docs
│   └── Doxyfile
├── include
│   └── linalg
│       └── vector3.h         


        
2条回答
  •  悲&欢浪女
    2020-12-16 17:24

    The crux of the problem is that enable_testing should be called from your top-level CMakeLists.txt in this case. Adding include(CTest) to your top-level CMakeLists.txt should fix this for you.

    This would allow you to remove the enable_testing call in test/CMakeLists.txt, since the CTest submodule calls enable_testing internally.

提交回复
热议问题