CMAKE RPATH not working - could not find shared object file

前端 未结 3 872
旧时难觅i
旧时难觅i 2021-01-05 02:21

I am trying to get rid of setting LD_LIBRARY_PATH everytime time I run my program. After adding in the library and targeting my executable to the library, when

3条回答
  •  隐瞒了意图╮
    2021-01-05 03:01

    In your CMake file, set the RPATH before defining the targets. The CMAKE_INSTALL_RPATH must be defined before calling add_executable(), otherwise it has no effect.

提交回复
热议问题