If that library has a subfolder that you need to put in your include path (for example -I/usr/include/glib-2.0 for GLib) youre on your own to figure it out. Having it, if you now try to find your package in external project ( cmake-library-example/external-project/CMakeLists.txt) like this: findpackage (SomeLibrary 0.9. Then FINDLIBRARY does not find /usr/lib/libtoto.so.1 unless I add the missing link. The writebasicpackageversionfile () function from above will create SomeLibrar圜onfigVersion.cmake file in the install folder. Failure to find Zlib will be reported during link stage. addlibrary (mylib lib.cpp) The CMake variable BUILDSHAREDLIBS controls whenever to build an static ( OFF) or an shared ( ON) library, using for example cmake. FINDLIBRARY to find an installed library the library is (Linux system) /usr/lib/libtoto.so.1 which is a symbolic link to /usr/lib/libtoto.so.1.0.7 The link /usr/lib/libtoto.so -> /usr/lib/libtoto.so.1 is missing. This option can be specified with an empty string as the command to make the build step do nothing. using recursive make for Makefile generators or cmake-build if the project uses a CMake build). CPython, CMake, Meson, OpenSSL, FFmpeg, Rust, Ruby, just to name a few. Many Find.cmake file are already defined by default in CMake. targetlinklibrary (whateverProgram z) -lz is passed to linker and nothing else. If this option is not given, the default build command will be chosen to integrate with the main build in the most appropriate way (e.g. MSYS2 is a collection of tools and libraries providing you with an easy-to-use. The purpose of the file is to define the search rules for the package and set different variables, such as _FOUND, _INCLUDE_DIRS and _LIBRARIES. Try to find the GSS Kerberos library Once done this will define GSSROOTDIR - Set this variable to the root installation of GSS Read-Only. See also CMAKESYSTEMLIBRARYPATH and CMAKEPREFIXPATH. By default it is empty, it is intended to be set by the project. The default way to find installed packages with CMake is the use the find_package function in conjunction with a Find.cmake file. CMAKELIBRARYPATH Semicolon-separated list of directories specifying a search path for the findlibrary command. If any undefined behaviour occur, it could be necessary to find the module in CMake's install path and fix or understand its behaviour. The find_package way is compatible on all platform, whereas the pkg-config way is available only on Unix-like platforms, like Linux and OSX.Ī full description of the find_package numerous parameters and options can be found in the manual.Įven though it is possible to specify many optional parameters such as the version of the package, not all Find modules properly uses all those parameters.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |