[CMake] Problem with testing with cmake

Alexander Neundorf a.neundorf-work at gmx.net
Thu Feb 19 15:41:53 EST 2009


On Wednesday 18 February 2009, ankit jain wrote:
> Hi all,
>
> I have a directory structure with follwoign cmakelist as:
>
> myfold
> ....Cmakelist.txt
> ....subfolder
>
> subfolder
> ....Cmakelists.txt
> ....myfile.cpp
>
> Contents of Cmakelist of subfolder:
>
> add_executable(myfile myfile.cpp)
> target_link_libraries(myfile mylib)
> add_test(t1 myfile)
>
> t1 is the test case defined in myfile.cpp whose executable i have made.
>
> Contents of Camkelist of myfolder:
>
> Project(myfolder)
> ENABLE_TESTING()
> add_subdirectory(subfolder)
>
> Now when i am running make test from the myfolder directory on the prompt
> it says test failed and saying error with ctest.
...

Is this on windows or some unix ?
Maybe the executable myfile doesn't find the library mylib ?
Can you run myfile manually ?

Alex


More information about the CMake mailing list