0

This question is similar to this but for a more specific case. (although that one doesn't have a verified answer.)

I have the following warning from CMake:

CMake Warning at CMake/XXXXX.macros.cmake:112 (add_executable):
  Cannot generate a safe runtime search path for target
  YYYYYYYY_bin because files in some directories may conflict
  with libraries in implicit directories:

    runtime library [libodbc.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /my_path/venv/lib

So libodbc.so.2 is present in 2 folders where loader may search.

  • I want to use the one in /my_path/venv/lib which makes part of a virtual environment that contains my dependencies.

  • I'd like to avoid deleting the one in /usr/lib/x86_64-linux-gnu. But I have the feeling that the loader will always search there (maybe I'm wrong?).

  • I'm not "manually" adding /usr/lib/x86_64-linux-gnu to the project.

  • I use libraries like OpenCV, Boost and others coming from python with their own configuration/dependencies.

Is there a way of completely excluding /usr/lib/x86_64-linux-gnu during cmake configuration?

Ivan
  • 1,352
  • 2
  • 13
  • 31
  • Have you tried the suggestions in the answers you linked to? Please show a [mre] – Alan Birtles Jul 11 '22 at 15:14
  • Can you provide steps to reproduce? – Alex Reinking Jul 11 '22 at 15:23
  • "Is there a way of completely excluding /usr/lib/x86_64-linux-gnu during cmake configuration?" - You may set `CMAKE_PREFIX_PATH` variable to `/my_path/venv`, so CMake will always prefer libraries in your environment to ones in other directories. See that [my answer](https://stackoverflow.com/questions/34795816/hinting-findname-cmake-files-with-a-custom-directory/34797156#34797156) about setting the variable. If the warning remains, you may inspect CMake cache (`CMakeCache.txt` file in the build directory) for containing paths starting with `/usr/lib/x86_64-linux-gnu`. – Tsyvarev Jul 11 '22 at 21:09

0 Answers0