Fixed CMake warning when tests are enabled