[Insight-users] run test manually

Bill Lorensen bill.lorensen at gmail.com
Mon Dec 2 11:12:38 EST 2013


I suggest copying the "test" into a new directory .

Then change the line:
itkHDF5ImageIOStreamingReadWriteTest(int ac, char * av [])
to
main(int ac, char * av [])

Then use a CMakeLists.txt file like this:

make_minimum_required(VERSION 2.8)

project(HDFExample)

find_package(ITK REQUIRED)
include(${ITK_USE_FILE})

add_executable(HDFExample MACOSX_BUNDLE
itkHDF5ImageIOStreamingReadWriteTest.cxx)
target_link_libraries(HDFExample ${ITK_LIBRARIES})


On Mon, Dec 2, 2013 at 4:46 AM, David Froger <david.froger at inria.fr> wrote:
> Replacing the CMakeLists.txt with, the following content almost works (I get
> 'relocation has invalid symbol index' at link, seems that objects compiled
> without -fPIC are put in dynamic lib).
>
> cmake_minimum_required(VERSION 2.8)
>
> PROJECT(MAIN)
>
> FIND_PACKAGE(ITK)
>
> SET(CMAKE_BUILD_TYPE debug)
>
> IF(ITK_FOUND)
>     INCLUDE(${ITK_USE_FILE})
> ELSE(ITK_FOUND)
>     MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.")
> ENDIF(ITK_FOUND)
>
> ADD_EXECUTABLE(main itkHDF5ImageIOStreamingReadWriteTest.cxx)
>
> TARGET_LINK_LIBRARIES(main ${ITK_LIBRARIES})
>
> Quoting David Froger (2013-12-02 10:33:56)
>> Hi all,
>>
>> How to run a ITK test manuall?
>>
>> I would like to experiment with
>> ITK/Modules/IO/HDF5/test/itkHDF5ImageIOStreamingReadWriteTest.cxx, but when
>> trying to build the test:
>>
>>     cd ITK/Modules/IO/HDF5/test
>>     mkdir build
>>     cd build
>>     cmake ..
>>
>> Because the ITK cmake testing module (I'm not sure how to name it) is not loaded,
>> functions are not found:
>>
>> CMake Error at CMakeLists.txt:1 (itk_module_test):
>>   Unknown CMake command "itk_module_test".
>>
>> Thanks,
>> David
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users



-- 
Unpaid intern in BillsBasement at noware dot com


More information about the Insight-users mailing list