[CMake] Running library tests under MSVC2010

Nils Gladitz gladitz at sci-vis.de
Mon Oct 22 02:20:25 EDT 2012


It isn't as bad as I might have made it sound. e.g.:

     add_executable(mytest test.cpp)
     set_target_properties(mytest PROPERTIES RUNTIME_OUTPUT_DIRECTORY 
${CMAKE_BINARY_DIR})
     add_test(mytest ${CMAKE_BINARY_DIR}/mytest)

On unix (I'm not sure about all but at least on gnu linux) CMake 
"tweaks" by embedding library paths into executables (RPATH) which 
allows the OS to use those paths at runtime.
As far as I know there is no equivalent feature on windows(?)

Nils


On 10/20/2012 01:21 PM, Martin Sustrik wrote:
> On 19/10/12 11:14, Nils Gladitz wrote:
>> I use ${CMAKE_BINARY_DIR} in my RUNTIME_OUTPUT_DIRECTORY and also in my
>> explicit test paths in add_test.
>>
>> I function wrapped the add_executable and add_test calls to take care of
>> it so the test definitions themselves are more compact and readable.
>
> Ok. However, what I need seems to be the most basic use case: build a 
> library and run some tests.
>
> Any way to do that without all the tweaks?
>
> For example, on UNIX platforms everything works OK with no tweaks 
> whatsoever.
>
> Martin


-- 
Nils Gladitz, B.Sc.
DICOM, Konnektivität und Entwicklung

Scivis wissenschaftliche Bildverarbeitung GmbH
Bertha-von-Suttner-Str. 5
D-37085 Göttingen
GERMANY
Handelsregister Nr. / Trade Register No. B3100 Göttingen
Geschäftsführer / Managing Directors Dr. Gernot Ebel, Dr. Uwe Engeland

Tel: 0049 (0)551 634181-28
E-Mail: gladitz at scivis.de
Web: www.scivis.de



More information about the CMake mailing list