[CMake] ctest and cppunit
Mike Talbot
mtalbot at abingdon.oilfield.slb.com
Tue Jan 24 11:30:58 EST 2006
Hello,
I am trying to use cmake and ctest to run unit tests using cppunit. The
unit tests are built as shared libraries and then passed to the cppunit
test harness (DllPlugInTesterd_dll.exe) to run them. My CMakeLists.txt
looks like this:
ADD_LIBRARY(MyUnitTest SHARED MyUnitTest.cpp)
TARGET_LINK_LIBRARIES(MyUnitTest ${CPPUNIT_LIBRARY})
GET_TARGET_PROPERTY(MyUnitTestTarget MyUnitTest LOCATION)
ADD_TEST(MyUnitTest DllPlugInTesterd_dll.exe ${MyUnitTestTarget})
Unfortunately, when I use the Visual Studio 7 generator, cmake fails
because ${MyUnitTestTarget} is expanded (correctly) to
D:/build/lib/$(OutDir)/MyUnitTest.dll but ctest does not expand
$(OutDir) to the build config (e.g. "Debug"). Am I missing something or
is this a bug?
[I am using cmake version 2.2-patch 3 on Windows XP]
Thanks,
Mike
--
Mike Talbot
Senior Software Developer
Schlumberger
Lambourn Court, Wyndyke Furlong,
Abingdon Business Park, Abingdon,
Oxfordshire, OX14 1UJ, UK
Tel: +44 (0)1235 543 488
More information about the CMake
mailing list