<div dir="ltr"><div>Alternatively, </div>If you have your ITK build tree ready with the cache entry:BUILD_TESTING=ON.<div>You could just run the single test with ctest, e.g.:</div><div>ctest -R <span style="font-size:12.727272033691406px;font-family:arial,sans-serif">HDF5ImageIOStreamingReadWri</span><span style="font-size:12.727272033691406px;font-family:arial,sans-serif">teTest</span></div>
<div><font face="arial, sans-serif"> </font><span style="font-family:arial,sans-serif">from the root of the ITK build tree, or from the ${the root of the ITK build tree}/Modules/IO/HDF5/test/.</span></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Dec 2, 2013 at 11:12 AM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I suggest copying the "test" into a new directory .<br>
<br>
Then change the line:<br>
itkHDF5ImageIOStreamingReadWriteTest(int ac, char * av [])<br>
to<br>
main(int ac, char * av [])<br>
<br>
Then use a CMakeLists.txt file like this:<br>
<br>
make_minimum_required(VERSION 2.8)<br>
<br>
project(HDFExample)<br>
<br>
find_package(ITK REQUIRED)<br>
include(${ITK_USE_FILE})<br>
<br>
add_executable(HDFExample MACOSX_BUNDLE<br>
itkHDF5ImageIOStreamingReadWriteTest.cxx)<br>
target_link_libraries(HDFExample ${ITK_LIBRARIES})<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Mon, Dec 2, 2013 at 4:46 AM, David Froger <<a href="mailto:david.froger@inria.fr">david.froger@inria.fr</a>> wrote:<br>
> Replacing the CMakeLists.txt with, the following content almost works (I get<br>
> 'relocation has invalid symbol index' at link, seems that objects compiled<br>
> without -fPIC are put in dynamic lib).<br>
><br>
> cmake_minimum_required(VERSION 2.8)<br>
><br>
> PROJECT(MAIN)<br>
><br>
> FIND_PACKAGE(ITK)<br>
><br>
> SET(CMAKE_BUILD_TYPE debug)<br>
><br>
> IF(ITK_FOUND)<br>
>     INCLUDE(${ITK_USE_FILE})<br>
> ELSE(ITK_FOUND)<br>
>     MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.")<br>
> ENDIF(ITK_FOUND)<br>
><br>
> ADD_EXECUTABLE(main itkHDF5ImageIOStreamingReadWriteTest.cxx)<br>
><br>
> TARGET_LINK_LIBRARIES(main ${ITK_LIBRARIES})<br>
><br>
> Quoting David Froger (2013-12-02 10:33:56)<br>
>> Hi all,<br>
>><br>
>> How to run a ITK test manuall?<br>
>><br>
>> I would like to experiment with<br>
>> ITK/Modules/IO/HDF5/test/itkHDF5ImageIOStreamingReadWriteTest.cxx, but when<br>
>> trying to build the test:<br>
>><br>
>>     cd ITK/Modules/IO/HDF5/test<br>
>>     mkdir build<br>
>>     cd build<br>
>>     cmake ..<br>
>><br>
>> Because the ITK cmake testing module (I'm not sure how to name it) is not loaded,<br>
>> functions are not found:<br>
>><br>
>> CMake Error at CMakeLists.txt:1 (itk_module_test):<br>
>>   Unknown CMake command "itk_module_test".<br>
>><br>
>> Thanks,<br>
>> David<br>
> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Unpaid intern in BillsBasement at noware dot com<br>
</font></span><div class="HOEnZb"><div class="h5">_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
_______________________________________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org">Community@itk.org</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/community" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/community</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><br></div><div><br></div>---------------------------------------------<br><b>Xiaoxiao Liu</b>, Ph.D.<div><div><div><font face="arial, sans-serif"><span style="border-collapse:collapse">R & D Engineer</span></font></div>
<div><div><a href="http://www.kitware.com/" target="_blank">Kitware Inc</a>.</div></div><div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">Clifton Park, NY</span><div><div>Phone: (518) 881-4924  or  <span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px">(518) 371-3971 x124</span></div>
<div><font face="Verdana, Arial, Helvetica, sans-serif"><span style="line-height:31px;font-size:x-small"><br></span></font></div></div></div></div></div>
</div>