[CMake] problem: No test configuration file found!

m.hergarden m.hergarden at euphoria-it.nl
Wed Jun 20 01:47:30 EDT 2012


I think you could put the enable_testing() and add_test() statements in 
a file called CMakeTests.txt in your subdirectory and include that in 
your toplevel cmakelists.txt. That works for me anyway. I'm not sure if 
this is the official way it is supposed to be done though.

Regards,
Micha

On 06/19/2012 11:19 PM, Robert Ramey wrote:
> 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
>
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list