[Insight-developers] Using ITKv4 Exported Targets In SimpleITK

Bradley Lowekamp blowekamp at mail.nih.gov
Tue Oct 4 14:58:26 EDT 2011


Hello,

The following project seems to fail for me for both installed ITKv4s and in-build path:

cmake_minimum_required ( VERSION 2.8 FATAL_ERROR )
project ( ITKv4TargetsTest )


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

if(TARGET itkTestDriver)
  message( STATUS "itkTestDriver target" )
else()
  message( FATAL_ERROR "No itkTestDriver target" )
endif()


Thanks for the help,
Brad

On Oct 4, 2011, at 9:52 AM, Brad King wrote:

> On 10/4/2011 9:19 AM, Bradley Lowekamp wrote:
>> I expected for cmake to just know that this executable was coming from the ITK project.
> 
> It is expected to work.  The itkTestDriver target should be imported by
> 
>   lib/cmake/ITK-4.0/ITKTargets.cmake
> 
> which is loaded by ITKConfig.cmake.  Once that happens then
> 
>   add_test(NAME ... COMMAND itkTestDriver ...)
> 
> should pick it up.  To verify that the imported target is defined, try adding
> 
>   if(TARGET itkTestDriver)
>     message("have itkTestDriver target")
>   endif()
> 
> to your CMake code just before the test is added.
> 
> -Brad K

========================================================
Bradley Lowekamp  
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20111004/c4b34b6d/attachment.htm>


More information about the Insight-developers mailing list