[CMake] [CTest] relative path in create_test_sourcelist

Raphaël M. latcho.dives at gmail.com
Fri Feb 26 09:04:21 EST 2010


Hello,

I'm starting to use CTest and having some trouble generating the test
driver.

Here is the cmake commands I'm using :

create_test_sourcelist (Tests_src
TestSuite.cpp
../src/testTest.cpp
)

My directory structure is

LoggerTest/
    - build/
        -CMakeLists.txt
    - inc/
    - src/
         testTest.cpp   (which contains int testTest(int argc, char*[] argv)
)

When I run 'cmake .'  it generates a file called TestSuite.cpp which doesn't
compile when I then run "make"

The reason is that cmake generated a function prototype like this :

/* Forward declare test functions. */
int .._src_testTest(int, char*[]);


(Obviously, I tested putting the CMakeLists.txt and the source files in one
same directory, and it works, but I don't think that's an elegant solution)

Does anyone have a clean solution to fix this issue and keep the
CMakeLists.txt in a separate folder than the source files ?

Thanks a lot,

Raphaël Mor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100226/8c4243b9/attachment.htm>


More information about the CMake mailing list