Hi Francois,

Good observation. Yes, UseITK.cmake should be using ITK_BUILD_SHARED
from ITKConfig.cmake for ITK library build settings here [1].

Thanks,
Matt

[1] 
https://github.com/InsightSoftwareConsortium/ITK/blob/master/CMake/UseITK.cmake#L201




On Mon, Oct 17, 2016 at 8:56 AM, Lowekamp, Bradley (NIH/NLM/LHC) [C]
<blowek...@mail.nih.gov> wrote:
> Looks like a bug to me. This is relatively new code too [1].
>
> You proposal sounds good to me too.
>
> Brad
>
> [1]
> https://github.com/InsightSoftwareConsortium/ITK/commit/1000370eec20511850c543cb3c02aa5118563ccc
>
>
>
>
> On Oct 16, 2016, at 9:49 PM, Francois Budin <francois.bu...@kitware.com>
> wrote:
>
> Hello fellow ITK developers,
>
> I was having linking errors on Windows when compiling a project that was
> using the CMake variable BUILD_SHARED_LIBS and setting it to ON when I had
> compiled ITK with BUILD_SHARED_LIBS to OFF.
> I realized that when ITK gets included and used and when the project using
> ITK using the IO factory mechanism, UseITK.cmake uses the variable
> BUILD_SHARED_LIBS to set some parameters. I was wondering if instead of
> using BUILD_SHARED_LIBS which could have a different value in ITK and the
> project I am trying to compile, UseITK.cmake should not use ITK_BUILD_SHARED
> instead (which is set when ITK is configured). If I modify UseITK.cmake to
> use ITK_BUILD_SHARED instead of BUILD_SHARED_LIBS, the linking error I was
> having disappears. Is this a bug or is there a reason behind that design?
>
> Thanks,
> Francois
>
> [1]
> https://github.com/InsightSoftwareConsortium/ITK/blob/master/CMake/UseITK.cmake#L201
> _______________________________________________
> 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://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:
> http://public.kitware.com/mailman/listinfo/insight-developers
>
>
>
> _______________________________________________
> 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://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:
> http://public.kitware.com/mailman/listinfo/insight-developers
>
_______________________________________________
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://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:
http://public.kitware.com/mailman/listinfo/insight-developers

Reply via email to