Building tests with CMake while not using CTest
问题 Here is what I want to do: Typing make all will build my library and the docs for it. Typing make test will build my lib (if necessary), gtest and then my tests Typing make check runs make test if needed and then runs the executable Right now I've only managed to get the first to work. The problem I'm having is the conditional include of gtest. Gtest uses CMake which is nice, in theory all I need to do is to include the gtest directory with add_subdirectory but then gtest will always be built