Commit Graph

1974 Commits

Author SHA1 Message Date
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
David Cole f2e98ed420 Merge topic 'fix-msys-cvs-local-repo'
e333602 Fix MSYS CVS local test repo path format (#13001)
2012-03-06 15:26:41 -05:00
David Cole ef6613718e Merge topic 'remove-CheckSourceTree-cvs-support'
9012be2 CheckSourceTree: Remove CVS checkout support (#13001)
2012-03-06 15:26:04 -05:00
David Cole 9c77a1492a Merge topic 'fix-CTestUpdateHG-url'
0916cc8 CTest.UpdateHG: Fix repo URL for local filesystem (#13001)
2012-03-06 15:25:12 -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
Rolf Eike Beer b43cd1252c add test for get_property() errors 2012-03-04 13:43:23 +01:00
Rolf Eike Beer 234b7cad1c AllFindModules test: do not require TCLSH version 2012-03-02 20:52:41 +01:00
Brad King e333602567 Fix MSYS CVS local test repo path format (#13001)
The MSYS cvs tool interprets "c:/" as a "machine:" name for SSH.  Detect
the MSYS cvs by looking for the string "msys" in the executable file
itself.  Then convert the repo path to an MSYS path such as "/c/...".
Fix both the CTest.UpdateCVS and ExternalProject tests that use local
CVS repositories.
2012-03-02 14:23:01 -05:00
David Cole 5012787c3c Merge topic 'while-testing'
944b90b add testcases for while()/endwhile() errors
f605b92 improve error message on a stray "endwhile()"
2012-03-02 11:50:54 -05:00
David Cole 8c1f041239 Merge topic 'allfindmodules-versions'
9271d2f AllFindModules test: once again expand version checking
2012-03-02 11:50:37 -05:00
David Cole 1073d50508 Merge topic 'inject_code_via_variable'
2557a08 Fix typo in error message, and remove redundent test.
9090572 Add ability to include a file in a project via a cache variable.
2012-03-02 11:49:35 -05:00
David Cole 0ee7b8ea03 Merge topic 'find_package-improve-messages'
eeaaffc find_package: Test error and warning messages in failure cases
52dffb9 Merge branch 'test-CMakeCommands' into find_package-improve-messages
d365104 find_package: Optionally warn when implicitly using Config mode
31ead5f find_package: Reject mixed use of MODULE- and CONFIG-only options
6d83083 find_package: mention requested version number in error message
9c39bbd find_package: add CONFIG mode keyword alias for NO_MODULE
f310f67 find_package: add MODULE mode to use only Find-modules
7d67dcf find_package: improve error message when no Find module is present
978d89b find_package: rename NoModule to UseFindModules
2012-03-02 11:48:38 -05:00
David Cole a1860aaf1a Merge topic 'test-CMakeCommands'
5e1a5c4 Add infrastructure for CMakeCommands tests
2012-03-02 11:48:22 -05:00
Brad King 9012be20c5 CheckSourceTree: Remove CVS checkout support (#13001)
We no longer support CVS checkouts from the Git repository.
Drop the case from the CheckSourceTree test.  This will also
prevent the test from running and failing when CVS is found
but Git is not.
2012-03-02 10:24:43 -05:00
Brad King 0916cc888a CTest.UpdateHG: Fix repo URL for local filesystem (#13001)
Use "file:///c:/" instead of "file://c:/" because the latter
looks like a machine:port URL instead of a local file URL.
2012-03-02 08:07:47 -05:00
Rolf Eike Beer 944b90be60 add testcases for while()/endwhile() errors 2012-03-01 21:20:49 +01:00
Rolf Eike Beer 9271d2f697 AllFindModules test: once again expand version checking 2012-03-01 18:11:52 +01:00
Bill Hoffman 2557a08054 Fix typo in error message, and remove redundent test. 2012-02-29 22:28:06 -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 eeaaffcb2f find_package: Test error and warning messages in failure cases
Add a "CMakeCommands.find_package" test to run CMake on a bunch of cases
in which find_package fails.  Check that the process return code and
warning/error messages are as expected.  Record expected test output in
corresponding files for reference by the check.  These files will also
serve as a reference for the message text in each case.
2012-02-28 13:34:53 -05: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
Stephen Kelly 9106b564ae Extract and use the INCLUDE_DIRECTORIES target properties.
Eliminate callers of cmMakefile::GetIncludeDirectories.

All callers of GetIncludeDirectories should go through the local generator
object.

Only the local generator calls cmTarget::GetIncludeDirectories directly.
2012-02-22 06:31:50 -05:00
David Cole 8ef15df700 Merge topic 'HandleTargetsInCMakeRequiredLibraries'
35c48e1 Check*.cmake: Expand imported targets in CMAKE_REQUIRED_LIBRARIES
61cb4ea bootstrap: move while() and endwhile() into the bootstrap build
c9f2886 -don't pull in CheckTypeSize.cmake from the cmake which is being built
628f365 -remove trailing whitespace
2012-02-21 15:58:27 -05:00
David Cole b187a3a816 Merge topic 'doBuildRPM-withSpaceInTree'
6749450 Do not build RPM if path of the build tree contains space
2012-02-21 15:57:30 -05:00
David Cole 0b5c086693 Merge topic 'expect-more-versions'
540db7e AllFindModules test: expect more modules to have a version number available
2012-02-21 15:56:43 -05:00
David Cole 8a665fa363 Merge topic 'findlibrary-versioned-libraries'
70f3623 Find_library(): allow searching for versioned shared objects
2012-02-21 15:56:26 -05:00
David Cole 751e492840 Merge topic 'fix-typos-12975'
7ec2ebd fix the same typos as found by Debian in other places, too
d36d29f various typo and formatting fixes in manual pages (#12975)
2012-02-21 15:56:13 -05:00
Alex Neundorf 35c48e1270 Check*.cmake: Expand imported targets in CMAKE_REQUIRED_LIBRARIES
Add the function cmake_expand_imported_targets() to expand imported
targets in a list of libraries into their on-disk file names for a
particular configuration.  Adapt the implementation from KDE's
HANDLE_IMPORTED_TARGETS_IN_CMAKE_REQUIRED_LIBRARIES which has been in
use for over 2 years.  Call the function from all the Check*.cmake
macros to handle imported targets named in CMAKE_REQUIRED_LIBRARIES.

Alex
2012-02-21 15:38:15 -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
Rolf Eike Beer 540db7e5b9 AllFindModules test: expect more modules to have a version number available
For all current build machines the modules FindPkgConfig, FindFreetype, and
FindLibXslt return a version number. Enforce this to early catch when this
is not always the case.
2012-02-18 16:25:41 +01:00
Rolf Eike Beer 70f362305f Find_library(): allow searching for versioned shared objects
This did not work because find_library() did only treat the given name as
complete filename if is matched "PREFIX.*SUFFIX":

find_library(MYLIB libfoo.so.2)

Now it is also taken as a whole if the name matches "PREFIX.*SUFFIX\..*".
2012-02-18 16:19:29 +01:00
Rolf Eike Beer 7ec2ebdbcf fix the same typos as found by Debian in other places, too 2012-02-18 16:13:34 +01:00
Rolf Eike Beer 378f229159 Tests: document where to put tests 2012-02-17 21:02:08 +01:00
Bill Hoffman 9090572f5c Add ability to include a file in a project via a cache variable.
If a variable exists called CMAKE_PROJECT_<projectName>_INCLUDE,
the file pointed to by that variable will be included as the last step
of the project command.
2012-02-17 12:41:39 -05: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
David Cole 96fd0be193 Merge topic 'allfindmodules-no-force-gnuplot'
2f306a9 AllFindModules test: do not enforce GNUPLOT version
2012-02-14 16:17:45 -05:00
Rolf Eike Beer 2f306a9992 AllFindModules test: do not enforce GNUPLOT version
Ancient Gnuplot versions like 3.7.1 don't know about "--version". Disable this
check so it doesn't break on machines with this version.
2012-02-13 18:45:38 +01:00
Brad King 1e16406dc9 CMakeAddFortranSubdirectory: Add NO_EXTERNAL_INSTALL option
We do not yet support "make install" in the external project case.
Document this explicitly in the interface.  Require the caller to use an
option to "disable" the unsupported behavior.  This will allow us to add
the behavior by default in the future without clobbering existing
projects that handle the installation themselves.
2012-02-09 08:38:56 -05:00
Bill Hoffman 48a09f82cc CMakeAddFortranSubdirectory: Make IMPORTED targets GLOBAL
cmake_add_fortran_directory uses imported targets when using the
mingw fortran compiler. This change makes those targets global
in scope so they act just like the real targets that exist when
a fortran compiler exists and regular add_subdirectory is used.
2012-02-09 08:38:52 -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 bd69e1c567 VSGNUFortran: Add special case for SunPro Fortran runtime library
The SunPro compiler does not add the fortran runtime library when
creating a shared fortran library.  Link to the SunPro Fortran runtime
libraries explicitly.
2012-02-09 08:35:56 -05:00
Brad King e4ae038f5d CMakeAddFortranSubdirectory: Allow full paths to directories
Fix the implementation to allow full paths with spaces.  Change the
interpretation of relative paths to be with respect to the current binary
directory.  This matches the convention used in ExternalProject.  Test
both full and relative paths in the VSGNUFortran test.
2012-02-09 08:34:06 -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 5db99e8708 Add CheckLanguage module
Define a "check_language(<lang>)" macro to test whether <lang> can be
enabled.  Cache the result in CMAKE_<lang>_COMPILER.  Add a test case
covering expected results.
2012-02-08 10:48:34 -05:00
David Cole 3921f1a559 Merge topic 'remove-unused-test-code'
daa4101 Remove unused test code
2012-02-07 15:35:21 -05:00
David Cole 986981ea03 Merge topic 'lang-enable-order-issue-12929'
7495845 Fix CXX/Fortran MODULE flags when enabled before C (#12929)
2012-02-07 15:35:11 -05:00
David Cole 0d7727d1cc Merge topic 'change-trilinos-submit-url'
bf2e385 Tests: Update drop site value for the Trilinos contract test
2012-02-07 15:34:49 -05:00
David Cole 66145a3e3b Merge topic 'AllFindModules-test'
ed1b126 CMakeOnly.AllFindModules: require version for some modules
2dee929 CMakeOnly.AllFindModules: suppress two modules from testing
3c4b4ff CMakeOnly.AllFindModules: always check FindQt
9d72b25 CMakeOnly.AllFindModules: clean up the Qt3/Qt4 code
2012-02-07 15:33:43 -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
Brad King 749584509e Fix CXX/Fortran MODULE flags when enabled before C (#12929)
If CXX or Fortran is enabled before C then the values of

  CMAKE_SHARED_MODULE_C_FLAGS
  CMAKE_SHARED_MODULE_CREATE_C_FLAGS

may not be available.  On platforms where MODULE library (plugin) creation
is the same as SHARED library creation initialize the MODULE creation
flags from the SHARED creation flags of the matching language instead of
assuming that C has been enabled first.

Teach the COnly and CxxOnly tests to build MODULE libraries.  The latter
covers this specific case.
2012-02-03 15:45:13 -05:00
David Cole bf2e385397 Tests: Update drop site value for the Trilinos contract test 2012-02-03 11:52:54 -05:00
Peter Collingbourne 6dd410c2b9 Ninja: Add the Ninja generator 2012-02-02 23:40:21 +00:00
Peter Collingbourne 7eb8d9036c Provide dependency file flags to generator
Causes compiler modules (currently only GNU) to set a
CMAKE_DEPFILE_FLAGS_${lang} variable, which communicates to
the generator the flags required to cause the compiler to create
dependency files.
2012-02-02 23:36:49 +00:00
David Cole a4e0257840 Merge topic 'check_cxx_compiler_flag_cmakeonly'
8de3b3d CheckCXXCompilerFlag test: make it a CMakeOnly test
2012-02-01 14:51:36 -05:00
Rolf Eike Beer ed1b12624d CMakeOnly.AllFindModules: require version for some modules 2012-02-01 18:12:19 +01:00
Rolf Eike Beer 8de3b3d13e CheckCXXCompilerFlag test: make it a CMakeOnly test 2012-01-30 19:42:51 +01:00
Rolf Eike Beer 2dee929496 CMakeOnly.AllFindModules: suppress two modules from testing
FindPackageHandleStandardArgs and FindPackageMessage match the glob
expression but are nothing that will usually be fed into find_package().
2012-01-26 22:33:33 +01:00
Rolf Eike Beer 3c4b4fffd0 CMakeOnly.AllFindModules: always check FindQt 2012-01-26 22:33:33 +01:00
Rolf Eike Beer 9d72b25a86 CMakeOnly.AllFindModules: clean up the Qt3/Qt4 code 2012-01-26 22:33:33 +01:00
Brad King f9c1c6225c Add test covering imported target scope rules 2012-01-25 14:43:07 -05:00
David Cole 30620e7477 Merge topic 'uninitialized-var-in-if'
54fd9e3 fix uninitialized var in if(NOT foo bar STREQUAL "foo bar")
2012-01-25 11:17:46 -05:00
David Cole 476679afaf Merge topic 'GetPrerequisites-rpath-OSX'
98d2031 Fix BundleUtilities test failure with space in build path.
36d6641 Fix new BundleUtilities test failure on Mac 10.4.x
0d96dec GetPrerequisites: Add test for @rpath support.
880139a GetPrerequisites: Add support for @rpath on Mac OS X.
9a6b102 GetPrerequisites: Add support for @rpath on Mac OS X.
2012-01-25 11:17:12 -05:00
David Cole 352279cdc2 Merge topic 'loadcommand-test-cleanup'
1531c11 LoadCommand test: cleanup
2012-01-25 11:16:52 -05:00
David Cole 3c5489bd0f Merge topic 'test_find_modules'
8d83043 AllFindModules test: also check Qt3 modules if Qt4 is not found
e797e7f AllFindModules test: keep complete output
ec631d5 add a test that loops through most Find* modules
2012-01-25 11:15:47 -05:00
Rolf Eike Beer 54fd9e38bb fix uninitialized var in if(NOT foo bar STREQUAL "foo bar")
Also adds test to verify this.
2012-01-22 12:15:57 +01:00
Clinton Stimpson 98d20316bd Fix BundleUtilities test failure with space in build path. 2012-01-20 22:02:01 -07:00
Rolf Eike Beer 1531c11168 LoadCommand test: cleanup
This removes some useless checking. The results of these things are never
properly checked so they should not count as testcases. At the end they only
needlessly clutter the output.
2012-01-20 18:31:32 +01:00
Clinton Stimpson 36d66416f4 Fix new BundleUtilities test failure on Mac 10.4.x 2012-01-20 06:59:17 -07:00
Clinton Stimpson 0d96decdd0 GetPrerequisites: Add test for @rpath support. 2012-01-19 22:03:06 -07:00
Rolf Eike Beer 8d830436a4 AllFindModules test: also check Qt3 modules if Qt4 is not found 2012-01-18 18:23:21 +01:00
Rolf Eike Beer 0541a03a4c GenerateExportHeader test: add newlines before end of file 2012-01-18 00:01:08 +01:00
David Cole a6518c30e0 Merge topic 'check_symbol_exists'
6856b4d Merge topic 'link-shared-depend-cycle-issue-12647' into check_symbol_exists
8e1f376 add a test for Check{,CXX}SymbolExists
813eca6 CheckSymbolExists: force the compiler to keep the referenced symbol
2012-01-17 16:25:38 -05:00
David Cole 05fbfd494e Merge topic 'link-shared-depend-cycle-issue-12647'
8e756d2 Tolerate cycles in shared library link interfaces (#12647)
2012-01-17 16:25:19 -05:00
David Cole 4cfaa91ef0 Merge topic 'add_CMakeOnly_test-infrastructure'
9a20abf Add infrastructure for CMake-only tests
2012-01-17 16:25:01 -05:00
David Cole 4dd47eb6c3 Merge topic 'compiler-version'
0df1942 Detect SGI MIPSpro compiler version with its id
a5e892c Document compiler version macro formats used for detection
d7c6f41 Detect HP compiler version with its id
3dd9fa9 Detect SunPro compiler version with its id
c198730 Detect Watcom compiler version with its id
5899b98 Detect Clang compiler version with its id
b8cfa65 Detect PGI compiler version with its id
6dae666 Detect IBM XL compiler version with its id
4080d55 Detect Borland compiler version with its id
2cc205a Detect Intel compiler version with its id (#11937)
a6d83cc Detect MSVC compiler version with its id
a662855 Detect GNU compiler version with its id (#6251)
fa7141f Add framework to detect compiler version with its id (#12408)
2012-01-17 16:22:53 -05:00
Rolf Eike Beer e797e7fb41 AllFindModules test: keep complete output 2012-01-17 19:14:56 +01:00
Rolf Eike Beer ec631d5043 add a test that loops through most Find* modules
This allows easy spotting of modules that output crappy messages and the
like.
2012-01-16 23:37:13 +01:00
Rolf Eike Beer 6856b4d19d Merge topic 'link-shared-depend-cycle-issue-12647' into check_symbol_exists 2012-01-16 21:03:23 +01:00
Rolf Eike Beer 8e1f376782 add a test for Check{,CXX}SymbolExists
Now that we think that CheckSymbolExists really works for all cases it is time
to prove that. If this code fails too many other things will break.
2012-01-16 20:52:29 +01:00
Brad King 8e756d2b9b Tolerate cycles in shared library link interfaces (#12647)
Since commit 183b9509 (Follow all dependencies of shared library private
dependencies, 2011-12-14) we honor LINK_INTERFACE_LIBRARIES when
following dependent shared libraries.  The link interface properties may
form a cycle if set incorrectly by a project.  Furthermore, the property
LINK_DEPENDENT_LIBRARIES may form a cycle if set incorrectly by hand
(though CMake should never generate one).  In either case, do not follow
the cycle forever when following the dependent shared library closure.
We only need to add dependency edges to the constraint graph once.

Add "LinkInterfaceLoop" test to cover this case.
2012-01-13 14:22:24 -05: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 c1789e6986 complex: Remove test dependence on cmSystemTools
Use C standard 'remove' and POSIX standard 'stat'.
2011-12-23 16:16:56 -05:00
Brad King 569cee1d9e complex: Move cmSystemTools::UpperCase test to CMakeLibTests
This test belongs in the CMakeLibTests test driver executable which
correctly links to CMakeLib.
2011-12-23 16:16:54 -05:00
Brad King 49d6dd67f1 complex: Simplify test for single-character exe name
Run the test executable as a custom command instead of depending on
cmSystemTools::RunSingleCommand.
2011-12-23 16:16:52 -05:00
Brad King 76ac88b730 complex: Move GeneratedFileStream test to CMakeLibTests
This test belongs in the CMakeLibTests test driver executable which
correctly links to CMakeLib.  Fix incorrect library link order in the
Complex tests exposed by this change.
2011-12-23 16:16:50 -05:00
Brad King 137e5974bc complex: Remove dynamic loader tests
Everything covered by these tests is now covered by the KWSys
DynamicLoader test and the Plugin test.
2011-12-23 16:16:49 -05:00
Brad King 63379207e1 complex: Sync Tests/ComplexOneConfig with Tests/Complex
The two test sources must remain identical.  Apply to ComplexOneConfig
the change that commit f578381e (Fix vs2010 project generation error
when HEADER_FILE_ONLY is set, 2010-12-20) made to Complex.
2011-12-23 16:16:47 -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
David Cole d6a33f6d38 Merge topic 'fix_double_project_cmake_build'
5badf5f Fix the case where cmake --build failed with two project cmds in one file.
2011-12-20 14:21:06 -05:00
David Cole 16dacf3a6a Merge topic 'AutomocFineTuning'
e474dcb automoc: improved warning message in relaxed mode
96fc5d5 automoc: default to strict mode, use CMAKE_AUTOMOC_RELAXED_MODE
2011-12-20 14:20:32 -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 52d5f67ec7 Merge topic 'test-Fortran-compiler-compat'
fcb2a27 Fix and simplify Fortran test compiler compatibility check
2011-12-16 10:15:32 -05:00
Brad King fcb2a27982 Fix and simplify Fortran test compiler compatibility check
Since commit 38aab379 (Set CMAKE_<lang>_COMPILER_ID for VS generators,
2011-09-02) the VS IDE generators set the C and C++ compiler id to MSVC
and the Fortran compiler id to Intel.  This caused the Fortran test to
fail compatible compiler detection because the if() test

  "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"

is evaluated as the "var MATCHES regex" signature which evaluates the
compiler id "MSVC" as a variable which is defined to 1 which does not
match "MSVC".

Combine tests for non-identical but compatible compiler vendors into a
single regex match whose left hand side will not be defined as a
variable.
2011-12-15 09:25:49 -05:00
Brad King 183b95098e Follow all dependencies of shared library private dependencies
In cmComputeLinkDepends we compute the transitive closure of private
shared library dependencies.  When a shared library is added to this
closure we must follow all of its dependencies whether they are private
or public.  Previously we only followed the private dependencies.  Fix
the implementation to follow the public dependencies too.  Also extend
the ExportImport test to cover this case.
2011-12-14 11:33:01 -05:00
Alex Neundorf 96fc5d5d07 automoc: default to strict mode, use CMAKE_AUTOMOC_RELAXED_MODE
automoc now defaults to strict mode, also with Qt4, i.e. it behaves as
the documentation says by default. I also inverted the switch
CMAKE_AUTOMOC_STRICT_MODE to CMAKE_AUTOMOC_RELAXED_MODE.
Docs and test adapted accordingly.

Alex
2011-12-13 22:11:47 +01:00
David Cole 2d1195123e Merge branch 'master' into AutomocIncludedDotMocFileHandling
Conflicts:
	Source/cmTarget.cxx
2011-12-07 16:29:13 -05:00
Brad King fa7141f5ad Add framework to detect compiler version with its id (#12408)
Teach CMakePlatformId.h to construct an "INFO:compiler_version[]" string
literal from macros COMPILER_VERSION_(MAJOR|MINOR|PATCH|TWEAK) to be
defined in CMake(C|CXX)CompilerId.(c|cpp) for each compiler.  Provide
conversion macros DEC() and HEX() to decode decimal or hex digits from
integer values.  Parse the version out of the compiler id binary along
with the other INFO values already present.

Store the result in variable CMAKE_<LANG>_COMPILER_VERSION in the format
"major[.minor[.patch[.tweak]]]".  Save the value persistently in
CMake(C|CXX)Compiler.cmake in the build tree.  Document the variable for
internal use since we do not set it everywhere yet.

Report the compiler version on the compiler id result line e.g.

  The C compiler identification is GNU 4.5.2

Report CMAKE_(C|CXX)_COMPILER_(ID|VERSION) in SystemInformation test.
2011-12-07 08:59:51 -05:00
David Cole 386cf3c593 Merge topic 'GNU-to-MS'
ae62a1c Test CMAKE_GNUtoMS option in ExportImport on MinGW and MSys
afb00fe Add CMAKE_GNUtoMS option to convert GNU .dll.a to MS .lib
61e8629 Factor makefile generator link rule lookup into helper function
a603250 Load platform files that need to know the ABI when possible
ecd8414 Fortran: Detect pointer size in gfortran on MinGW
2011-12-06 15:07:39 -05:00
David Cole f9144380f1 Merge topic 'fix-ExternalProject-svn-issue'
f529ddc Tests: ExternalProject: Remove unnecessary 'svn --version' call
2011-12-06 15:07:17 -05:00
Brad King ae62a1cd35 Test CMAKE_GNUtoMS option in ExportImport on MinGW and MSys 2011-12-05 18:20:35 -05:00
Rolf Eike Beer f529ddcea0 Tests: ExternalProject: Remove unnecessary 'svn --version' call
This test will fail to get a proper version number if running on a (e.g.
German) localized system because the regular expression used to match the
Subversion version output does not match. Instead of duplicating code just
remove the local test altogether and use the version that FindSubversion.cmake
already detects.
2011-12-05 11:49:31 -05:00
Brad King fea3e84ee3 export(): Document undefined behavior of location properties
Since the export() command needs to know the final location of a target
in the build tree we cannot allow properties affecting the location or
name of a target file to be set after the target is passed to export().

Fix a violation of this rule in the SimpleInstall test.
2011-12-01 16:00:12 -05:00
David Cole 97142c7603 Merge topic 'newline-style'
ac2e45d Provide std::ios_base typedef on GCC < 3
28c46ca cmNewLineStyle: Use cmStandardIncludes.h
75e83e9 cmNewLineStyle: Remove trailing comma in enum
be6502c bootstrap: Include cmNewLineStyle in build
a087490 Add NEWLINE_STYLE option to configure_file (#3957)
2011-12-01 14:03:24 -05:00
Peter Kuemmel a087490697 Add NEWLINE_STYLE option to configure_file (#3957) 2011-11-28 13:48:59 -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
Stephen Kelly 47457159c7 Add a test case for the use of Q_PRIVATE_SLOT. 2011-11-22 22:26:42 +01:00
Alex Neundorf bde4edb6ab automoc: add special handling for including basename_p.moc, with test
Alex
2011-11-22 22:01:13 +01:00
Alex Neundorf bc7560e6e5 automoc: add test for including a moc_abc_p.cpp file
Alex
2011-11-22 20:52:21 +01:00
Alex Neundorf 30fd8e603a automoc: add test for including the moc file from another header
including moc_xyz.cpp in abc.cpp should run moc on xyz.h (and
include the file in abc.cpp)

Alex
2011-11-22 20:52:13 +01:00
Alex Neundorf 80dfbc99f4 automoc: add a test for including both abc.moc and moc_abc.cpp
Alex
2011-11-22 20:51:59 +01:00
Brad King 8302608a74 Fix CMake.File hash test for CRLF checkouts
Use a dedicated test input file for the file() hash API tests.
Set attribute crlf=input so it is always checked out correctly.
2011-11-16 11:26:10 -05:00
Brad King 2e9c26cf96 Add string(MD5) and string(SHA*) commands to compute hashes
Provide a CMake-language binding to these cryptographic hashes.  Add a
string() command API for MD5, SHA1, SHA224, SHA256, SHA384, and SHA512.
2011-11-16 10:29:35 -05:00
Brad King 38771d3bdf Add file(SHA*) commands to compute cryptographic hashes
Add a file() command API for SHA1, SHA224, SHA256, SHA384, and SHA512.
2011-11-16 10:15:44 -05:00
Brad King 042f7965c3 Add file(MD5) command to compute cryptographic hash
Provide a CMake-language binding to the md5sum function previously
available only by "cmake -E md5sum".
2011-11-16 10:15:01 -05:00
David Cole f1197ff0da Merge topic 'fix-11213-vs10-mfc-support'
537020f Tests: Nudge MFC test to pass on VS 6 dashboards (#11213)
51f442e VS11: Update InstallRequiredSystemLibraries.cmake for VS11 (#11213)
d85ab7a Tests: Add environment logging to the MFC test (#11213)
011694c VS10: Use expected values for UseOfMfc (#11213)
a2e6d24 Tests: Fix MFC test to work with VS 10 and later (#11213)
2011-11-15 14:38:56 -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
Alex Neundorf 69cf480cd6 automoc: add more test cases
Alex
2011-11-10 22:12:03 +01:00
David Cole 537020f958 Tests: Nudge MFC test to pass on VS 6 dashboards (#11213)
InstallRequiredSystemLibraries does not install any dlls when
used with VS 6 dashboards. Modify the ValidateBuild script to
expect only 1 file when building with VS 6.

Using "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>" does not work when
<INSTALL_DIR> evaluates to a long enough string. However, using
"-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>" does work, even with
the longer strings. So: make sure to include the ":PATH" when using
this construct with ExternalProject calls so that they may install
to the proper location on VS 6 builds. All existing calls that match
"CMAKE_INSTALL_PREFIX.*INSTALL_DIR" include the ":PATH" after this
commit.

By the way: https://twitter.com/DLRdave/status/134339505397309440
2011-11-09 13:35:28 -05:00
David Cole d85ab7a412 Tests: Add environment logging to the MFC test (#11213)
Simply to ease analyzing still-occurring dashboard failures.
2011-11-08 15:13:52 -05:00
David Cole a2e6d2482e Tests: Fix MFC test to work with VS 10 and later (#11213)
The mfc app in the test was generated by the VS 7.1 wizard,
and due to changes in VS since then, the values used for WINVER
and _WIN32_WINNT caused compile errors when built with VS 10
or later. Change them to values appropriate for targeting
Windows XP or later when building with VS 10 or later.

See http://msdn.microsoft.com/en-us/library/6sehtctf.aspx
for more info.
2011-11-04 13:07:38 -04:00
David Cole c71f7ab7db Tests: Avoid MFC test automatically for Watcom WMake builds (#11213) 2011-11-03 13:21:06 -04:00
David Cole a42e3f2bf9 Tests: Fix MFC test for old vs6 dashboards (#11213)
The MFC test's mfc1 directory was a "VS-MFC-wizard-generated"
starter MFC app, using VS 7.1 as the generator. There's one define
used in the generated rc file that was not available back in the
VS6 days... Put a conditional define in here based on _MSC_VER
to enable the test app to build on VS6 dashboards.
2011-11-03 08:37:23 -04:00