I have lib installed in /usr/local/lib. I try to use it as package in other project. I create .cmake file and i put it in appropriate directory. Package was found by cmake but linker error occurred. Is a way in cmake to set up LD_LIBRARY_PATH? Maybe is in cmake better way to solve this problem?
Without knowing the specifics of your project, I’d suggest taking a look at the packages documentation. Also, CMake prefers to use absolute paths to libraries, rather than -l and -L flags. Is the link error happening at compile/link time or run time?