If the user's cmakelists.txt first look for threads using
find_package(Threads), then set(gtest_disable_pthreads ON),
and then include googletest. GoogleTest will not look for
threads. But since they have already been found before in
user's cmakelists, it will use them regardless.
This helped me fix build issue in darktable-org/rawspeed
on windows/MSYS2, even though there are threads, and they
are usable, googletest build was failing with issues
about AutoHandle. I was first looking for threads, and only
then including googletest, so no matter the value of
gtest_disable_pthreads, it failed.
The other obvious solution is for user to first include
googletest, and only then look for threads by himself.
VS2010 solution only to simplify old users (who used these solutions) upgrading to new gtest/gmock, new users should use CMake generated solutions. VS2010 solution can be opened in any new VS.
Modify library install destinations to install .dll's to the correct
location (`bin`, not `lib`), and to install other artifacts to the
correct platform-dependent location by using GNUInstallDirs. This is
required for some distributions (e.g. Fedora) and will fix an issue that
otherwise requires those distributions to patch the upstream sources.
Also, add options to suppress installation, which may be useful for
projects that embed Google Test.
Since Google Test is trying to support archaic versions of CMake, a
brain-dead fallback (which requires that the user set either LIB_SUFFIX
or CMAKE_INSTALL_LIBDIR themselves) is included for versions that
predate GNUInstallDirs.
Fixes#1161.
Co-Authored-By: d3x0r <d3x0r@users.noreply.github.com>
The documentation of former versions is available in the history (e.g.
by checking out the appropriate git tags), so there is no need to keep
them in parallel to the current documentation.
The document itself uses lambdas later, all the scaffolding to
work around lack of lambdas should be considered for removal, but
that is much larger an effort than I can commit to.
This merges a Google-internal change (117235625).
Original CL description:
This CL was created manually in about an hour with sed, a Python script
to find all the places unqualified 'string' was mentioned, and some help
from Emacs to add the "std::" qualifications, plus a few manual tweaks.