0

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.

5
  • The libraries are located here: /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 the PATHS arguments is needed, then the hard-coded path may differ for every library... Commented Aug 5, 2020 at 15:44
  • @squareskittles Is /usr/lib/x86_64-linux-gnu standard library path? Is there any reason why cmake can't find it by default? Commented Aug 5, 2020 at 16:09
  • 1
    Please, add exact error message into the question post. Commented Aug 5, 2020 at 16:25
  • @Tsyvarev Updated question. Commented Aug 5, 2020 at 17:51
  • 2
    Err, have you ever read that error message? It tells about FindHarfbuzz.cmake script, which should be provided by your project, and about HarfbuzzConfig.cmake (or harfbuzz-config.cmake) one, which should come with the library. You have none of them, so CMake cannot find that library. You could get FindHarfbuzz.cmake script from somewhere. Or, since the package provides .pc file, you could use pkg-config utility (pkg_check_modules CMake function) instead of find_package. Commented Aug 5, 2020 at 18:04

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.