Commit Graph

18 Commits

Author SHA1 Message Date
Roger Leigh 611735e76e FindGTest: Add imported targets and update documentation 2015-12-10 23:09:08 +00:00
Brad King b5e7b22def FindGTest: Refactor test type checks to avoid cases triggering CMP0064
Update our if() conditions to avoid CMP0064 warnings when `${test_type}`
is equal to `TEST`.

Reported-by: David T. Chen <dchen@mail.nih.gov>
2015-11-18 10:42:55 -05:00
Brad King 0f927b440a FindGTest: Fix parsing of test macro calls with spaces (#15553)
Tolerate spaces before the open paren and after the test name before the
comma.
2015-05-04 11:28:50 -04:00
Rolf Eike Beer 293bcf7a60 FindGTest: use new add_test() signature (#14913)
This allows to use target names as executables.
2014-05-12 18:21:37 +02:00
Jack Morrison 1f3e95ba72 FindGTest: Teach GTEST_ADD_TESTS about TYPED_TEST 2014-04-16 14:01:52 -04:00
Jack Morrison 2e2939c365 FindGTest: Teach GTEST_ADD_TESTS about TEST_P
Previously the GTEST_ADD_TESTS function would miss parameterized tests
because it only considered TEST and TEST_F.  Add TEST_P to the list of
considered tests and will run all instantiations of this parameterized
test together.

This is perhaps not as correct as searching for all instantiations of
this parameterized test and separating those into separate runs, but
this will at least run tests that were previously missing.

For reference: https://code.google.com/p/googletest/wiki/Documentation
2014-04-01 09:48:20 -04:00
Nikolay Orliuk c50325b8e5 FindGTest: Optionally detect sources automatically (#14775)
Teach GTEST_ADD_TESTS an "AUTO" option to read the source files from the
SOURCES target property of an executable.
2014-02-27 08:52:18 -05:00
Brad King 441f2808ec Help: Fix reStructuredText syntax in auto-generated documents 2013-10-15 14:12:49 -04:00
Kitware Robot f051814ed0 Convert builtin help to reStructuredText source files
Run the convert-help.bash script to convert documentation:

 ./convert-help.bash "/path/to/CMake-build/bin"

Then remove it.
2013-10-15 14:12:03 -04:00
Rolf Eike Beer b04650e163 use the find_* functions ENV parameter
Instead of directly passing $ENV{SOMEVAR} to a find_* call pass in ENV SOMEVAR.
This will make sure the paths will get correctly handled through different
platforms, especially on Windows.

Also fixes one place where paths with windows delimiters (\) were hardcoded to
use forward slashes.
2012-08-14 21:02:58 +02:00
Brad King c4275592a8 Modules: Include builtin FindPackageHandleStandardArgs directly
The FindPackageHandleStandardArgs module was originally created outside
of CMake.  It was added for CMake 2.6.0 by commit e118a627 (add a macro
FIND_PACKAGE_HANDLE_STANDARD_ARGS..., 2007-07-18).  However, it also
proliferated into a number of other projects that at the time required
only CMake 2.4 and thus could not depend on CMake to provide the module.
CMake's own find modules started using the module in commit b5f656e0
(use the new FIND_PACKAGE_HANDLE_STANDARD_ARGS in some of the FindXXX
modules..., 2007-07-18).

Then commit d358cf5c (add 2nd, more powerful mode to
find_package_handle_standard_args, 2010-07-29) added a new feature to
the interface of the module that was fully optional and backward
compatible with all existing users of the module.  Later commit 5f183caa
(FindZLIB: use the FPHSA version mode, 2010-08-04) and others shortly
thereafter started using the new interface in CMake's own find modules.
This change was also backward compatible because it was only an
implementation detail within each module.

Unforutnately these changes introduced a problem for projects that still
have an old copy of FindPackageHandleStandardArgs in CMAKE_MODULE_PATH.
When any such project uses one of CMake's builtin find modules the line

  include(FindPackageHandleStandardArgs)

loads the copy from the project which does not have the new interface!
Then the including find module tries to use the new interface with the
old module and fails.

Whether this breakage can be considered a backward incompatible change
in CMake is debatable.  The situation is analagous to copying a standard
library header from one version of a compiler into a project and then
observing problems when the next version of the compiler reports errors
in its other headers that depend on its new version of the original
header.  Nevertheless it is a change to CMake that causes problems for
projects that worked with previous versions.

This problem was discovered during the 2.8.3 release candidate cycle.
It is an instance of a more general problem with projects that provide
their own versions of CMake modules when other CMake modules depend on
them.  At the time we resolved this instance of the problem with commit
b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake
everywhere, 2010-09-28) for the 2.8.3 release.

In order to address the more general problem we introduced policy
CMP0017 in commit db44848f (Prefer files from CMAKE_ROOT when including
from CMAKE_ROOT, 2010-11-17).  That change was followed by commit
ce28737c (Remove usage of CMAKE_CURRENT_LIST_DIR now that we have
CMP0017, 2010-12-20) which reverted the original workaround in favor of
using the policy.  However, existing project releases do not set the
policy behavior to NEW and therefore still exhibit the problem.

We introduced in commit a364daf1 (Allow users to specify defaults for
unset policies, 2011-01-03) an option for users to build existing
projects by adding -DCMAKE_POLICY_DEFAULT_CMP0017=NEW to the command
line.  Unfortunately this solution still does not allow such projects to
build out of the box, and there is no good way to suggest the use of the
new option.

The only remaining solution to keep existing projects that exhibit this
problem building is to restore the change originally made in commit
b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake
everywhere, 2010-09-28).  This also avoids policy CMP0017 warnings for
this particular instance of the problem the policy addresses.
2011-01-20 10:56:49 -05:00
Alex Neundorf ce28737c93 Remove usage of CMAKE_CURRENT_LIST_DIR now that we have CMP0017
This puts the new search behaviour for included files in action, i.e.
now when a file from Modules/ include()s another file, it also gets the
one from Modules/ included, i.e. the one it expects.

Alex
2011-01-04 08:20:08 -05:00
Alex Neundorf b01184022b Use absolute path to FindPackageHandleStandardArgs.cmake everywhere
This is to avoid getting an (older) copy of FPHSA.cmake which is
e.g. installed with KDE 4.5.0 and 4.5.1.

Alex
2010-09-28 22:30:31 +02:00
Todd Gamblin 2cde67a781 Modules: Fix spelling 'To distributed' -> 'To distribute' 2010-08-09 08:48:31 -04:00
Philip Lowman eb66705db4 Fix issue #10065, "FindGTest.cmake doesn't handle spaces around arguments to TEST/TEST_F macro".
Also improved the documentation.
2010-01-05 00:14:58 -05:00
Philip Lowman e8cdd54f74 Some bugfixes, also added public function for closer integration btwn GoogleTest & CTest, contributed by Dan Blezek.
Other minor changes:
* Enhanced documentation & added examples
* _INCLUDE_DIRS and _LIBRARIES was being set regardless of _FOUND
* Fixed status message to include library rather than include dir
* Improved detection of MSVC compiled libraries
* Added a variable (GTEST_BOTH_LIBRARIES) for libgtest + libgtest_main
2009-10-01 01:12:40 -04:00
Brad King c4bb9c9d42 Convert CMake find-modules to BSD License
This adds copyright/license notification blocks CMake's find-modules.
Many of the modules had no notices at all.  Some had notices referring
to the BSD license already.  This commit normalizes existing notices and
adds missing notices.
2009-09-28 11:45:50 -04:00
Philip Lowman c577608958 A find module for the Google C++ Testing Framework 2009-08-16 22:12:04 -04:00