[vtk-developers] How to write the CMakeLists.txt file without INCLUDE(${VTK_USE_FILE})

Robert Maynard robert.maynard at kitware.com
Tue Apr 30 09:18:00 EDT 2013


If you INCLUDE(${VTK_USE_FILE}) when you have imported libraries that
have factories VTK will add compiler defines at the directory level to
auto init all classes in those factories.

Adding definitions to all targets in the directory causes NVCC to fail
to compile, since it can't handle definitions having spaces, which the
auto init defines have.

Currently the solution for cuda projects that use VTK depends on if
you need to use a module that has a factory. If you don't need the
modules that have factories, you just explicitly list the libraries
you want when finding VTK. If you need to link to a module that uses a
factory you will want to reset your directory defines to be what they
used to be before you called INCLUDE(${VTK_USE_FILE}).

On Tue, Apr 30, 2013 at 7:47 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> I don't understand how it will be "influenced?"
>
>
> On Tue, Apr 30, 2013 at 12:02 AM, Mingcheng Chen <linyufly at gmail.com> wrote:
>>
>> Hi Bill,
>>
>> Thanks!
>>
>> I need to use cuda_add_executable. It will be influenced by
>> INCLUDE(${VTK_USE_FILE}). The compilation will fail. How to solve that
>> problem?
>>
>> Thanks again!
>>
>>
>> Best regards,
>> Mingcheng Chen
>> April 29th, 2013
>>
>>
>> On Mon, Apr 29, 2013 at 10:57 PM, Bill Lorensen <bill.lorensen at gmail.com>
>> wrote:
>>>
>>> you must INCLUDE(${VTK_USE_FILE})
>>>
>>>
>>>
>>>
>>> On Mon, Apr 29, 2013 at 11:38 PM, Mingcheng Chen <linyufly at gmail.com>
>>> wrote:
>>>>
>>>> Hi everyone,
>>>>
>>>> For some reason I do not want INCLUDE(${VTK_USE_FILE}) in my cmake
>>>> CMakeLists.txt.
>>>>
>>>> I use INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS}) and
>>>> target_link_libraries(xxx ${VTK_LIBRARIES}), but it seems not enough.
>>>>
>>>> Thanks!
>>>>
>>>> Best regards,
>>>> Mingcheng Chen
>>>> April 29th, 2013
>>>>
>>>> --
>>>> Research Assistant in Graphics Group
>>>> University of Illinois at Urbana-Champaign
>>>> http://mingchengchen.org
>>>>
>>>> _______________________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Unpaid intern in BillsBasement at noware dot com
>>
>>
>>
>>
>> --
>> Research Assistant in Graphics Group
>> University of Illinois at Urbana-Champaign
>> http://mingchengchen.org
>
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>



More information about the vtk-developers mailing list