Commit Graph

670 Commits

Author SHA1 Message Date
Stephen Kelly 447fbb3fac Tests: Execute compile features tests unconditionally.
Conditionally create a dummy test if there are no known features.
2014-04-17 16:20:50 +02:00
Brad King b56a9ae7f1 Merge topic 'target_compile_features'
9eaf3755 Export: Populate INTERFACE_COMPILE_FEATURES property.
8ed59fc2 Add target_compile_features command.
4e6ca504 cmTargetPropCommandBase: Change the interface to return bool.
5412dede cmTarget: Transitively evaluate compiler features.
baff4434 cmTarget: Allow populating COMPILE_FEATURES using generator expressions.
f97bf437 Features: Add cxx_auto_type.
03355d6b cmTarget: Add COMPILE_FEATURES target property.
faeddf64 project: Add infrastructure for recording CXX compiler features
913394af cmTarget: Add CXX_STANDARD and CXX_EXTENSION target properties.
8238a6cd Add some COMPILE_OPTIONS for specifying C++ dialect.
892243fc Tests: Require CMake 3.0 for the SystemInformation test.
59b5fdd3 Don't load Clang-CXX from AppleClang-CXX.
2014-04-15 10:32:11 -04:00
Rolf Eike Beer b0b4b4602f Remove .* expressions from beginning and end of MATCHES regexs
All these expressions work the same:
  "foo"
  ".*foo.*"
  "^.*foo.*$"

This assumes that the "Intel*" expressions were meant to be "Intel.*".
2014-04-14 18:17:11 +02:00
Stephen Kelly 8ed59fc207 Add target_compile_features command.
This can be used to set the compiler features required by particular
targets. An error is issued at CMake time if the compiler does not
support the required feature. If a language dialect flag is required
by the features used, that will be added automatically.

Base the target_compile_features command on cmTargetPropCommandBase. This
gives us 'free' handling of IMPORTED, ALIAS, INTERFACE, non-compilable
and missing targets.
2014-04-07 18:11:18 +02:00
Stephen Kelly f97bf4370c Features: Add cxx_auto_type.
Record the availability of this feature for GNU 4.8 on (UNIX AND
NOT APPLE) only.  In the future, availability can be recorded for
earlier GNU, for other platforms and for other compilers. Initially
the affected configurations are as restricted as possible to allow
for easy testing while extending the features vector in only one
dimension.

The error message when using the set_property API directly is not
very good, but follow up commits will provide origin debugging of
the property and a target_compile_features command which will
provide a configure-time backtrace when possible.
2014-04-07 18:11:18 +02:00
Stephen Kelly 913394af24 cmTarget: Add CXX_STANDARD and CXX_EXTENSION target properties.
These are used to determine whether to add -std=c++11, -std=gnu++11
etc flags on the compile line.
2014-04-07 16:48:44 +02:00
Alex Ciobanu 63d864a026 Tests: Fix CTestTestFailedSubmit-ftp with OS X system libcurl
On OS X 10.9 the system libcurl has a different error message when
failing to connect:

  Failed connect to :21; Connection refused

Match this message to pass the test.
2014-04-03 16:48:37 -04:00
Stephen Kelly 3676fb4963 cmTarget: Allow transitive evaluation of SOURCES property.
Extend the cmGeneratorExpressionDAGChecker with an interface
returning the name of the top target.  Use that to determine
when there is a DAG violation, as required by the RunCMake.Languages
tests.
2014-04-02 23:14:02 +02:00
Stephen Kelly e6971df6ab cmTarget: Make the source files depend on the config.
Disallow the use of config-specific source files with
the Visual Studio and Xcode generators. They don't have
any way to represent the condition currently.

Use the same common-config API in cmQtAutoGenerators. While
it accepts config-specific files, it doesn't have to support
multiple configurations yet.

Loop over the configs in cmTargetTraceDependencies
and cmGlobalGenerator::WriteSummary and consume all source
files.

Loop over the configs in cmComputeTargetDepends and compute the
object library dependencies for each config.
2014-04-02 23:14:02 +02:00
Brad King ad9f0d831e Merge topic 'dev/string-apis'
b633b263 CPackWiX: Fix test to build with expected config
191f25e2 stringapi: Prevent a NULL dereference in WiX
219d6ad6 speedup: Avoid excess iterator dereferences
caaad357 speedup: Cache strings for comparisons
7abf4e31 stringapi: Use strings for dependency information
94fc63e2 stringapi: Use strings for cache iterator values
85fc9f26 stringapi: Command names
6557382d stringapi: Use strings for program paths
1a1b737c stringapi: Use strings for generator names
24b5e93d stringapi: Use strings for directories
11ed3e2c stringapi: Add string overload for the Def struct
b3bf31a5 stringapi: Miscellaneous char* parameters
5af95c39 typo: Match argument name with the header
2b17626e stringapi: Pass strings as install directories in CPack
3def29da stringapi: Use strings for feature arguments
acb116e3 stringapi: Return a string reference for the configuration
...
2014-03-09 10:29:02 -04:00
Brad King b633b26308 CPackWiX: Fix test to build with expected config 2014-03-08 13:05:40 -05:00
Brad King 25fb430e96 Utilities/Release: Fix nightly build upload
Since commit 71b14dcb (Utilities/Release: Do not upload doc staging
tarball, 2014-02-26) the prefix upload_release.cmake computes does not
match any files when used with -DVERSION=master as has been done for the
nightly binary builds.  Since the version is not actually 'master'
anyway, change the nightly binary upload logic to explicitly pass the
destination directory.  Do not pass any VERSION so the default is taken
and matches the binaries.
2014-03-06 09:32:04 -05:00
Brad King 9608ef6f40 Tests: Optionally configure tests exclusively, with an external CMake
Add an undocumented CMake_TEST_EXTERNAL_CMAKE option to name an external
CMake 'bin' directory.  Skip all main CMake binary builds and instead
configure the Tests directory to run using the external CMake provided.
This will provide a means to exercise the CMake test suite generating
for target platforms and compilers with which the CMake source does not
build.  That will allow us to raise the level of C++ features required
of a compiler to build our source while retaining tests for generating
projects with older compiler tools.
2014-03-03 15:49:17 -05:00
Brad King 9f5bd180c8 Tests: Drop CMAKE_TEST_GENERATOR(|_TOOLSET) variables
s/CMAKE_TEST_GENERATOR/CMAKE_GENERATOR/g
2014-03-03 15:26:49 -05:00
Brad King 76477267bd Tests: Drop CMAKE_TEST_MAKEPROGRAM variable
Remaining uses of the variable simply test its value so use
CMAKE_MAKE_PROGRAM directly instead.
2014-03-03 15:26:49 -05:00
Brad King a8a9fb7edd Tests: Rename CMAKE_TEST_MAKEPROGRAM uses for explicit make program
Rename uses of the variable for specifying the make program used to
build test projects to CMake_TEST_EXPLICIT_MAKE_PROGRAM.
2014-03-03 15:26:48 -05:00
Brad King 4047557379 Tests: Rename CMAKE_TEST_MAKEPROGRAM uses for nested test projects
In the ExportImport, Fortran, and MacRuntimePath tests the
CMAKE_TEST_MAKEPROGRAM variable is used to pass an explicit request for
a CMAKE_MAKE_PROGRAM value to be used when building the inner projects.
Rename these use cases to CMake_TEST_NESTED_MAKE_PROGRAM.
2014-03-03 15:26:48 -05:00
Brad King f99734b2da Tests: Rename CMAKE_TEST_DEVENV -> CMake_TEST_DEVENV
Follow the convention of naming variables related to the CMake build
itself as "CMake_" rather than "CMAKE_".  While at it, consolidate the
code computing CMake_TEST_DEVENV to be more localized.
2014-03-03 15:26:48 -05:00
Brad King 3c01ee5adc Tests: Drop CMAKE_TEST_MSVC and test MSVC directly
Now that we no longer support running tests using a different generator
we can trust the MSVC platform indicator directly.
2014-03-03 15:26:48 -05:00
Brad King daf0a5fede Tests: Drop CMAKE_TEST_GENERATOR and CMAKE_TEST_MAKEPROGRAM options
Drop the option to test with a different generator and make program than
was used to build.  This was used only to test support for the Open
Watcom compiler which at one time could not build CMake.  Instead we
will allow CMake to be configured to skip building binaries and just run
the test suite using an external CMake (in a future change).

For now leave the two option variables hard-coded to the old option
defaults until code can be updated to stop using them.
2014-03-03 15:26:46 -05:00
Brad King e509631237 Tests: Drop kwsys test
KWSys now has its own dashboard and test clients that run on all the
machines where we test CMake.  We no longer need a test inside CMake to
test KWSys independently.
2014-03-03 15:25:01 -05:00
Stephen Kelly 0bba365ff5 Add test for find_dependency macro. 2014-02-26 22:21:03 +01:00
Stephen Kelly 2e615d4be9 Remove the Example from the source.
It is not showing modern practice, and is obsolete as documentation
after the rst documentation system and new content.
2014-02-09 22:09:20 +01:00
Brad King f748b59e20 Merge topic 'fix-Qt-autogen'
6053ce22 QtAutogen: Make uic work even when the source is in a subdir.
1fc9ecfa FindQt4: Make AUTOMOC work regardless which order Qt 4/5 is found.
2014-02-04 13:34:54 -05:00
Nils Gladitz efdcebddbd VisibilityInlinesHidden: only apply -fvisibility-inlines-hidden to C++ sources 2014-02-01 09:55:24 +01:00
Stephen Kelly 1fc9ecfae6 FindQt4: Make AUTOMOC work regardless which order Qt 4/5 is found.
Commit 321e348e (QtAutogen: Use Qt 4 IMPORTED targets to find
executable locations., 2014-01-24) attempted to fix this problem,
but only solved it for a particular ordering of find_package for
Qt 4 and Qt 5.

Add a test to ensure that it works with both orderings.
2014-01-29 17:02:43 +01:00
Rolf Eike Beer 3a0d164bb2 allow to mark a test as "Not Run" with a specific return code (#8466) 2014-01-14 23:57:40 +01:00
Brad King 69c366a281 Merge topic 'optional-install'
be0458c InstallRules: added new variable to disable generation of install rules
2014-01-09 09:37:17 -05:00
Nils Gladitz be0458c562 InstallRules: added new variable to disable generation of install rules
The boolean variable CMAKE_SKIP_INSTALL_RULES
allows disabling generation of install rules for projects which don't
want them.
2014-01-08 16:28:14 +01:00
Stephen Kelly 03d842a982 Run the add_compile_options command unit test.
This has not been executed since it was added in
commit a984f325 (Introduce add_compile_options command., 2013-06-04).
2014-01-04 11:28:57 +01:00
Nils Gladitz 7f0d4aff24 CTest: fix regressions introduced by the ctest-fix-run-serial topic
The first regression resulted in endless looping due to unrun test
dependencies. The second regression prioritized all tests with dependencies
in serial test runs.
2013-12-23 15:31:15 +01:00
Stephen Kelly 97fae68b81 Remove INTERFACE build targets.
Commit b04f3b9a (Create make rules for INTERFACE_LIBRARY
targets., 2013-08-21) extended the makefile generator to create
build targets for INTERFACE_LIBRARY targets. No other generators
were extended with this feature.

This conflicts with the feature of whitelisting of target properties
read from INTERFACE_LIBRARY targets. The INTERFACE_* properties
of the INTERFACE_LIBRARY may legitimately contain TARGET_PROPERTY
generator expressions for reading properties from the 'head target'.
The 'head target' would be the INTERFACE_LIBRARY itself when creating
the build rules for it, which means that non-whitelisted properties
would be read.
2013-12-10 17:58:36 +01:00
Stephen Kelly 98093c45db QtAutoUic: Add INTERFACE_AUTOUIC_OPTIONS target property.
Transitively consume the property from linked dependents.

Implement configuration-specific support by following the pattern
set out for compile definitions and includes in cmQtAutoGenerators.

Implement support for origin-tracking with CMAKE_DEBUG_TARGET_PROPERTIES.

This is motivated by the needs of KDE, which provides a separate
translation system based on gettext instead of the Qt linguist
translation system. The Qt uic tool provides command line options
for configuring the method used to translate text, and to add an
include directive to the generated file to provide the method.

 http://thread.gmane.org/gmane.comp.kde.devel.frameworks/7930/focus=7992

Implement the interface to provide the uic options as a usage-requirement
on the KI18n target, as designed for KDE.
2013-11-27 19:06:12 +01:00
Stephen Kelly 7521da2852 Introduce CMAKE_STAGING_PREFIX variable.
This variable can be useful in cross-compiling contexts where the
sysroot is read-only or where the sysroot should otherwise remain
pristine.

If the new CMAKE_STAGING_PREFIX variable is set, it is used instead
of CMAKE_INSTALL_PREFIX when generating the installation rules in
cmake_install.cmake.

This way, the CMAKE_INSTALL_PREFIX variable
always refers to the installation prefix on the target device, regardless
of whether host==target.

If any -rpath paths passed to the linker contain the CMAKE_STAGING_PREFIX,
the matching path fragments are replaced with the CMAKE_INSTALL_PREFIX.
Matching paths in the -rpath-link are not transformed.

The cross-prefix usr-move workaround is assumed not to require extension
regarding CMAKE_STAGING_PREFIX. The staging area is a single prefix, so
there is no scope for cross-prefix symlinks. The CMAKE_INSTALL_PREFIX
is still used to determine the workaround path, and that variable
remains the relevant one even if CMAKE_STAGING_PREFIX is used. If the
generated export files are deployed to the target, the workaround
will still be in place, and still be employed if required.
2013-11-21 11:48:03 +01:00
Brad King 5229f2df63 Tests: Do not use an explicit make program for VS generators
Do not pass the CMAKE_MAKE_PROGRAM cache entry to tests when using the
VS generators.  Allow them to pick the correct build tool automatically.
2013-11-18 11:30:50 -05:00
Brad King 72dd738bd4 Tests: Fix MFC test heuristic for empty CMAKE_TEST_MAKEPROGRAM
Also disable the MFC test if CMAKE_MAKE_PROGRAM is vcexpress.
2013-11-18 11:30:50 -05:00
Brad King fd6076d075 Tests: Pass CMAKE_MAKE_PROGRAM instead of --build-makeprogram
Pass the CMAKE_TEST_MAKEPROGRAM, if any, to each test at CMake time in
the CMAKE_MAKE_PROGRAM cache entry.  Pass the CMAKE_TEST_MAKEPROGRAM
into the ExportImport, Fortran, and MacRuntimePath tests so that they
may do the same for the nested project configurations.

Now "ctest --build-and-test" can get the make program from the test
build tree cache, so drop the explicit --build-makeprogram.
2013-11-18 11:30:50 -05:00
Brad King 68031abf15 Tests: Configure SubProject-Stage2 test more robustly
Fix the condition that adds the test to check CMAKE_TEST_GENERATOR
rather than the tools used to build CMake.  Drop the test on Ninja
because the generator does not support subproject generation anyway.
Stop using the general build_generator_args and pass the
--build-generator options explicitly.  Also pass --build-makeprogram
explicitly when CMAKE_TEST_MAKEPROGRAM is available because there is no
CMakeCache.txt in the test project subdirectory from which to pick up
the make program.
2013-11-18 11:30:50 -05:00
Brad King 003d10c248 Tests: Simplify VSExcludeFromDefaultBuild configuration
Create a CTEST_TEST_DEVENV variable that is set to the
CMAKE_MAKE_PROGRAM used for Visual Studio 7, 8, and 9.  It will always
be either "devenv" or "VCExpress", and not "MSBuild".  Add the
VSExcludeFromDefaultBuild test only when this variable is set, and use
its value as the --build-makeprogram value.

More work will be needed later to restore the test on VS 10 and above
when devenv is available, but this is the simplest approach for now.
2013-11-18 11:30:49 -05:00
Brad King e47d934a5a Tests: Simplify VSProjectInSubdir configuration
The test is only enabled on VS 10 and above, where the generators now
select for "ctest --build-and-test" the MSBuild tool by default.
Simplify the test configuration by dropping the --build-makeprogram
option and all the logic needed to compute its value.  The test will
automatically use MSBuild.
2013-11-18 11:30:49 -05:00
Brad King e965cb12e2 Tests: Simplify CTest.BuildCommand.ProjectInSubdir configuration
Collect all ctest_configure options in a list to configure it into the
test script.  Drop the unused -DCMAKE_MAKE_PROGRAM argument to ctest.
2013-11-18 11:30:49 -05:00
Brad King 72bf2552f2 Tests: Pass --build-options to every test
Create a "build_options" variable whose value is passed to every
"ctest --build-and-test" call through the --build-options argument.
2013-11-18 11:30:49 -05:00
Brad King cc23f92861 Tests: Split <test>_EXTRA_OPTIONS into <test>_(CTEST|BUILD)_OPTIONS
Some extra options are for "ctest --build-and-test" directly, and others
are values for "--build-options".  Split these two roles out into two
separate variables and update existing uses.
2013-11-18 08:26:23 -05:00
Brad King 20bac8f19e Tests: Simplify ExternalProjectUpdate test arguments
Drop the -DCMAKE_TEST_MAKEPROGRAM argument because the value is not
used inside the test script.
2013-11-18 08:26:23 -05:00
Brad King 4d85365307 Tests: Fix make capability selection for empty CMAKE_TEST_MAKEPROGRAM 2013-11-18 08:26:23 -05:00
Brad King 8ee6b47630 Tests: Launch BootstrapTest through cmake instead of ctest
Run the bootstrap script through "cmake -P" instead of
"ctest --build-and-test" so that we do not need to abuse
the --build-makeprogram option of the latter.
2013-11-18 08:26:22 -05:00
Brad King 7fc7624af5 Tests: Move CMAKE_TEST_MAKEPROGRAM into Tests/CMakeLists.txt
Also drop the temporary MAKEPROGRAM variable and the DART_ROOT special
case.  We never run dashboard clients with Dart anymore.
2013-11-18 08:26:22 -05:00
Brad King 1f679b8d46 Tests: Drop remnants of unused ShellInstall test
The ShellInstall test has long been replaced by the CMake.Install test.
2013-11-18 08:26:21 -05:00
Brad King 42eaf34168 Merge topic 'configure_file-drop-IMMEDIATE'
15610bb Drop use of configure_file IMMEDIATE option
2013-11-14 11:28:07 -05:00
Daniele E. Domenichelli 15610bb5b1 Drop use of configure_file IMMEDIATE option
Since commit 7d47c693 (Drop compatibility with CMake < 2.4, 2013-10-08)
we no longer need to use the configure_file IMMEDIATE option to support
compatibility modes less than 2.0.
2013-11-13 10:12:17 -05:00
Brad King 2bbf6bd7f8 Copyright.txt: Add test to check year range
Add a CMake.Copyright test that, when the CMake version number knows the
year (as it does in development versions), checks that Copyright.txt has
been updated with the current version year.
2013-11-12 16:35:26 -05:00
Nils Gladitz 9d9f102f53 Tests: added test for ctest_empty_binary_directory() 2013-11-01 21:32:16 +01:00
Nils Gladitz 4fcb97eaac Tests: Add test for CTEST_USE_LAUNCHERS capture of custom commands
This new test detects if custom command failures are detected with
launchers.
2013-10-31 09:29:55 -04:00
Brad King fcbe435c23 Merge topic 'Qt-auto-generators'
9c87d9c Add automatic rcc invocation for Qt.
84218e1 Add automatic uic invocation for Qt.
94a0ca6 Record which files are skipped by automoc.
18fb758 Run the main executable created in the autogen tests.
e485ba1 Rename the QtAutomoc tests to QtAutogen.
7ce65c3 Add extra checks for the AUTOMOC target property.
32771fc Update output messages for generic use.
f371ab5 Rename RunAutomoc to RunAutogen.
85b3d6e Extract an SetupAutoMocTarget method.
ca124a1 Rename the AutomocInfo.cmake file to be more generic.
a342c9f Move some makefile definitions up away from moc-specific code.
98632ef Add the AUTOGEN_TARGETS_FOLDER and obsolete AUTOMOC_TARGETS_FOLDER.
63378ba Rename some variables to reflect broader scope.
97f1aa3 Rename method to reflect generic use.
4abb111 Rename local variable to reflect generic use.
03878c9 Move variable set to where it is used.
...
2013-10-28 15:23:09 -04:00
Brad King 38fc334fd0 Merge topic 'ctest-fix-run-serial'
ff59365 CTest: fix dashboard issues associated with the ctest-fix-run-serial topic
7a665ae CTest: added test for RUN_SERIAL issue #14484
384beff CTest: added comments that describe the basic test sorting approach
adbe00d CTest: removed redundant copy of test dependency set
1b750cb CTest: perform cycle test early
6d4d7ca CTest: consider previously failed tests before all others
e809d8c CTest: prioritize tests by their depth in the dependency graph
44017a4 CTest: handle dependent and non dependent test requirements equally
2013-10-26 10:29:34 -04:00
Pedro Navarro 970c82348b ctest_update: Add support for Perforce p4 client
Teach the ctest_update implementation to use the p4 command-line
client to perform updates and extract the list of changes.

Add a CTest.UpdateP4 test like those that exist already for the other
version control tools.  Make the test available when p4 and the p4d
server are found.  During the test launch p4d in the background to
serve a repository from the test directory.  Then direct the client
toward this server for the duration of the test.
2013-10-26 10:24:15 -04:00
Nils Gladitz ff59365f8b CTest: fix dashboard issues associated with the ctest-fix-run-serial topic 2013-10-25 21:39:58 +02:00
Stephen Kelly 18fb7588df Run the main executable created in the autogen tests.
Don't try to show the windows, which would require a gui capable test
machine, and that's not guaranteed.

Automatically link to qtmain.a on Windows to avoid a policy warning. Set
policy CMP0020 to NEW by increasing the required version.

Don't attempt to run the test when using Windows.
2013-10-24 11:50:58 +02:00
Stephen Kelly e485ba1219 Rename the QtAutomoc tests to QtAutogen. 2013-10-24 11:50:58 +02:00
Brad King 6384f1683a Merge topic 'remove-cmake-i-wizard'
a8226e9 cmake: Drop support for "-i" wizard mode
2013-10-22 09:07:14 -04:00
Nils Gladitz 7a665ae7e3 CTest: added test for RUN_SERIAL issue #14484 2013-10-21 22:13:22 +02:00
Stephen Kelly b04f3b9a2a Create make rules for INTERFACE_LIBRARY targets.
The result is that the depends of the target are created.

So,

 add_library(somelib foo.cpp)
 add_library(anotherlib EXCLUDE_FROM_ALL foo.cpp)
 add_library(extra EXCLUDE_FROM_ALL foo.cpp)
 target_link_libraries(anotherlib extra)

 add_library(iface INTERFACE)
 target_link_libraries(iface INTERFACE anotherlib)

Executing 'make iface' will result in the anotherlib and extra targets
being made.

Adding a regular executable to the INTERFACE of an INTERFACE_LIBRARY
will not result in the executable being built with 'make iface' because
of the logic in cmComputeTargetDepends::AddTargetDepend.

So far, this is implemented only for the Makefile generator. Other
generators will follow if this feature is possible for them.

Make INTERFACE_LIBRARY targets part of the all target by default.
Test this by building the all target and making the expected library
EXCLUDE_FROM_ALL.
2013-10-21 09:46:27 -04:00
Brad King a8226e91d7 cmake: Drop support for "-i" wizard mode
Tell users to pass cache values with the -D option on the command line
or use cmake-gui or ccmake.
2013-10-18 13:32:39 -04:00
Brad King 277bd1db98 Drop CMAKE_STRICT mode
With our modern development workflow it is less likely a property will
be added to C++ code without documentation.  This mode only existed to
support the DocTest which had very limited coverage of the properties
anyway.
2013-10-15 10:47:38 -04:00
Stephen Kelly 920ffbf50f Require CMake 2.8.4 or greater to build CMake
This allows the use of the $<TARGET_FILE:...> generator expression as a
replacement for the use of the LOCATION target property.  The use of the
LOCATION target property is now deprecated for in-build targets.

Also drop other checks for older CMake versions:

* Simplify cmake_set_target_folder macro.
* Use find_package(LibArchive) unconditionally.
* Simplify condition for running testVisualStudioSlnParser test.
* Convert two macros to functions.
* Unconditionally run the CTestTestRerunFailed test.
2013-10-15 09:22:56 -04:00
Brad King e5f17214a5 Merge topic 'FindGTK2-targets'
7efef02 FindGTK2: Add tests for components and targets in gtk and gtkmm modules
95fc47a FindGTK2: Make pangocairo and cairo optional dependencies
26f790f FindGTK2: Change extra includes -> optional
24e0272 FindGTK2: do not skip target creation if optional dependencies are not found
d5f130c FindGTK2: Refactor _GTK2_ADJUST_LIB_VARS into _GTK2_ADD_TARGET
fffbd72 FindGTK2: Do not add freetype includes if they are not found
b69720d FindGTK2: Add libraries to the GTK2_LIBRARIES variable only when found
425ec40 FindGTK2: Do not link libfreetype
e9f46df FindGTK2: Add config directories only if different from include ones
56a79e1 FindGTK2: Set INTERFACE_COMPILE_DEFINITIONS target property only if not empty
4b47586 FindGTK2: Add check to ensure that target exists
61242cc FindGTK2: Fix gmodule, glibmm, pangoft2, and pangoxft targets
4b876de FindGTK2: Link freetype libs to targets including freetype includes
67e761f FindGTK2: Small cleanup
682eea3 FindGTK2: Do not require the GTK_ prefix in all the internal functions
0bc3763 FindGTK2: Better handling of include directories
...
2013-10-09 10:23:31 -04:00
Brad King f8241136b4 Merge topic 'INTERFACE_LIBRARY-target-type'
ce0c303 install: Teach EXPORT option to handle INTERFACE_LIBRARY targets
435c912 export: Add support for INTERFACE_LIBRARY targets
fe73226 Add the INTERFACE_LIBRARY target type.
2013-10-08 10:58:40 -04:00
Daniele E. Domenichelli 7efef02df2 FindGTK2: Add tests for components and targets in gtk and gtkmm modules 2013-10-08 10:47:06 -04:00
Brad King 2ba45f5285 Merge topic 'Add-coverage.py-Coverage'
d0ec3a0 Adding support for the Python coverage.py tool.
2013-10-08 09:53:25 -04:00
Brad King 5bf7102505 Merge topic 'ctest_rerun_failed'
eb2decc ctest: Add --rerun-failed option
2013-10-08 09:53:17 -04:00
Patrick Reynolds d0ec3a01a6 Adding support for the Python coverage.py tool.
This assumes that coverage.py has been run in such a way to produce its
standard XML output. This uses the Cobertura schema and should be somewhat
generalizable.
2013-10-08 09:20:30 -04:00
Zack Galbreath eb2decc02d ctest: Add --rerun-failed option
Add a new command line argument to ctest.  This allows users to
rerun tests that failed during the previous call to ctest.  This
is accomplished by analyzing the most recently modified file named
"^LastTestsFailed*" in the Testing/Temporary subdirectory of the
project's binary directory.
2013-10-08 09:18:13 -04:00
Stephen Kelly fe732264e9 Add the INTERFACE_LIBRARY target type.
This target type only contains INTERFACE_* properties, so it can be
used as a structural node. The target-specific commands enforce
that they may only be used with the INTERFACE keyword when used
with INTERFACE_LIBRARY targets. The old-style target properties
matching LINK_INTERFACE_LIBRARIES_<CONFIG> are always ignored for
this target type.

The name of the INTERFACE_LIBRARY must match a validity generator
expression. The validity is similar to that of an ALIAS target,
but with the additional restriction that it may not contain
double colons. Double colons will carry the meaning of IMPORTED
or ALIAS targets in CMake 2.8.13.

An ALIAS target may be created for an INTERFACE library.

At this point it can not be exported and does not appear in the
buildsystem and project files are not created for them. That may
be added as a feature in a later commit.

The generators need some changes to handle the INTERFACE_LIBRARY
targets returned by cmComputeLinkInterface::GetItems. The Ninja
generator does not use that API, so it doesn't require changes
related to that.
2013-10-07 19:56:31 -04:00
Brad King b41f2dd7d2 Merge topic 'test-Qt4-quiet'
a3170c8 Tests: Make find_package(Qt4) QUIET
2013-10-07 15:45:11 -04:00
Brad King a3170c8b0c Tests: Make find_package(Qt4) QUIET
The lack of Qt4 on a system should silently skip the corresponding tests
with no other messages.  This is already the case for other find_package
calls in Tests/CMakeLists.txt.
2013-10-03 13:12:07 -04:00
Ben Boeckel d331292c12 cmTestGenerator: Evaluate generator expressions in test properties
This is useful for cases like:

  add_test(NAME mytest COMMAND mydriver $<TARGET_FILE:myexe>)
  set_tests_properties(mytest PROPERTIES
    REQUIRED_FILES "$<TARGET_FILE:myexe>"
    WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>"
    )

In this example we require the actual test executable to exist to
run the test in addition to the test driver at argv[0].  Also the
$<CONFIGURATION> expression improves over \${CTEST_CONFIGURATION_TYPE}
because the latter is not normalized for case-sensitive filesystems.
2013-09-20 08:18:22 -04:00
Brad King cd345aa77d Skip CTestLimitDashJ test on Borland
The Borland-built CTest binary has trouble running many instances of
itself in parallel, making the test unreliable.  No particular recent
change appears to be the culprit and the failure is not reliably
reproducible.  Just silence the failure for now by skipping the test.
2013-08-07 10:41:06 -04:00
Stephen Kelly 370bf55415 Add the ALIAS target concept for libraries and executables.
* The ALIAS name must match a validity regex.
* Executables and libraries may be aliased.
* An ALIAS acts immutable. It can not be used as the lhs
  of target_link_libraries or other commands.
* An ALIAS can be used with add_custom_command, add_custom_target,
  and add_test in the same way regular targets can.
* The target of an ALIAS can be retrieved with the ALIASED_TARGET
  target property.
* An ALIAS does not appear in the generated buildsystem. It
  is kept separate from cmMakefile::Targets for that reason.
* A target may have multiple aliases.
* An ALIAS target may not itself have an alias.
* An IMPORTED target may not have an alias.
* An ALIAS may not be exported or imported.
2013-08-02 15:21:00 +02:00
Patrick Gansterer 152dfdab11 Add additonal tests for the linker flags
Extend Tests/LinkFlags to test libraries of the type MODULE and
the content of the CMAKE_*_LINKER_FLAGS_* variables.
2013-07-31 08:41:08 -04:00
Ben Boeckel 31bd83e9fc set_property: Do not remove a property when APPENDing nothing 2013-07-24 10:50:15 -04:00
Stephen Kelly d0a76ea07c Introduce the INTERFACE_LINK_LIBRARIES property.
This property replaces the properties which
match (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?, and is enabled
for IMPORTED targets, and for non-IMPORTED targets only with a policy.

For static libraries, the INTERFACE_LINK_LIBRARIES property is
also used as the source of transitive usage requirements content.
Static libraries still require users to link to all entries in
their LINK_LIBRARIES, but usage requirements such as INCLUDE_DIRECTORIES
COMPILE_DEFINITIONS and COMPILE_OPTIONS can be restricted to only
certain interface libraries.

Because the INTERFACE_LINK_LIBRARIES property is populated unconditionally,
we need to compare the evaluated result of it with the link implementation
to determine whether to issue the policy warning for static libraries. For
shared libraries, the policy warning is issued if the contents of
the INTERFACE_LINK_LIBRARIES property differs from the contents of the
relevant config-specific old LINK_INTERFACE_LIBRARIES property.
2013-07-08 22:39:09 +02:00
Brad King 9a76d83f6d VS12: Find proper MSBuild for VSProjectInSubdir test
If the CTest make program is not msbuild we find the msbuild
corresponding to the current test generator.  In the case of
VS 12 search for the msbuild it provides.
2013-06-28 19:38:44 -04:00
Stephen Kelly 2331b57bec Add whitespace after colons in error messages. 2013-06-21 16:21:44 +02:00
Brad King ed2f59e614 Merge topic 'suppress-unused-cli-with-value-in-cache'
6a6cda5 Don't run the WarnUnusedCliUnused test on Windows.
2013-06-14 09:00:39 -04:00
Stephen Kelly 6a6cda5b4a Don't run the WarnUnusedCliUnused test on Windows.
Even with the NMake Makefiles generator, it is not able to properly
clean up after the test.

 http://open.cdash.org/testDetails.php?test=193424220&build=2934501

 Internal cmake changing into directory: C:/Dashboards/My Tests/CMake-nmake10-x64-continuous/Tests/WarnUnusedCliUnused
 Error: cmake execution failed
 CMake Error: Error: generator : NMake Makefiles
 Does not match the generator used previously: Visual Studio 10
 Either remove the CMakeCache.txt file or choose a different binary directory.
2013-06-12 17:21:10 +02:00
Brad King 21b1026541 Merge topic 'suppress-unused-cli-with-value-in-cache'
273ecab CLI: Suppress the unused warning if the key value pair is cached.
2013-06-05 09:39:18 -04:00
Stephen Kelly 273ecab96d CLI: Suppress the unused warning if the key value pair is cached.
It is common to specify a CMAKE_TOOLCHAIN_FILE and get a warning
for using it despite it not being used.

The WarnUnusedCliUnused test relies on the warning being emitted
each time cmake is run on an existing build. That behavior is changed
by this patch to warn only on the first invokation of CMake, and not
on subsequent invokations (because the variable is in the cache with
the same value). For that test, a clean target is added which clears
the cache and cause the warning to be emitted each time.

As the Ninja generator does not support the feature needed to test
this, it is not tested with that generator.
2013-06-04 12:38:56 +02:00
Brad King c9be17c860 Merge topic 'escape-regex-specials-in-path'
e4e0921 Merge branch 'master' into escape-regex-specials-in-path
c9b75dc Fix test failures caused by regexp-sensitive characters in the build paths
2013-06-03 13:51:31 -04:00
Rolf Eike Beer e4e09212c5 Merge branch 'master' into escape-regex-specials-in-path
Resolve conflicts in Tests/CTestTestMemcheck/CMakeLists.txt by combining
changes from both sides.
2013-06-03 13:43:52 -04:00
Modestas Vainius c9b75dcd73 Fix test failures caused by regexp-sensitive characters in the build paths
Checkout [1] as an example of the test failures. In that particular cases, the
failures is caused by the plus sign in the path being pass unescaped
(buildd-cmake_2.8.9-1~bpo60+1-armel-3Lvkef) to the regexp.

In addition to failures in the log, the following new tests also fail in 2.8.11:

  243 - CTestTestMemcheckUnknown (Failed)
  244 - CTestTestMemcheckUnknownQuoted (Failed)
  248 - CTestTestMemcheckDummyValgrindFailPre (Failed)
  249 - CTestTestMemcheckDummyValgrindFailPost (Failed)
  250 - CTestTestMemcheckDummyPurify (Failed)
  251 - CTestTestMemcheckDummyBC (Failed)
  253 - CMake.List (Failed)

[1] https://buildd.debian.org/status/fetch.php?pkg=cmake&arch=armel&ver=2.8.9-1~bpo60%2B1&stamp=1369243896
2013-06-03 16:51:21 +02:00
Brad King e57b6a2521 Merge topic 'target-COMPILE_OPTIONS'
24466f2 Add target_compile_options command.
80ca9c4 Add COMPILE_OPTIONS target property.
7cb2308 cmTarget: Rename LinkInterfaceIncludeDirectoriesEntries
47f80d9 cmTarget: Rename struct to be more re-usable.
1319a14 Add <LANG>_COMPILER_ID generator expressions.
3549676 Add cmLocalGenerator::GetCompileOptions.
f3ad863 VS6: Rename some variables to correspond to config values.
2013-06-03 09:57:44 -04:00
Brad King 6d4e79e2c3 Merge topic 'qt4-qt5-CMAKE_AUTOMOC'
fa55751 QtAutomoc: Get the Qt version through the target link interface
f776316 Use the qt5::moc imported target instead of a variable.
2013-06-03 09:57:01 -04:00
Brad King 3caf565d07 Merge topic 'rpath-on-mac'
dc1d025 OS X: Add test for rpaths on Mac.
8576b3f OS X: Add support for @rpath in export files.
00d71bd Xcode: Add rpath support in Xcode generator.
94e7fef OS X: Add RPATH support for Mac.
2013-06-03 09:56:44 -04:00
Clinton Stimpson dc1d025197 OS X: Add test for rpaths on Mac.
This also tests rpaths through export/import.
2013-06-03 09:42:06 -04:00
Stephen Kelly 24466f22c0 Add target_compile_options command.
This command populates the COMPILE_OPTIONS target property.
2013-06-02 11:56:37 +02:00
Stephen Kelly 80ca9c4b41 Add COMPILE_OPTIONS target property.
This method reads generator expressions from the COMPILE_OPTIONS
target property, as well as INTERFACE_COMPILE_OPTIONS from linked
dependents.
2013-06-02 11:56:37 +02:00
Stephen Kelly fa55751f83 QtAutomoc: Get the Qt version through the target link interface
In Qt 5.1, Qt5::Core has a INTERFACE_QT_MAJOR_VERSION property
of '5', and since CMake 2.8.11, Qt4::QtCore has an
INTERFACE_QT_MAJOR_VERSION of '4'. This was introduced in
commit 4aa10cd6 (FindQt4: Set the INTERFACE_QT_MAJOR_VERSION for
Qt4::QtCore, 2013-03-16), to produce an error if Qt 4 and Qt 5
are erroneously used by the same target. This can also be used
however to determine the Qt major version, and therefore the
particular moc executable to use during automoc steps. This means
that targets in a single buildsystem can use a selection of Qt 4
and Qt 5, and still take advantage of the CMAKE_AUTOMOC feature
without conflicting.
2013-05-28 01:19:37 +02:00
Brad King f292ffb62c Merge topic 'vs-windows-forms'
79ec786 VS: Add Windows Forms Support
2013-05-21 15:12:48 -04:00
Brad King 80f30aa6bf Merge topic 'Automoc-Qt4-Qt5'
6489015 Remove an endif() followed by an if() for the same condition.
e7813b1 Add a test for Qt5Automoc
27fb96b Make the QtAutomoc test compile with either Qt 4 or Qt 5
2013-05-21 15:12:35 -04:00
Brad King e1178478b7 Merge topic 'msbuild-targets-in-subdirs'
ac9a5f4 ctest_build: Pass projectDir to GenerateBuildCommand
a6c0299 CTest: Simplify ctest_* command source/build dir lookup
1ca9318 VS: Add test for building MSBuild project in subdir
3cd4000 VS: Use .sln parser to build targets in subdirs with msbuild (#13623)
df035e4 VS: Create parser for Visual Studio .sln files
de8be9e Add projectDir parameter to GenerateBuildCommand
2013-05-16 14:36:27 -04:00
John Farrier 79ec7868d0 VS: Add Windows Forms Support
Add support to maintain designer functionality for Visual Studio C++
Windows Forms projects.  Also add a test project showing how to use
the CMakeLists.txt file and, when successfully configured, will allow
use of the designer for the included form.
2013-05-16 13:06:44 -04:00
Petr Kmoch ac9a5f4d94 ctest_build: Pass projectDir to GenerateBuildCommand
This allows the ctest_build command's TARGET option to name a target
in a subdirectory and still build properly with msbuild.
Add test case covering use of ctest_build() with such a TARGET.
2013-04-12 11:35:36 -04:00
Petr Kmoch 1ca93182ad VS: Add test for building MSBuild project in subdir
Add test covering cmGlobalGenerator::GenerateBuildCommand for VS
solutions with MSBuild and building a target defined in a subdirectory
and not part of ALL.
2013-04-12 11:35:36 -04:00
Paul Kunysch 875eb8e158 CTest: Add test for running many tests in parallel
In particular, this checks that CTest's use of select() has a sufficient
file descriptor set size limit (FD_SETSIZE) to handle many child
processes at the same time.  Running 20 tests requires more than 64
descriptors, the Cygwin default that we override.
2013-03-22 09:02:12 -04:00
Stephen Kelly 6489015c75 Remove an endif() followed by an if() for the same condition. 2013-03-16 18:57:38 +01:00
Stephen Kelly e7813b15a6 Add a test for Qt5Automoc
The same source is used as for the Qt4Automoc test.
2013-03-16 18:57:01 +01:00
Brad King dd8a06bd65 Configure Tests/CMakeTests only with BUILD_TESTING ON
Since commit e03f83f3 (ProcessorCount test: fix path to cmsysTestsCxx
executable, 2013-01-24) the directory references a target that is not
built when BUILD_TESTING is OFF.  It makes no sense to add tests without
BUILD_TESTING anyway.

While at it, use add_subdirectory instead of subdirs to add CMakeTests.
2013-03-13 14:09:43 -04:00
Brad King 26bfece1af Merge topic 'fix-automoc-no-qt'
a223a3b Automoc: Don't create automoc targets if Qt is not used (#13999)
65b5c1e Merge branch 'property-link-depends-no-crash' into fix-automoc-no-qt
2013-03-13 13:34:24 -04:00
Stephen Kelly a223a3b65f Automoc: Don't create automoc targets if Qt is not used (#13999)
Commit 79568f95 (automoc: Add source file to target early to set the
linker language, 2013-02-20) changed automoc initialization to a two
step process. In the first step, the generated source file was added
to the target, which allows the link language to be determined.

However, this bypassed the check for the availability of Qt itself.
At build-time the automoc file could not be generated because the moc
tool was not available to create it.

The solution is to only add the automoc file to the target if Qt is
found.
2013-03-12 17:42:02 -04:00
Michael Tänzer 8eb2fe955a GetPrerequisites: Enable test for BundleUtilities on MinGW
Signed-off-by: Michael Tänzer <neo@nhng.de>
2013-03-01 16:26:07 +01:00
Brad King 55f0148d7b ExternalData: Test content link with a space in its name
Extend the Module.ExternalData test to cover a DATA{} reference whose
name contains a space.  Skip the case when the native build tool does
not support spaces.
2013-02-22 08:25:06 -05:00
Brad King d45eb35350 Tests: Generalize decision for 'make' tool supporting spaces
Some make tools do not support spaces inside the source tree paths.
Decide early whether to add tests that depend on support for spaces so
we can use the result in a decision for any test.
2013-02-22 08:25:05 -05:00
Brad King ef8b2fd101 Tests: Replace exec_program with execute_process
Drop use of the old exec_program command from CMake's own CMakeLists.txt
files.
2013-02-22 08:25:05 -05:00
Brad King 56ca8d4e63 Tests: Add generator toolset support
Propagate CMAKE_GENERATOR_TOOLSET through the test hierarchy so that all
tests can build with the selected generator toolset, if any.
2013-02-07 11:09:56 -05:00
Brad King f36c665df8 Tests: Consolidate ctest --build-and-test generator options
All ctest --build-and-test invocations require the options

  --build-generator ${CMAKE_GENERATOR}
  --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}

to be passed and have consistent values, except for a few special cases.
Collect the generator options in a variable instead of repeating the
options everywhere explicitly.
2013-02-07 11:09:24 -05:00
Brad King 020525845a Merge topic 'add-ExternalData-module'
5484c60 Merge branch 'vs6-rule-files' into add-ExternalData-module
1fd8d01 ExternalData: Attach download rules to content links in IDEs
a6d3ffc Fix Module.ExternalData test on VS 6
aed590a Fix Module.ExternalData test on Cygwin
06e8ded Merge branch 'fix-atomic-rename-on-Windows' into add-ExternalData-module
e2e0d2e ExternalData: Collapse ../ components in DATA{} paths
ee2abfd ExternalData: Add support for SHA 1 and 2 hash algorithms
aa8b228 ExternalData: Generalize hash algo/ext handling
9e518a8 ExternalData: Allow DATA{} syntax to reference directories
175ed02 ExternalData: Allow ()-groups in series match regex
4befecc ExternalData: Add tests covering interfaces and errors
bcd2580 ExternalData: Improve series matching using an explicit syntax
c0cebcb ExternalData: Remove unused private interface
5275993 ExternalData: Cleanup stray TODO and typo in comments
7bb8344 ExternalData: Do not match directory names when resolving DATA{}
00d801f ExternalData: Remove compatibility with CMake < 2.8.5
...
2013-02-05 14:46:40 -05:00
Brad King a6d3ffcb1f Fix Module.ExternalData test on VS 6
Run the test with the ctest --build-noclean option.  The test
CMakeLists.txt file already uses file(REMOVE_RECURSE) to clean out
downloaded data anyway.  Some file removed by "msdev ... /clean" causes
CMake to re-run in the middle of the build step and file(REMOVE_RECURSE)
wipes out already-generated files.
2013-02-04 15:19:56 -05:00
Brad King 19f3208a06 Tests: Avoid CTestLimitDashJ crash on Borland 5.8 builds
The test added by commit e378ba5f (Add CTestLimitDashJ test, 2012-12-26)
crashes with CTest compiled by Borland 5.8.  There seems to be interaction
among the large number of internal ctest runs.  It is probably related to
the undiscovered underlying issue mentioned in commit 32478069 (CTest:
Prevent creation of unbounded number of tests in ctest, 2012-12-18) when
fixing the symptom covered by the CTestLimitDashJ test.

Add --force-new-ctest-process to avoid the crash.  Further investigation
will still be needed to identify the true problem.
2013-01-31 10:58:16 -05:00
Brad King 4befecc77c ExternalData: Add tests covering interfaces and errors
Add a Module.ExternalData test to verify data retrieval and test
argument DATA{} references.

Add a RunCMake.ExternalData test to verify error handling and automatic
transformation of a raw data to a content link and staged object.
2013-01-30 10:04:54 -05:00
Stephen Kelly e98799105b Make INTERFACE determined properties readable in generator expressions.
The properties are evaluated as link-dependent interface properties when
evaluating the generator expressions.
2013-01-20 17:06:47 +01:00
Stephen Kelly fc61a7a746 Add the target_compile_definitions command.
This is a convenience API to populate the corresponding properties.
2013-01-10 09:46:58 -05:00
Stephen Kelly 8a37ebec78 Add the target_include_directories command.
This is a convenience API to populate the corresponding properties.
2013-01-10 09:46:57 -05:00
Brad King 0a097af097 Merge topic 'qt4-target-depends'
57a67bf Qt4: Add module dependencies to the IMPORTED targets
2013-01-07 14:19:36 -05:00
Stephen Kelly 57a67bf27e Qt4: Add module dependencies to the IMPORTED targets
This means for example, that consumers can use:

 target_link_libraries(foo ${QT_QTGUI_LIBRARIES})

instead of also needing to specify all 'public' dependencies:

 target_link_libraries(foo ${QT_QTGUI_LIBRARIES} ${QT_QTCORE_LIBRARIES} )

when using the IMPORTED targets.  Also populate the
IMPORTED_LINK_DEPENDENT_LIBRARIES property so CMake can help the linker
find shared library dependencies.
2013-01-07 14:00:47 -05:00
David Cole e378ba5f39 Add CTestLimitDashJ test (#12904)
Add a test that verifies that when ctest -j 4 is called, at most, 4 tests
are executed at any one time.

The test works by running the same script as each of 100 tests. And then setting
up test properties for DEPENDS, RUN_SERIAL, PROCESSORS and COST in order to get
the tests to run in a semi-deterministic ordering, even in parallel. The script
writes a file, sleeps for a bit, and then deletes the file. In the meantime, it
counts files that currently exist, and emits output that triggers a test failure
if the count of files is ever greater than 4.

Prior to the commit that fixed bug #12904, this would result in a failed test
because the output of some of the tests would indicate that more than 4 tests
were running simultaneously.

Now that this issue is resolved, this test will help guarantee that it stays
resolved moving forward.
2013-01-03 13:37:50 -05:00
David Cole 2bb2745fa8 Merge topic 'fix-11575-add-wix-support-to-cpack'
a74bd47 CPack: Fix dashboard errors and warnings (#11575)
ad0f735 CPack: Fix dashboard warnings (#11575)
0729ad4 CPack: Fix dashboard errors (#11575)
85baac1 CPack: Add a WiX Generator (#11575)
2012-12-05 10:31:05 -05:00
Nils Gladitz 85baac1503 CPack: Add a WiX Generator (#11575)
This new CPack generator produces an *.msi installer file.
Requires having the WiX Toolset installed in order to work
properly.

Download the WiX Toolset installer "WiX36.exe" here:

  http://wix.codeplex.com/releases/view/93929
2012-12-03 11:00:31 -05:00
David Cole 587b7b6f5e Tests: Use the right path to CPack value for running CPack tests
These tests were not running properly on Visual Studio or
Xcode dashboards before this commit because of the "Debug"
or "Release" sub-directory. The scripts already have
CMAKE_CPACK_COMMAND since the correct CMake executable is
used to run the scripts, so just use that, rather than
passing down an incorrect path to the CPack executable.
2012-11-29 15:49:36 -05:00
David Cole 078e35defb NMake: Add a test to demonstrate EmptyDepends issue (#13392) 2012-11-21 11:29:10 -05:00
Brad King 508504ab6f Merge topic 'per-config-EXCLUDE_FROM_DEFAULT_BUILD'
739f166 Serialize tests for EXCLUDE_FROM_DEFAULT_BUILD
e31d83b Define property EXCLUDE_FROM_DEFAULT_BUILD
d1f8828 Add property EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG>
b777272 Add tests for EXCLUDE_FROM_DEFAULT_BUILD
2012-11-20 11:47:35 -05:00
Brad King bd52ff3ac9 Merge topic 'only-git-fetch-when-necessary'
a41d3a4 ExternalProjectUpdateTest: Only support Git 1.6.5 and greater.
de760c1 ExternalProject: Verify when a fetch occurs during update test.
0a34433 ExternalProject: Make sure the ExternalProjectUpdate setup is available.
9b66c8f ExternalProject: Always do a git fetch for a remote ref.
2619f4d ExternalProject: Add tests for UPDATE_COMMAND.
378aa12 ExternalProject: Do smoke tests for Git Tutorial builds.
d075829 ExternalProject: Only run 'git fetch' when required.
2012-11-13 14:31:58 -05:00
Matt McCormick 0a34433dfb ExternalProject: Make sure the ExternalProjectUpdate setup is available.
This prepares the numberous tests that occur in the ExternalProjectUpdate
test.  The tests were passing previously because a fresh build was not performed.
2012-11-13 13:34:44 -05:00
Matt McCormick 2619f4d87a ExternalProject: Add tests for UPDATE_COMMAND.
Tests are added for UPDATE_COMMAND to ensure it is working properly.  Testing
infrastructure is added along with tests for Git, but tests for other version
control systems could easily be added in the future.
2012-11-13 13:34:22 -05:00
Brad King 739f16653d Serialize tests for EXCLUDE_FROM_DEFAULT_BUILD
The tests share a single build directory and so should not run in
parallel.  While at it, add the build dir to the test_clean target.
2012-11-13 10:52:05 -05:00
Petr Kmoch b777272b0b Add tests for EXCLUDE_FROM_DEFAULT_BUILD
Add tests for EXCLUDE_FROM_DEFAULT_BUILD and its per-configuration
variants.
2012-11-13 09:08:42 -05:00
Stephen Kelly 9be64f34c2 GenEx: Use case insensitive comparison for $<CONFIG:...>
This fixes a regression introduced by commit f1eacf0e
(cmGeneratorExpression: Re-write for multi-stage evaluation).
2012-11-05 08:49:25 -05:00
David Cole a2871e93ee Merge topic 'test-ctest-memcheck'
995a35f CTest: add a check with a quoted memory checker
de8bffc CTest: add a test for CTEST_CUSTOM_MEMCHECK_IGNORE
d26c9b6 CTest: improve memory checker type detection
fcae1da CTest: add tests that simulate memcheck runs
6187876 CTest: fix pre and post test commands with spaces
95bc8aa CTest: fix usage of memory checker with spaces in path
2012-10-17 16:43:02 -04:00
Rolf Eike Beer fcae1dacea CTest: add tests that simulate memcheck runs 2012-10-04 23:07:31 +02:00
Brad King 2ccca05fad Run PDBDirectoryAndName test on MSVC and Intel
Move it out of the condition that also accepts MinGW/MSYS.
Teach the test to allow the Intel for Windows compiler but
do not verify the results because the compiler does not
seem to write PDB output in all cases.
2012-09-29 07:17:42 -04:00
Yuchen Deng 3f60dbf148 Add PDB_OUTPUT_DIRECTORY and PDB_NAME target properties (#10830)
This enables changing the name and output folder of the debug symbol
files produced by MS compilers.

Inspired-by: Thomas Bernard <thomas.bernard@ipetronik.com>
2012-09-25 15:23:35 -04:00
David Cole 05784dadc5 Merge topic 'compile-definitions-unique'
f0a1065 Rename files from main.cpp to more meaningful names.
ca7fb14 Fix the test setting COMPILE_DEFINITIONS target property
733deb6 Fix CompileDefinitions test on Visual Studio.
3dae652 Don't duplicate -D defines sent to the compiler.
2012-08-24 14:24:24 -04:00
Stephen Kelly 3dae652b4e Don't duplicate -D defines sent to the compiler.
There is no need to do so. Be consistent with include directories and
ensure uniqueness.

This requires changing the API of the cmLocalGenerator::AppendDefines
method, and changing the generators to match.

The test unfortunately can't test for uniqueness, but it at least verifies
that nothing gets lost.
2012-08-20 22:30:11 +02:00
David Cole 407ccb4957 Merge topic 'RemoveNonworkingKDE4Test'
11f23fe remove non-working KDE4 test
2012-08-20 15:41:06 -04:00
David Cole 14c8096ba8 Merge topic 'more-endif-closing-style-cleanups'
84b49be Remove CMake multiline block-end command arguments
2012-08-20 15:39:26 -04:00
Alex Neundorf 11f23fee52 remove non-working KDE4 test
Alex
2012-08-16 23:28:52 +02:00
Marcin Wojdyr 84b49be8f0 Remove CMake multiline block-end command arguments
removing arguments omitted in 9db3116226
2012-08-15 16:50:29 -04:00
Brad King ebf05abda1 Add boolean generator expressions
Add generator expressions that combine and use boolean test results:

 $<0:...>         = empty string (ignores "...")
 $<1:...>         = content of "..."
 $<AND:?[,?]...>  = '1' if all '?' are '1', else '0'
 $<OR:?[,?]...>   = '0' if all '?' are '0', else '1'
 $<NOT:?>         = '0' if '?' is '1', else '1'

These will be useful to evaluate (future) boolean query expressions and
condition content on the results.  Include tests and documentation.
2012-08-15 11:44:49 -04:00
Brad King 3c0488d7d3 Fix WarnUnusedUnusedViaUnset test pass/fail regex
After conversion of Modules .cmake files to lower case the
FAIL_REGULAR_EXPRESSION for this test matched warnings in modules other
than the test line itself.  Make the pass and fail regular expressions
specific to the file containing the lines they are testing.
2012-08-14 08:06:19 -04:00
Kitware Robot 9db3116226 Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Kitware Robot 77543bde41 Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code:

cmake --help-command-list |
grep -v "cmake version" |
while read c; do
    echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
David Cole a51e1529e7 Merge topic 'ninja-fix-macosx'
1fc8df9 Add missing this->.
7a3ecf5 Fix memory leak in Makefile generator.
9f7dc83 Ninja: also bootstrap ninja files
5d365b2 Ninja: enable ninja support everywhere
d569f3e Ninja: void function can't return a value
52160bf Ninja: enable ninja on Mac so all Mac CDash-builds are tested, cleanup later
56aeac6 Ninja: fixes for bcc
7a6bc9e Ninja: remove 'this' from member initializer list
44ba4cf Ninja: remove warnings
7751966 Ninja: remove 'friend' in ninja code
c3988ee Re-factor OS X content generator start up.
f8e0a51 Re-factor framework directory computation.
f36c7b0 Re-factor Mac OS X content directory computation.
5d885db Re-factor bundle content copying rules generation.
3b2a01e Ninja: Use same echo message as makefiles.
7bb56c5 Re-factor CFBundle generation.
...
2012-07-24 17:03:46 -04:00
David Cole c1bbdbff57 Merge topic 'DoNotInvokeCPackAtCMakeTime-forCMakeTests'
b47cffa CPack: Use bin subdir when looking for dpkg and rpmbuild
a8c659c Find dpkg and rpmbuild in usual Fink and MacPort paths
848f220 Do not run cpack at CMake time it is not available.
2012-07-24 17:03:37 -04:00
Nicolas Despres 03bdaf5453 Enable BundleTest with CLang too. 2012-07-17 14:03:09 +02:00
Eric NOULARD 848f2201c5 Do not run cpack at CMake time it is not available.
cpack was used to get the list of available i.e. ACTIVE CPack generators
in the CMake tests suite. This was done in order to get dynamically
available CPack generators like DEB or RPM that may or may not be
available on some platform like MacOSX depending on the fact that
some command are installed or not. We may do that but not during
initial configuration.
The current patch fixes the problem and we may do better in the future
like configuring CPack tests later.
2012-06-28 13:49:49 +02:00
David Cole 361696ae20 CTest: Add test to verify -D variable definitions work 2012-06-25 08:25:51 -04:00
David Cole c95d1baa19 Merge topic 'position-independent-targets'
bd34963 Refactor generation of shared library flags
55d7aa4 Add platform variable for flags specific to shared libraries
31d7a0f Add platform variables for position independent code flags
2012-06-12 16:01:04 -04:00
Stephen Kelly bd34963002 Refactor generation of shared library flags
CMAKE_SHARED_LIBRARY_<lang>_FLAGS has flags on various platforms for a
variety of purposes that are correlated with shared libraries but not
exclusive to them.  Refactor generation of these flags to use new
purpose-specific platform variables

  CMAKE_<lang>_COMPILE_OPTIONS_DLL
  CMAKE_<lang>_COMPILE_OPTIONS_PIC
  CMAKE_<lang>_COMPILE_OPTIONS_PIE

Activate the DLL flags specifically for shared libraries.  Add a new
POSITION_INDEPENDENT_CODE target property to activate PIC/PIE flags, and
default to true for shared libraries to preserve default behavior.
Initialize the new property from CMAKE_POSITION_INDEPENDENT_CODE to
allow easy global configuration in projects.

Although the default behavior is unchanged by this refactoring, the new
approach ignores CMAKE_SHARED_LIBRARY_<lang>_FLAGS completely.  We must
leave it set in case projects reference the value.  Furthermore, if a
project modifies CMAKE_SHARED_LIBRARY_<lang>_FLAGS it expects the new
value to be used.  Add policy CMP0018 to handle compatibility with
projects that modify this platform variable.

Add a PositionIndependentCode test on platforms where we can get
meaningful results.
2012-06-12 15:38:48 -04:00
Stephen Kelly 3545645c1b Exclude the CompileCommandOutput test on WIN32. 2012-06-05 00:12:16 +02:00
Stephen Kelly db839bec7d Make the CMAKE_EXPORT_COMPILE_COMMANDS option work with Ninja. 2012-06-04 23:42:37 +02:00
David Cole 3e23da0688 Merge topic 'CPack-activateRPM-DEB-onMacOS'
801ea70 Calm down Borland compiler warning about "always true"
2a34b57 CPack allow RPM and DEB generator to be used on OSX.
2012-05-24 13:38:13 -04:00
Eric NOULARD 2a34b57938 CPack allow RPM and DEB generator to be used on OSX.
More generally add the check for possible generator "activation" at
runtime depending on a generator specific check.
The dynamic behavior is currently implemented only for MacOS
and should be fully backward compatible for other system.

Inspired-By Tom Hughes <tomtheengineer@gmail.com>
2012-05-20 22:04:32 +02:00
Bill Hoffman b0c07a13d1 Disable bullseye coverage for mumps coverage test. 2012-05-04 11:41:15 -04:00
Bill Hoffman 220afcaf84 Use <TARGET_FILE> expression to run ctest so it works with Xcode and VS IDE.
Also add -crlf to the .gitconfig to handle the coverage data.
2012-05-02 11:51:38 -04:00
Bill Hoffman 62f6bce7a5 Use a script to run the test because WORKING_DIRECTORY is not in 2.8.2.
add_test with WORKING_DIRECTORY is too new to use in cmake.  This change
uses a configured script to run the command in the right directory.
2012-05-02 10:45:06 -04:00
Bill Hoffman 7955e995ec Add support for Cache coverage.
This adds support for Cache coverage parsing. A test is added
that does a basic run of the coverage on a small bit of data.
2012-05-01 17:00:43 -04:00
Bill Hoffman 319eeb0247 Add test for mumps coverage. Also refactor code to prepare for cache coverage.
Add a simple test to make sure the GTM mumps coverage is working.
Also refactor the code so that cache coverage can be added.
2012-05-01 13:35:07 -04: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 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
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 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
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 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 b22f2f18c1 Merge topic 'qt4-deploy'
4689eed reflect that the QtAutomoc depends on QtGui
ab9661c Remove QtGui dependency in Qt4Deploy test and verify QtSql existance.
52e8279 Fix for Qt4Deploy on some test machines.
672e3bb Add test for DeployQt4.cmake
4853e1e Fix plugin installation issues.
35cbf23 Ensure libs are passed to BundleUtilities.
0ac1535 Fix bad plugin paths.
a2123e8 Fix mismatched arguments.
fc6f340 Don't use QT_LIBRARIES_PLUGINS by default.
2012-03-06 15:25:02 -05:00
David Cole a1860aaf1a Merge topic 'test-CMakeCommands'
5e1a5c4 Add infrastructure for CMakeCommands tests
2012-03-02 11:48:22 -05:00
Rolf Eike Beer 4689eedcc0 reflect that the QtAutomoc depends on QtGui 2012-02-29 21:35:20 +01:00
Clinton Stimpson ab9661c1dd Remove QtGui dependency in Qt4Deploy test and verify QtSql existance. 2012-02-29 07:55:31 -07:00
Brad King 5e1a5c44da Add infrastructure for CMakeCommands tests
Generalize the build_command test framework as a macro to add the
test.  Process the CMakeCommands subdirectory explicitly.
2012-02-28 11:34:10 -05:00
Modestas Vainius f5cf8f9897 Tests: Escape metachars before embedding paths into the regex (#12999)
${CMake_SOURCE_DIR} and ${CMake_BINARY_DIR} cannot be embedded into regex
directly. If they contain special regex metacharacters like +, the regex
will break. So just escape such metacharacters with a backslash before
embedding the path into the regex.

The issue affected the following tests: CTestTestConfigFileInBuildDir1 and
CTestTestConfigFileInBuildDir2.
2012-02-27 09:01:10 -05:00
Clinton Stimpson 52e8279648 Fix for Qt4Deploy on some test machines.
Use the same check for whether Qt4 works for Qt4Automoc test before trying to do the Qt4Deploy test.
Also pass down to Qt4Deploy which Qt to use.
2012-02-24 08:09:17 -07:00
Clinton Stimpson 672e3bb70f Add test for DeployQt4.cmake 2012-02-23 15:48:47 -07:00
David Cole bada88e8e4 Merge branch 'target-include-directories' into ninja-generator 2012-02-22 16:21:48 -05:00
Eric NOULARD 67494502f5 Do not build RPM if path of the build tree contains space 2012-02-19 20:50:27 +01:00
Aaron C. Meadows ba89e92ba6 Visual Studio: Allow setting Single Byte Character Set (#12189)
For Visual Studio using the Preprocessor Define _SBCS. This behavior
is similar to the way that _UNICODE and _MBCS work already.

Added tests to confirm this behavior.
2012-02-17 11:30:23 -05:00
Bill Hoffman 067c1f44a8 VSGNUFortran: Disable test in special cases
The ifort compiler found on some test machines does not support Mac
universal binaries or the Linux Standard Base.
2012-02-09 08:36:27 -05:00
Bill Hoffman 538c3452ad Add CMakeAddFortranSubdirectory to use MinGW gfortran in VS
This patch adds a new module that allows for easy integration of MinGW
gfortran and the Visual Studio compiler. It is done in a function called
cmake_add_fortran_subdirectory. The patch also includes a test for this
feature.
2012-02-09 08:33:57 -05:00
Brad King daa4101619 Remove unused test code
We have not run tests with the "como" compiler or enabled the
experimental ConvLibrary test for years.
2012-02-03 15:55:27 -05:00
Peter Collingbourne 6dd410c2b9 Ninja: Add the Ninja generator 2012-02-02 23:40:21 +00:00
Rolf Eike Beer 8de3b3d13e CheckCXXCompilerFlag test: make it a CMakeOnly test 2012-01-30 19:42:51 +01:00
Brad King 9a20abf04a Add infrastructure for CMake-only tests
Some tests only need to run CMake to configure and generate a build
tree, but not actually perform the build.  Add a new "Tests/CMakeOnly"
directory dedicated for this purpose.  Add a helper script to drive each
test by creating a fresh build tree and running CMake on it.  Add macro
"add_CMakeOnly_test" to help create tests using the script.
2012-01-13 14:21:22 -05:00
David Cole be358c68c3 Merge topic 'test-Complex-cleanup'
53d31c2 complex: Remove unused option to test CMakeLib
c1789e6 complex: Remove test dependence on cmSystemTools
569cee1 complex: Move cmSystemTools::UpperCase test to CMakeLibTests
49d6dd6 complex: Simplify test for single-character exe name
76ac88b complex: Move GeneratedFileStream test to CMakeLibTests
137e597 complex: Remove dynamic loader tests
6337920 complex: Sync Tests/ComplexOneConfig with Tests/Complex
6a75821 complex: Remove ancient unused ComplexRelativePaths test
2012-01-09 14:09:11 -05:00
Brad King 53d31c2426 complex: Remove unused option to test CMakeLib
Now that the Complex tests do not depend on cmSystemTools or other
classes from CMakeLib the COMPLEX_TEST_CMAKELIB option is useless.
2011-12-23 16:16:57 -05:00
Brad King 6a7582124c complex: Remove ancient unused ComplexRelativePaths test 2011-12-23 16:16:45 -05:00
David Cole c24bdb05d0 Merge topic 'avoid-mfc-test'
0e598b7 Tests: Only really run MFC test if we can build MFC apps (#11213)
2011-12-20 14:21:21 -05:00
Bill Hoffman 5badf5f734 Fix the case where cmake --build failed with two project cmds in one file.
This adds a test that uses two project commands in the same CMakeLists.txt
file.  It also adds a fix so that cmake --build will work in that case.
The fix sets the name of the last project command in the top level
CMakeLists.txt in the cache variable CMAKE_PROJECT_NAME.  This variable
is used by cmake --build to find the project name.
2011-12-20 14:16:25 -05:00
David Cole 0e598b7bcd Tests: Only really run MFC test if we can build MFC apps (#11213)
Avoid problems on "undetected" VS Express build environments.
2011-12-16 16:30:10 -05:00
David Cole 1ec3801a3a Merge topic 'target-link-libraries-interfaces'
b1f12f8 target_link_libraries: Simplify argument processing state tests
5fc95df target_link_libraries: Add missing space in documentation
9143822 target_link_libraries: Add LINK_(PUBLIC|PRIVATE) options
cf64218 target_link_libraries: Trim trailing whitespace
2011-11-23 08:16:10 -05:00
Stephen Kelly 914382224d target_link_libraries: Add LINK_(PUBLIC|PRIVATE) options
Makes it possible to specify the link dependencies and link
interfaces in one command without repetition.
2011-11-22 16:52:35 -05:00
David Cole 608d05b469 Merge topic 'add-mfc-test'
c71f7ab Tests: Avoid MFC test automatically for Watcom WMake builds (#11213)
a42e3f2 Tests: Fix MFC test for old vs6 dashboards (#11213)
b297da6 Tests: Fix MFC test w/ Make-based generators (#11213)
54595e6 Tests: Avoid MFC test automatically for VCExpress builds (#11213)
36b0c43 Tests: Add the MFC test (#11213)
2011-11-15 14:38:52 -05:00
David Cole c71f7ab7db Tests: Avoid MFC test automatically for Watcom WMake builds (#11213) 2011-11-03 13:21:06 -04:00