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

Elli elli.pfaehler at gmail.com
Sun Apr 29 14:13:09 EDT 2018


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


More information about the Community mailing list