[CMake] problem: No test configuration file found!

Robert Ramey ramey at rrsd.com
Tue Jun 19 17:19:14 EDT 2012


I'm working through my first CMake/CTest project.

My directory structure looks like

safe_numerics/
    CMakeLists.txt // #1
    build/ // out of source build directory
    include/
    examples/
    doc/
    tests/
        CMakeLists.txt // #2


#1 looks like
cmake_minimum_required(VERSION 2.6)
project(safe_numerics)
if(MSVC)
add_definitions(
    /Gy
    /wd4244 # converting 'std::streamsize' in 'size_t'
    /D_CRT_SECURE_NO_WARNINGS
    /D_SCL_SECURE_NO_WARNINGS
)
endif(MSVC)
set(CMAKE_VERBOSE_MAKEFILE on)
set(CMAKE_BUILD_TYPE Debug)
message("BOOST_ROOT = $ENV{BOOST_ROOT}" )
include_directories($ENV{BOOST_ROOT})
# walk the tests directory to run tests
add_subdirectory(tests)

#2 looks like
ENABLE_TESTING()
add_executable(test_subtract
    test_subtract.cpp
    test_subtract1.cpp
    test_subtract2.cpp
    test_subtract3.cpp
)
add_test(
    test_subtract
    test_subtract
)

Here is what I do

cd build
cmake ..
$ ls -1
ALL_BUILD.vcproj
CMakeCache.txt
CMakeFiles
ZERO_CHECK.vcproj
cmake_install.cmake
safe_numerics.ncb
safe_numerics.sln
tests


when I bring up safe_numerics.sln, I do see the test_subtract project, it 
builds and executes.

BUT when I try to run CTest I get (among other stuff)

$ctest
*********************************
No test configuration file found!
*********************************
...

Things I've tried.

I eliminate the add_subdirectory and put all the sommand into file #1 . 
This did in fact build RUN_TESTS.vcproj.  But I can't see what I did wroing 
and what the "right way" to fix it is.

I'm lost as to what's wrong with this.  Any help appreciated.

Robert Ramey





More information about the CMake mailing list