[ITK] [ITK-users] Problem using CMAKE including ITK, VTK and GDCM

Dženan Zukić dzenanz at gmail.com
Mon Apr 30 09:59:17 EDT 2018


Hi Elli,

what you need to do is set ITK_USE_SYSTEM_GDCM to ON when configuring ITK
and point to the GDCM you compiled yourself.

Regards,
Dženan

On Sun, Apr 29, 2018 at 2:13 PM Elli <elli.pfaehler at gmail.com> wrote:

> Dear all,
>
> I am having some trouble with CMAKE. Until now, I used in my project ITK
> and
> VTK what worked quite fine. However, now I want to use
> vtkGDCMPolyDataReader, so I also downloaded and built the GDCM library.
> With
> the build and the installation everything worked fine.
>
> Now I want to include GDCM in my project. I have a CMakeLists file (I have
> to admit that my experience with cmake is very limited). It looks the
> following:
>
> cmake_minimum_required(VERSION 2.8)
>
> project(Radiomics)
>
> SET (BOOST_ROOT "C:/boost_1_65_0/boost_1_65_0")
> SET (BOOST_LIBRARYDIR "C:/boost_1_65_0/boost_1_65_0/stage/lib")
>
> SET (BOOST_MIN_VERSION "1.55.0")
> set (Boost_NO_BOOST_CMAKE ON)
> SET(USE_STATIC_LIBS = 1)
> FIND_PACKAGE(Boost ${BOOST_MIN_VERSION} REQUIRED)
> if (NOT Boost_FOUND)
>   message(FATAL_ERROR "Fatal error: Boost (version >= 1.55) required.")
> else()
>   message(STATUS "Setting up BOOST")
>   message(STATUS " Library  - ${Boost_LIBRARY_DIRS}")
>   include_directories(${Boost_INCLUDE_DIRS})
>   link_directories(${Boost_LIBRARY_DIRS})
> endif (NOT Boost_FOUND)
>
> find_package(ITK REQUIRED)
> include(${ITK_USE_FILE})
>
> find_package(VTK REQUIRED)
> include(${VTK_USE_FILE})
>
> FIND_PACKAGE(GDCM REQUIRED)
>     IF(GDCM_FOUND)
>         INCLUDE(${GDCM_USE_FILE})
>
>     ELSE(GDCM_FOUND)
>         MESSAGE(FATAL_ERROR "Cannot find GDCM, did you set GDCM_DIR?")
>     ENDIF(GDCM_FOUND)
>
>
> add_executable(Radiomics MACOSX_BUNDLE src/main.cpp)
> target_link_libraries(Radiomics
>  ${Boost_LIBRARIES} ${Glue} ${vtkgdcm} ${VTK_LIBRARIES} ${ITK_LIBRARIES})
>
> But now I get the error:
>
> Some (but not all) targets in this export set were already defined.
>
> Targets Defined:
>
> gdcmCommon;gdcmDICT;gdcmDSED;gdcmIOD;gdcmMSFF;gdcmMEXD;gdcmjpeg8;gdcmjpeg12;gdcmjpeg16;gdcmcharls
>
>
> Targets not yet defined: gdcmexpat;gdcmopenjp2;gdcmzlib;socketxx;vtkgdcm
>
> I already found other persons reporting the bug but I could not find any
> solution.
>
> Can anyone help me with this?
>
> Thanks in advance!
>
> Elli
>
>
>
> --
> Sent from: http://itk-users.7.n7.nabble.com/
> The ITK community is transitioning from this mailing list to
> discourse.itk.org. Please join us there!
> ________________________________
> 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:
> https://itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://itk.org/pipermail/community/attachments/20180430/25568278/attachment.html>
-------------- next part --------------
The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
________________________________
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:
https://itk.org/mailman/listinfo/insight-users


More information about the Community mailing list