[vtk-developers] target_link_libraries and spaces in path (cmake 2.8.8)

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue Sep 18 09:59:17 EDT 2012


If I look at the vcproj file for the vtkParallelMPI module, the link
dependencies simply has no reference to msmpi.lib!!! Add the quotes,
and the full path to the msmpi.lib gets added to the link depedencies.

Utkarsh

On Tue, Sep 18, 2012 at 9:55 AM, Utkarsh Ayachit
<utkarsh.ayachit at kitware.com> wrote:
> No luck there. Tried printing the variable just before and after the
> target_link...() call. In both cases I get the following path printed:
>
>  C:/Program Files/Microsoft HPC Pack 2008 R2/lib/amd64/msmpi.lib
>
> Utkarsh
>
> On Mon, Sep 17, 2012 at 9:47 PM, David Cole <david.cole at kitware.com> wrote:
>> On Sep 17, 2012, at 9:40 PM, David Cole <david.cole at kitware.com> wrote:
>>
>>> On Sep 17, 2012, at 7:58 PM, Utkarsh Ayachit <utkarsh.ayachit at kitware.com> wrote:
>>>
>>>> On Mon, Sep 17, 2012 at 7:18 PM, David Cole <david.cole at kitware.com> wrote:
>>>>> It should not be necessary in that context. Where else is MPI_LIBRARIES referenced, though? Is it used in a configured script of some sort?
>>>>
>>>> Not that I could find. Also MPI_LIBRARIES is coming from FindMPI.cmake
>>>> included in CMake source. Also in some cases, it is possible that
>>>> MPI_LIBRARIES will be more than one, in that case using quotes will be
>>>> incorrect, right?
>>>>
>>>> Utkarsh
>>>
>>>
>>> On this line of code, quotes should be completely irrelevant. Quotes or no quotes..., a line like
>>>
>>>  target_link_libraries(target_name ${LIBRARY_VAR})
>>>
>>> should be entirely equivalent to the quoted version. Either works whether the contents of the variable is a single library name or a list of library names.
>>>
>>> What is the error message when you don't have the quotes?
>>>
>>
>> I bet this is a "variable has different value than you think it does" problem, and any change that you made, causing the reconfigure, would have made it work.
>>
>> Add a message just prior to the target_link_libraries call and print out the contents of the variable. Then we can see what the value is right at that point and get to the real underlying problem.



More information about the vtk-developers mailing list