Commit Graph

1905 Commits

Author SHA1 Message Date
David Cole 91f83347d3 Merge topic 'enhance-include_external_msproject'
b803410 VS: Fix line-too-long style errors
8787f94 Merge branch 'list-empty-error' into enhance-include_external_msproject
4a30258 include_external_msproject: Test TYPE, GUID, PLATFORM options (#13120)
f3191f5 Merge branch 'test-RunCMake-check' into enhance-include_external_msproject
5913903 include_external_msproject: Add TYPE, GUID, PLATFORM options (#13120)
2012-04-25 14:04:27 -04:00
David Cole c4aa5386fb Merge topic 'list-empty-error'
05604eb list: Handle errors on empty lists more gracefully (#13138)
2012-04-25 14:03:53 -04:00
David Cole f45d004c0a Merge topic 'test-RunCMake-check'
38c3943 Teach RunCMake tests to allow custom checks
2012-04-25 14:03:37 -04:00
Brad King 8787f946b7 Merge branch 'list-empty-error' into enhance-include_external_msproject
Resolve conflict in Tests/RunCMake/CMakeLists.txt by adding both tests.
2012-04-19 09:33:29 -04:00
Brad King 4a30258d91 include_external_msproject: Test TYPE, GUID, PLATFORM options (#13120)
Add "RunCMake.include_external_msproject" test to use the TYPE, GUID, and
PLATFORM options to include_external_msproject.  Since projects with
custom types and platforms cannot be loaded without special VS plugins
validate the results by directly parsing the generated solution (.sln).

Co-Author: Leonid Yurchenko <nocturne@qarea.com>
2012-04-19 08:35:55 -04:00
Brad King 38c3943b6f Teach RunCMake tests to allow custom checks
Look for a <SubTest>-check.cmake script and load it to check side
effects of the sub test.  Provide it with the test source and build tree
paths in variables.  Check for a failure message in a result variable.
2012-04-19 08:32:57 -04:00
Brad King 05604eb9cb list: Handle errors on empty lists more gracefully (#13138)
Since commit ed1ea24c (Fix INSERT to allow inserting to empty list,
2006-05-15) the list command allows insertion into an empty list at
index 0.  Fix rejection of insertion at non-zero (negative) indices to
present an error message instead of crashing.

While at it, fix the error message of the GET and REMOVE_AT operations
when the list is empty to not present a bogus allowed range.

Add a "RunCMake.list" test to cover failure cases on empty lists.
2012-04-17 11:07:07 -04:00
Rolf Eike Beer 3ea850a502 FindPkgConfig.cmake: fix documented output variable not set (#13125,#13132)
The real fix is from Yury G. Kudryashov while I added the surrounding cleanups.
An additional hint to really get this fixed came from Rex Dieter.
2012-04-15 08:39:51 +02:00
David Cole c89264e275 Merge topic 'test-generated-def'
89987c2 Test generated module .def files
2012-04-03 15:59:37 -04:00
Brad King 89987c2102 Test generated module .def files
Teach the ModuleDefinition test to cover the case that a .def file is
generated by a custom command.
2012-04-02 10:54:25 -04:00
Alex Neundorf 9b32475587 automoc: add define to test which caused bug #13018
This does not really test that the bug is fixed, but at least it makes
it easy to check manually whether the bug is there or not.
I have to see whether I can build a test which does test that
a target is not rebuilt everytime.

Alex
2012-03-26 22:11:46 +02:00
Brad King 9d6b7bed7a Merge topic 'fix-CTestUpdateHG-url'
d0702f8 CTest.UpdateHG: Fix repo URL for leading slash
2012-03-23 13:35:28 -04:00
Brad King d0702f8214 CTest.UpdateHG: Fix repo URL for leading slash
Use "file:///..." instead of "file:////..." when the file system path
starts in a slash.  Commit 0916cc88 (CTest.UpdateHG: Fix repo URL for
local filesystem, 2012-03-02) added a third slash after "file://"
unconditionally.  This worked for many file systems but not on Cygwin
where "file:////cygdrive/..." looks like "file://" followed by a network
file path "//cygdrive/...".  Add the slash only if the file system path
does not already start with one.
2012-03-22 11:57:38 -04:00
David Cole d6d221d4bd Merge topic 'fix-AllFindModules-version-check'
a5ee628 Tests: Relax restrictions on version variable contents
2012-03-21 13:27:50 -04:00
David Cole 7e94e6b525 Merge topic 'watcom-object-library'
fb7348f Fix ObjectLibrary test on Watcom
2012-03-21 13:27:10 -04:00
David Cole a72893da36 Merge topic 'vs10-object-items'
b291d9e VS10: Fix external objects generated outside target (#13047)
328c0f6 Simplify cmVisualStudio10TargetGenerator source classification
2012-03-21 13:26:57 -04:00
David Cole 349ea3f6e6 Merge topic 'ImprovedCOMPONENTSSupportInFindPackage2'
6d100f9 find_package: Test rejection of required+optional components
d81d83c add macro check_required_components() to configure_package_config_file()
b15c0b4 FPHSA(): add HANDLE_COMPONENTS option
34108cd find_package: add documentation for OPTIONAL_COMPONENTS
cdabde8 FPHSA(): add missing "]" to documentation
f2e0a18 find_package: add OPTIONAL_COMPONENTS keyword
2012-03-21 13:26:46 -04:00
David Cole a5ee628519 Tests: Relax restrictions on version variable contents
Our only expectation of version number variables should be that
they begin with a decimal digit for VERSION_LESS, VERSION_EQUAL
and VERSION_GREATER comparison purposes. If people put extra
blah blah after a version number like "1.2.3 (this is some super
special extra information about our funky proprietary build of
the official 1.2.3 release)" then we should be ok with that.

So: now we have the following expectations for version number
variable content for the purposes of the AllFindModules test:

 - it should start with a decimal digit (match "^[0-9]")
 - it should not be empty
 - it should not be VERSION_EQUAL 0
 - it should not be NOT VERSION_GREATER 0
2012-03-20 16:18:02 -04:00
Brad King fb7348f644 Fix ObjectLibrary test on Watcom
The Watcom compiler interprets "-DB" as option

 -db generate browsing information

so define "A_DEF" and "B_DEF" instead of just "A" and "B".

Skip CMAKE_SHARED_LIBRARY_C_FLAGS for Watcom because it is set to

 -bd  build Dynamic link library

which adds a DLL entry point to each object.
2012-03-20 15:09:57 -04:00
David Cole 31c0bc0219 Merge topic 'object-library'
93d5509 Merge branch 'ninja-object-library' into object-library
821037c Merge branch 'xcode-object-library' into object-library
eb24c99 Merge branch 'object-library' into xcode-object-library
63d1be8 Xcode: Honor $<TARGET_OBJECTS:...> source expressions
020ba38 Merge branch 'object-library' into xcode-object-library
e8ea615 Build object library targets in Xcode
8045e17 Pre-compute object file names before Xcode generation
247a132 Allow txt files as ExtraSources in object library targets
b063599 Add a default source group for object files.
be01f3b Xcode: Re-factor some existing methods into "FromPath" variants
2693dbe Merge branch 'object-library' into ninja-object-library
51997cb Ninja: Honor $<TARGET_OBJECTS:...> source expressions
23ec258 Merge branch 'object-library' into ninja-object-library
61124de Build object library targets in Ninja
f5b06cd Pre-compute object file names before Ninja generation
a2514f1 Simplify cmNinjaTargetGenerator using cmGeneratorTarget
...
2012-03-20 09:34:35 -04:00
Brad King b291d9e756 VS10: Fix external objects generated outside target (#13047)
Commit 9a6ff950 (Fix for bug where VS2010 did not use .obj files,
2011-04-01) assumed that if an external object is GENERATED that it is
the output of a custom command in the current target.  If it is
generated by another target then VS will not automatically include the
external object in the current target.  This bug was preserved by the
refactoring in the parent commit.

Instead use <None> for external objects generated by a custom command in
the current target and <Object> for all other external objects.  Update
the ExternalOBJ test to cover this case.
2012-03-20 09:01:02 -04:00
Brad King f2b44c64fc Merge topic 'find_package_set_FOUND_VariableInConfigFile'
0cf8447 find_package: additional test for checking the error message
56ae3f9 find_package: add test for setting Foo_FOUND to FALSE in a Config file
16c0c73 find_package: allow <pkg>Config.cmake to set <pkg>_FOUND to FALSE
2012-03-19 14:42:03 -04:00
Brad King 6d100f9f46 find_package: Test rejection of required+optional components 2012-03-19 10:53:36 -04:00
Alex Neundorf d81d83c218 add macro check_required_components() to configure_package_config_file()
As discussed on cmake-developers, this patch adds a macro
check_required_components() to the file configured via
configure_package_config_file(), so for proper handling
of components in Config.cmake files users can simply call

check_required_components(PackageName)

and this will do the right thing.

Alex
2012-03-19 10:53:36 -04:00
Alex Neundorf b15c0b418b FPHSA(): add HANDLE_COMPONENTS option
if the HANDLE_COMPONENTS is used, FPHSA() now also checks all required COMPONENTS,
i.e. all elements from <name>_FIND_COMPONENTS for which <name>_FIND_REQUIRED_<comp>
is true, and sets <name>_FOUND only to true if all have been found.
As discussed on cmake-developers.

Alex
2012-03-19 10:53:36 -04:00
Brad King 572994bd9f Merge topic 'ninja-generator'
8485208 Ninja: shell escape $(CMAKE_SOURCE_DIR) and $(CMAKE_BINARY_DIR)
df84767 Ninja: add support for OBJECT_OUTPUTS, fix PrecompiledHeader test case
48eb7fc Ninja: Avoid using 'this' in member initializers
bba37dd Ninja: Fix for PDB files with spaces in the path.
ac800f4 Ninja: Constify use of cmCustomCommand
9a0d5a8 Ninja: add /DEF: flag to linker call
d40eebd Ninja: Add a cache option CMAKE_ENABLE_NINJA to enable the ninja generator.
8c63433 Ninja: Add friend struct so it can access the private ConvertToNinjaPath.
dbe3dce Ninja: add .def file support
f1bb08f Ninja: ensure the output dir exists at compile time
7a6b5f4 Ninja: Remove an unnecessary variable
80ff210 Ninja: Use cmSystemTools::ExpandListArgument to split compile/link commands
d2731a3 Ninja: Add a missed license header
eabc9b0 Ninja: CMake: Adapt Ninja generator for per-target include dirs
bada88e Merge branch 'target-include-directories' into ninja-generator
54bd175 Ninja: windows msvc: create for each target a .pdb file
...
2012-03-19 09:29:06 -04:00
Peter Collingbourne df847671b4 Ninja: add support for OBJECT_OUTPUTS, fix PrecompiledHeader test case 2012-03-17 23:16:40 +00:00
Brad King 2693dbe085 Merge branch 'object-library' into ninja-object-library 2012-03-16 10:20:20 -04:00
Brad King c68cc06612 Merge branch 'object-library' into ninja-object-library 2012-03-16 10:18:01 -04:00
Brad King c3242500b6 Test OBJECT library use without other sources
Reference OBJECT libraries for inclusion in targets that have no other
sources to verify that the linker language propagates correctly from the
object libraries.  Test with a STATIC library, a SHARED library, and an
EXECUTABLE target.  Use the static and shared libraries each in
executables that end up using the object library symbols.

In VS 6, 7, and 7.1 add a dummy object file to convince the IDE to build
the targets without sources.  In Xcode add a dummy source file to
convince it to build targets without sources.
2012-03-16 10:12:30 -04:00
Brad King db7ef82402 Test OBJECT library language propagation
Teach the RunCMake.ObjectLibrary test to verify that languages used in
an OBJECT library are propagated to targets that use it so that the
languages can be included in link analysis.
2012-03-16 10:12:30 -04:00
Brad King 5683101669 Test OBJECT library failure cases
Add "RunCMake.ObjectLibrary" test to verify that unsupported use cases
are rejected with errors:

* An OBJECT library may not reference another object library
* An OBJECT library may not be referenced in target_link_libraries
* An OBJECT library may not contain non-compiling sources
* An OBJECT library may not have pre/post build/link commands
* An OBJECT library may not be installed, exported, or imported

Also verify that invalid $<TARGET_OBJECTS:...> expressions are
diagnosed.
2012-03-16 10:12:30 -04:00
Brad King 69d3d1835c Test OBJECT library success cases
Add "ObjectLibrary" test to build and use OBJECT libraries.  Build
multiple object libraries in separate directories with different flags.
Use a custom command to generate a source file in one OBJECT library.

Reference the OBJECT libraries for inclusion in a STATIC library, a
SHARED library, and an EXECUTABLE target.  Use the static and shared
libraries each in executables that end up using the object library
symbols.  Verify that object library symbols are exported from the
shared library.
2012-03-16 10:12:30 -04:00
Alex Neundorf 0cf84472d7 find_package: additional test for checking the error message
This patch adds a test which checks the error message, which is
produced in the case that a Config file has set Foo_FOUND to FALSE
by itself.

Alex
2012-03-13 16:56:52 -04:00
Alex Neundorf 56ae3f9412 find_package: add test for setting Foo_FOUND to FALSE in a Config file
Alex
2012-03-13 16:56:52 -04:00
Brad King d4c0aab007 Merge topic 'test-RunCMake'
55b2aa8 Use generalized RunCMake test infrastrucure for build_command test
eb33000 Use generalized RunCMake test infrastrucure for find_package test
42a81e7 Add stronger infrastructure for CMake-only tests
2012-03-13 11:54:47 -04:00
Brad King 55b2aa884c Use generalized RunCMake test infrastrucure for build_command test
The CMakeCommands.build_command test performs output/error checking
so move it over to RunCMake to re-use the generalized infrastrucure.
This is the only test left using Tests/CMakeCommands/CMakeLists.txt
so remove it.
2012-03-12 09:33:21 -04:00
Brad King eb33000d75 Use generalized RunCMake test infrastrucure for find_package test 2012-03-12 09:33:21 -04:00
Brad King 42a81e7119 Add stronger infrastructure for CMake-only tests
The CMakeOnly directory added by commit 9a20abf0 (Add infrastructure for
CMake-only tests, 2012-01-11) was sufficient only for tests that always
run CMake to successfully configure a project.  Later commit eeaaffcb
(find_package: Test error and warning messages in failure cases,
2012-02-28) added a sample test that covers failure cases.

Generalize the above to create new "RunCMake" test infrastructure that
can run CMake multiple times for a single project with different
variations and check for expected result/stdout/stderr.  Allow for both
successful and failing CMake project configuration cases.  This will be
useful to test error messages and failure behavior.
2012-03-12 09:33:21 -04:00
Alex Neundorf e390f87dd1 WriteBasicConfigVersionFile: add test for ExactVersion mode
Alex
2012-03-10 16:19:02 +01:00
David Cole fa0f065426 Merge topic 'find_package_fatal_error_if_required_and_config_not_found'
c5ae733 find_package: Test that REQUIRED aborts processing correctly
c91a54d find_package: error out if REQUIRED Config has not been found
2012-03-08 15:14:23 -05:00
David Cole da43d8fa8d Merge topic 'MakingConfigFilesEasier_ConfigureMacro'
6973e2d wrap write_basic_config_version_file as write_basic_package_version_file()
204f5d4 add CMakePackageConfigHelpers: configure_package_config_file()
2012-03-08 15:14:12 -05:00
David Cole f55119e63b Merge topic 'fix-12189-support-SBCS-in-VS'
b28e7fa VS6: Avoid SBCS test on VS6 (#12189)
df19b9c VS6: Avoid _MBCS define when _SBCS is defined (#12189)
ba89e92 Visual Studio: Allow setting Single Byte Character Set (#12189)
2012-03-08 15:14:03 -05:00
David Cole 580171185b Merge topic 'target-include-directories'
d662dff Fix shadowed variable warning on dashboard results
f66e735 Fix compiler warning reported on older Borland dashboard.
d90eed4 Fix compiler error reported on older Borland dashboard.
8233636 Update the documentation regarding INCLUDE_DIRECTORIES.
d899eb7 Call ExpandVariablesInString for each target's INCLUDE_DIRECTORIES
c21db87 Make search paths ordered and unique
22021f0 Remove cmMakefile::GetIncludeDirectories
9106b56 Extract and use the INCLUDE_DIRECTORIES target properties.
840509b Keep the INCLUDE_DIRECTORIES target property up to date.
a4d5f7b Add API to get the ordered includes for a target.
8adaee2 CMake: Eliminate cmMakefile::IncludeDirectories
7620932 Remove include flags memoization.
97a5faa Make it safe to call this method without creating duplicates.
edd5303 Refactor GetIncludeFlags to take includes instead of fetching them
2012-03-08 15:13:15 -05:00
Brad King c5ae733166 find_package: Test that REQUIRED aborts processing correctly
Verify that the command produces a FATAL_ERROR if and only if the
missing package is REQUIRED.
2012-03-07 11:34:59 -05:00
Alex Neundorf 6973e2d5a8 wrap write_basic_config_version_file as write_basic_package_version_file()
So the name fits better with configure_package_config_file(), as
discussed on the mailing list. Adapt the documentation accordingly.

Alex
2012-03-07 11:23:18 -05:00
Alex Neundorf 204f5d443c add CMakePackageConfigHelpers: configure_package_config_file()
The function configure_package_config_file() may be used instead of
configure_file() for generating the Config.cmake files for installation,
they help to make those files relocatable.

Alex
2012-03-07 11:23:11 -05:00
David Cole b28e7fa174 VS6: Avoid SBCS test on VS6 (#12189)
The previous commit, df19b9ca, assumed that the corresponding
_UNICODE functionality in the VS6 generator actually worked.
That turns out not to be the case. Unicode definition does not
actually suppress _MBCS definition, so neither does this new
code...

Don't test it here, since the patch submitter for _SBCS does
not need VS6 support.

If somebody needs _UNICODE and _SBCS support to suppress the
definition of _MBCS in the VS6 generator, it is work yet to do.
Patches welcome.
2012-03-06 18:45:51 -05:00
David Cole 663832eb44 Merge topic 'test-getpropery'
b43cd12 add test for get_property() errors
2012-03-06 15:27:28 -05:00
David Cole 481b2aa101 Merge topic 'allfindmodules-versions'
234b7ca AllFindModules test: do not require TCLSH version
2012-03-06 15:26:51 -05:00