Lines Matching +full:- +full:- +full:with +full:- +full:config

3 GoogleTest comes with pkg-config files that can be used to determine all
5 Pkg-config is a standardised plain-text format containing
7 * the includedir (-I) path
8 * necessary macro (-D) definitions
9 * further required flags (-pthread)
10 * the library (-L) path
11 * the library (-l) to link to
13 All current build systems support pkg-config in one way or another. For all
19 Using `pkg-config` in CMake is fairly easy:
36 just -I flags (GoogleTest might require a macro indicating to internal headers
37 that all libraries have been compiled with threading enabled. In addition,
38 GoogleTest might also require `-pthread` in the compiling step, and as such
39 splitting the pkg-config `Cflags` variable into include dirs and macros for
42 to discard `-L` flags and `-pthread`.
44 ### Help! pkg-config can't find GoogleTest!
51 -- Checking for one of the modules 'gtest_main'
58 pkg-config where it can find the `.pc` files containing the information. Say you
66 pkg-config will also try to look in `PKG_CONFIG_PATH` to find `gtest_main.pc`.
68 ### Using pkg-config in a cross-compilation setting
70 Pkg-config can be used in a cross-compilation setting too. To do this, let's
71 assume the final prefix of the cross-compiled installation will be `/usr`, and
75 mkdir build && cmake -DCMAKE_INSTALL_PREFIX=/usr ..
81 make -j install DESTDIR=/home/MYUSER/sysroot
85 variables for pkg-config in a cross-compilation setting:
92 otherwise `pkg-config` will filter `-I` and `-L` flags against standard prefixes
96 If you look at the generated pkg-config file, it will look something like
106 Libs: -L${libdir} -lgtest -lpthread
107 Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -lpthread
111 to run `pkg-config` with the correct
116 $ pkg-config --cflags gtest
117 -DGTEST_HAS_PTHREAD=1 -lpthread -I/usr/include
118 $ pkg-config --libs gtest
119 -L/usr/lib64 -lgtest -lpthread
123 order to use this in a cross-compilation setting, we need to tell pkg-config to
124 inject the actual sysroot into `-I` and `-L` variables. Let us now tell
125 pkg-config about the actual sysroot
133 and running `pkg-config` again we get
136 $ pkg-config --cflags gtest
137 -DGTEST_HAS_PTHREAD=1 -lpthread -I/home/MYUSER/sysroot/usr/include
138 $ pkg-config --libs gtest
139 -L/home/MYUSER/sysroot/usr/lib64 -lgtest -lpthread
144 Elio Pettenò: <https://autotools.io/pkgconfig/cross-compiling.html>