[CMake] CTest: another sub-directory issue / coverage test

Johannes Stallkamp johannes.stallkamp at rub.de
Tue Nov 10 06:13:23 EST 2009


Richard,

Richard Wackerbarth schrieb:
> Johannes,
>
> Is there any compelling reason to place the cmake "control files" in a
> directory under the root?
>
> Foo/
>    CMakeLists.txt
>    CTestConfig.cmake
>    include
>       Foo.h
>    src
>       Foo.cpp
>       FooTest.cpp
>
> is a more conventional structure
>

its actually for historical reasons. Initially, the structure was like
Foo/
   include
      Foo.h
    gcc
       Makefile
   src
      Foo.cpp
      FooTest.cpp
    vc70
       Foo.vcproj
    vc80
       Foo.vcproj

So creation of a cmake folder for CMakeLists.txt might have resulted
from habit. However, since then, many new components have been created
and I would actually want to avoid to adapt the directory structure and
CMakeLists of all projects. So is it mandatory to put the CMakeLists.txt
in the project root directory or is it only considered "best practice".
Nevertheless, the question remains, why CTest accepts "Foo/" as source
directory but not its equivalent "Foo/cmake/..".

Regards
Johannes


More information about the CMake mailing list