Here is an example how to specify PATHS variable to make cmake be able to find library: cmake find_package specify path But how to get this PATHS variable for specific library?
For example I have installed apt-get install libharfbuzz-dev and dpkg -L libharfbuzz-dev shows me:
/usr /usr/include /usr/include/harfbuzz /usr/include/harfbuzz/hb-blob.h /usr/include/harfbuzz/hb-buffer.h /usr/include/harfbuzz/hb-common.h /usr/include/harfbuzz/hb-deprecated.h /usr/include/harfbuzz/hb-face.h /usr/include/harfbuzz/hb-font.h /usr/include/harfbuzz/hb-ft.h /usr/include/harfbuzz/hb-glib.h /usr/include/harfbuzz/hb-gobject-enums.h /usr/include/harfbuzz/hb-gobject-structs.h /usr/include/harfbuzz/hb-gobject.h /usr/include/harfbuzz/hb-graphite2.h /usr/include/harfbuzz/hb-icu.h /usr/include/harfbuzz/hb-ot-font.h /usr/include/harfbuzz/hb-ot-layout.h /usr/include/harfbuzz/hb-ot-math.h /usr/include/harfbuzz/hb-ot-shape.h /usr/include/harfbuzz/hb-ot-tag.h /usr/include/harfbuzz/hb-ot-var.h /usr/include/harfbuzz/hb-ot.h /usr/include/harfbuzz/hb-set.h /usr/include/harfbuzz/hb-shape-plan.h /usr/include/harfbuzz/hb-shape.h /usr/include/harfbuzz/hb-unicode.h /usr/include/harfbuzz/hb-version.h /usr/include/harfbuzz/hb.h /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libharfbuzz-gobject.a /usr/lib/x86_64-linux-gnu/libharfbuzz-icu.a /usr/lib/x86_64-linux-gnu/libharfbuzz.a /usr/lib/x86_64-linux-gnu/pkgconfig /usr/lib/x86_64-linux-gnu/pkgconfig/harfbuzz-gobject.pc /usr/lib/x86_64-linux-gnu/pkgconfig/harfbuzz-icu.pc /usr/lib/x86_64-linux-gnu/pkgconfig/harfbuzz.pc /usr/share /usr/share/doc /usr/share/doc/libharfbuzz-dev /usr/share/doc/libharfbuzz-dev/copyright /usr/share/gir-1.0 /usr/share/gir-1.0/HarfBuzz-0.0.gir /usr/lib/x86_64-linux-gnu/libharfbuzz-gobject.so /usr/lib/x86_64-linux-gnu/libharfbuzz-icu.so /usr/lib/x86_64-linux-gnu/libharfbuzz.so /usr/share/doc/libharfbuzz-dev/changelog.Debian.gz Which path should I use?
Update:
Error message:
CMake Error at <some_path>/CMakeLists.txt:6 (find_package): By not providing "FindHarfbuzz.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Harfbuzz", but CMake did not find one. Could not find a package configuration file provided by "Harfbuzz" with any of the following names: HarfbuzzConfig.cmake harfbuzz-config.cmake Add the installation prefix of "Harfbuzz" to CMAKE_PREFIX_PATH or set "Harfbuzz_DIR" to a directory containing one of the above files. If "Harfbuzz" provides a separate development package or SDK, be sure it has been installed. I tried to add path via CMAKE_PREFIX_PATH like cmake .. -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu but it doesn't help.
/usr/lib/x86_64-linux-gnu, so it looks like you should use that path. I'm confused if there is another question here? If the library isn't located in the standard system paths, and thePATHSarguments is needed, then the hard-coded path may differ for every library.../usr/lib/x86_64-linux-gnustandard library path? Is there any reason why cmake can't find it by default?FindHarfbuzz.cmakescript, which should be provided by your project, and aboutHarfbuzzConfig.cmake(orharfbuzz-config.cmake) one, which should come with the library. You have none of them, so CMake cannot find that library. You could getFindHarfbuzz.cmakescript from somewhere. Or, since the package provides.pcfile, you could usepkg-configutility (pkg_check_modules CMake function) instead offind_package.