Thanks for your answer,

The thing is that, since the Python dependency comes from VTK, I checked in
the VTK install directory all the CMake configuration files (In particulare
the UseVTK.cmake) file to see if they keep the Python path somewhere.

And it happens that yes, they do.
If I run: `grep -e 'python2.7' -r <PATH_TO_VTK/lib/cmake/vtk-7.1>`, I
actually get that in the file `VTKTargets.cmake`and in the
`Modules/vtkPython.cmake` they actually keep the path of the python used to
compile VTK.

For example in VTKTargets.cmake, you find:

set_target_properties(vtkWrappingPythonCore PROPERTIES
  INTERFACE_LINK_LIBRARIES
"vtkCommonCore;/home2/softmassot/eb/Compiler/GCCcore/7.2.0/Python/2.7.14-bare/lib/
libpython2.7.so;vtksys"
)

So when I link my test target to ${VTK_LIBRARIES}, shouldn't it also be
able to retrieve the right python library from the target properties?


On Thu, Aug 2, 2018 at 9:56 PM Roger Leigh <rle...@codelibre.net> wrote:

> It's the quick and easy way to do it.
>
> However, I'd suggest looking at getting CMake to use the proper path
> without it.  Can you use any module-specific variables like
> PYTHON_LIBRARY to override the search.  Or even just add to
> CMAKE_PREFIX_PATH.  (Does VTK support imported targets?)
>
> Regards,
> Roger
>
> On 02/08/18 20:43, Ruben Di Battista wrote:
> > Hi Roger,
> > so I explicitly passing the LDFLAGS is the way to go?
> >
> > On Thu, Aug 2, 2018 at 9:41 PM Roger Leigh <rle...@codelibre.net
> > <mailto:rle...@codelibre.net>> wrote:
> >
> >     On 02/08/18 20:03, Ruben Di Battista wrote:
> >
> >      > I'm running cmake on a system where I have module-loaded software
> >     such
> >      > that `LD_LIBRARY_PATH` gets populated by the module (actually I'm
> >     using
> >      > Lmod) function.
> >
> >     LD_LIBRARY_PATH is used by the *runtime* linker, ld.so.  It is not
> used
> >     when linking at *build* time, with ld.
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>


-- 
          _
-.     .´  |∞∞∞∞
  ',  ;    |∞∞∞∞∞∞
    ˜˜     |∞∞∞∞∞∞∞∞∞ RdB
    ,.,    |∞∞∞∞∞∞
  .'   '.  |∞∞∞∞
-'       `'
https://rdb.is <http://rdb.is>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to