dgobbi / vtk-dicom

A set of classes for using DICOM in VTK.
BSD 3-Clause "New" or "Revised" License
259 stars 94 forks source link

NG building from microsoft/vcpkg #196

Closed QiuKejian closed 4 years ago

QiuKejian commented 4 years ago

build vtk-dicom from vcpkg, find_package and target_link_libraries is not working.

The following find_package and target_link_libraries is not working. image

Error Message is: LINK: fatal error LNK1104: can not open "VTK::DICOM.lib".

Check the vcpkg build log , we can find that vtk-dicom is built by "outside of VTK" mode. image

Please help, How can I fix this problem?

JackBoosY commented 4 years ago

Related: https://github.com/microsoft/vcpkg/pull/12839

dgobbi commented 4 years ago

Which version of VTK are you using? Are you building programs that use vtk-dicom, or are you packaging it up for other people to use?

For VTK 9, the most common way to build vtkDICOM is to enable it as part of the VTK build itself, by using the following configuration option (only for VTK 9, not for older versions of VTK):

VTK_MODULE_ENABLE_VTK_DICOM:STRING=DEFAULT

For VTK 8 and earlier, the instructions at https://dgobbi.github.io/vtk-dicom/doc/api/installation.html should work.

JackBoosY commented 4 years ago

@dgobbi VTK version 9.0.1. Use official usage:

find_package(DICOM QUIET)
if(DICOM_FOUND)
  include(${DICOM_USE_FILE})
endif()
set(VTK_DICOM_LIBRARIES vtkDICOM)

does't work.

QiuKejian commented 4 years ago

Which version of VTK are you using? Are you building programs that use vtk-dicom, or are you packaging it up for other people to use?

For VTK 9, the most common way to build vtkDICOM is to enable it as part of the VTK build itself, by using the following configuration option (only for VTK 9, not for older versions of VTK):

VTK_MODULE_ENABLE_VTK_DICOM:STRING=DEFAULT

For VTK 8 and earlier, the instructions at https://dgobbi.github.io/vtk-dicom/doc/api/installation.html should work.

appreciate for reply!! I was using VTK9, the latest version. The situation is that I had build VTK9.0.1 from vcpkg, therefore vtk-dicom is built outside of VTK.

On the other hand, i am trying to build vtk-dicom as a sub module, in this case there is also an unexpected behavior. image

The reason is: image