[CMake] ADD_TEST(...) doesn't output any tests into CTestTestfile.cmake (cmake 2.6-patch 0)

Bill Hoffman bill.hoffman at kitware.com
Fri Feb 27 11:01:54 EST 2009


Pavel Shevaev wrote:
>> Can you create a complete but small example that shows the problem?
> 
> Ok, I tried to extract the minimal non-working example from my CMakeLists.txt.
> 
> foo/CMakeLists.txt:
> ==============================================
> cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
> project(foo)
> 
> enable_testing()
> include(CTest)
> add_test(test test)
> 
> add_subdirectory(${foo_SOURCE_DIR}/../shared/lib/boost ${foo_BINARY_DIR})
> ==============================================
> 
The problem is in the add_subdirectory call.  You can not specify 
${foo_BINARY_DIR} as a directory as it is already in use.  We are 
working on a fix that will report this as an error.   Basically what 
happens is the test file gets written correctly, then overwritten with 
nothing from the shared/lib/boost build directory that is told to go 
into the same directory.

So,  this should fix the problem:

add_subdirectory(${foo_SOURCE_DIR}/../shared/lib/boost boost_lib)

-Bill


More information about the CMake mailing list