Menu

#293 find_package(GDCM ...) failed when using ITK (3.20.1 ?)

2.3
closed
None
1
2013-06-21
2013-06-21
No

Hi GDCM team,

Using CamiTK (http://camitk.imag.fr), we wrapped GDCM 2.2.3 library into one of our plugin in order to handle DICOM images.
CamiTK uses ITK (at the moment version 3.20.1), and at configuration step with CMake (2.8.1x), we use the CMake macro find_package(GDCM 2.0 REQUIRED).

If we call at least two times find_package(GDCM ...) CMake throws errors (errors in including GDCMTargets.cmake >> targets already defined).
This occurs when, for instance we called find_package(ITK ...) which calls find_package(GDCM ...) and then calling find_package(GDCM ...) on our own crashes.

I've "fixed" it by checking if GDCM was already found before launching find_package(GDCM ...).

I thought it might be important to notice that and prevent users to look twice at GDCM or maybe fixed the including of GDCMTargets.cmake in the GDCMConfig.cmake file.

Btw, thank you for this nice library,
Nicolas

Discussion

  • Mathieu Malaterre

    Cannot reproduce.

    $ cat ../CMakeLists.txt
    cmake_minimum_required(VERSION 2.8)
    find_package(GDCM 2.0 REQUIRED)
    include(${GDCM_USE_FILE})
    find_package(ITK REQUIRED)
    find_package(GDCM REQUIRED)
    include(${GDCM_USE_FILE})
    $ cmake ..
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /tmp/l/bin
    $ cmake --version
    cmake version 2.8.11

     

    Last edit: Mathieu Malaterre 2013-06-21
  • Mathieu Malaterre

    • status: unread --> pending
    • assigned_to: Mathieu Malaterre
    • Priority: 3 --> 1
     
  • Mathieu Malaterre

    cmake generated file are now much smarted in cmake 2.8.11. Indeed the bug can be seen using cmake 2.8.9.

    My advice: you should force camitk to use cmake 2.8.11 because of this bug.

    closing.

     
  • Mathieu Malaterre

    • status: pending --> closed
     

Log in to post a comment.