Commit Graph

2819 Commits

Author SHA1 Message Date
Alex Neundorf 38f92bfbe1 Add ASM support for the Intel compiler
Alex
2011-02-23 21:15:18 +01:00
Alex Neundorf 4b40d4297a Rework the way assembler is handled, use the C/CXX compiler by default
This commit changes the way how the assembler support works in cmake.
The language "ASM" now always uses the C/Cxx compiler instead
of the assembler directly. This fixes #8392, assembler files are
not preprocessed.
If one wants to use the assembler directly, the specific
assembler "dialect" has to be enabled. I.e. to get as/gas,
you have to use now ASM-ATT, the same way for ASM_MASM and ASM_NASM.

Implemented this now for gcc.
SunStudio, IBM, HP and Intel still todo.

Alex
2011-01-30 21:03:37 +01:00
Brad King 7c4e57c821 Merge topic 'FixParsingCompilerNameWithVersionNumber'
5883c51 Fix parsing of compiler name with a version number
bd57bc5 Strip trailing whitespace.
2011-01-28 14:17:21 -05:00
Brad King 182eb7c7ef Merge topic 'dev/strict-mode'
dd2f814 Merge branch 'dev/add_test-working-directory' into dev/strict-mode
949d32c Unwatch manual variables upon removal in cmake-gui
3939032 Unwatch manual variables upon removal in ccmake
8354413 Add method to unwatch a manual variable
8ed3c85 Give a better message for unused variables
729db48 Fix ArgumentExpansion test expected results
89c2544 Checking for a definition is a usage
5625dee Don't output to stderr in the GUI
ad25a96 Merge branch 'ImprovedDotSupport2' into dev/strict-mode
c128abe Merge branch 'AddCMAKE_CURRENT_LIST_DIR' into dev/strict-mode
9bcaff0 Merge branch 'cmake-guiRememberAdvancedCheckbox' into dev/strict-mode
544d0c3 Fix expected output for WarnUninitialized test
4e3bea4 Update expected messages to new format
8e8c9e4 Don't check at destruction for usage
668e005 Use cmake::IssueMessage for warnings
88cd4c1 Use 'CMake Warning' versus 'warning' for CDash
3c3b98d Initialize the class before setting warn flags
cf8b15a Ignore files under the CMakeFiles directory
fd50f06 Don't check for unused vars at configure time
447a04c Don't warn during configure when doing everything
b97ee21 Check for unused variables at the end of generate
c18c977 When checking for variables, specify a reason
3f1121f Use a long int since Line is a long as well
2507f93 Change the failure case string to 'Unexpected'
fe390a2 Add 'ArgumentExpansion' test
8dbb209 Wrong boolean value for CLI warnings
d4ee998 Hard-code the --no-warn-unused-cli flag
a267b99 Fix line lengths
82ed104 Flag that the directories have been set
5aa535b Add argument to arg parsing to not set directories
367e5c3 Revert "Revert "When calling CMake, set the args and the cache""
ab5d4e4 Revert "When calling CMake, set the args and the cache"
9b90040 When calling CMake, set the args and the cache
fe56002 Fix long lines for KWStyle
5d30cfc Set a watch on variables added through the gui
33c63b1 Add a method to put a watch for variables
535253f Initialize the warning variables earlier
cbb286c Fix the path detection to work for top-level
62be1f7 Initialize the usage stack earlier
c6e7fab Factor out the checks for unused variables
5e41ba8 When using the API, check for Add vs. Remove
dee1976 Fix typo in VariableUnusedViaUnset test
f231ce5 Remove old false positive avoidance code
a117e02 Revert "Add test for unused warnings at the end of scope"
2c82f2b Exempt CMAKE(CURRENT|PARENT)_LIST_FILE from usage
6d7d449 Ignore CLI warnings for ABI determination
7740a73 Only return local keys that are defined
bef3aee Use the API so that warnings can be tracked
05cb0f4 Check for unused variables in the dtor
91c4c99 Add test for unused warnings at the end of scope
ca90f67 Fix detection of unused variables when setting
f7438ca Add test for unused detection via setting it
995cfb0 Don't warn if the variable wasn't defined
aefc91d Add test for usage checks via unset
a8e97f8 Remove VarRemoved code since it's been superceded
59463ef Rework CheckVariableForUnused usage
f117423 Fix line lengths to be no more than 78
e49a935 Improve unused warning logic
e01e40c Mark ARGC, ARGV*, and ARGN as used
a17aff7 Ignore CMAKE_MATCH_* variables for usage
02a114d Add method to allow variables to be marked as used
a0b0d23 CMAKE_DO_TRY_COMPILE is no longer used
ae3eff3 Fix the path used for ignoring system warnings
056b441 Fix missing case for usage of a variable
980e048 Factor out checks for unused variables
83acb0a Remove now unused variables
3801463 Use built-ins for readability and maintainability
8b52015 Push the initialize and unused states when copying
439877f Be consistent with single and double quotes
4cf1706 Add documentation for check-system-vars
b74777f Fix the spelling of the flag for warn-unused-vars
b948120 Change logic of flag to turn off cli unused checks
f047a17 Add test for uninitialized variables
75bda38 Add tests for unused command line variables
300fc15 Fix detection of system files
d784e6a Run the unused variables check on the final pass
9efc057 VariableWatch is not available when bootstrapping
2e78224 Add a missing comma to the warning message
7499700 Add a flag to warn about system files
fff9f6d Rename flags again and use variablewatch for cli
786e269 Add warn-unused to the Qt interface
636e6c4 Default to marking things as used
4ff0340 Rename find-unused to warn-unused
d7999e9 Rename strict-mode to warn-uninitialized
e141bc9 Detect unused variables
d3e8eb5 Add flags to detect unused variables
f332e14 Complete strict-mode checks for uninitialized vars
52f9637 Add method to get the local scope variables
f794d58 Make --strict-mode option, and integrate with cmake-gui
48b5b85 Add a warning when variables are used uninitialized.
cd626ea For macros make sure the FilePath points to a valid pointer in the args.
2011-01-27 15:34:07 -05:00
Brad King dd2f81491e Merge branch 'dev/add_test-working-directory' into dev/strict-mode
Conflicts:
	Tests/CMakeLists.txt
2011-01-27 14:39:55 -05:00
Brad King 7e6a004659 Merge topic 'relative-CMAKE_USER_MAKE_RULES_OVERRIDE'
a146e03 Fix relative CMAKE_USER_MAKE_RULES_OVERRIDE (#11725)
2011-01-26 15:24:05 -05:00
Alex Neundorf 5883c5191e Fix parsing of compiler name with a version number
This fixes #11679, the toolchain prefix was not correctly detected
for arm-eabi-gcc-4.5.2

Alex
2011-01-26 20:52:34 +01:00
Alex Neundorf bd57bc5312 Strip trailing whitespace.
Alex
2011-01-26 20:51:25 +01:00
Brad King c4275592a8 Modules: Include builtin FindPackageHandleStandardArgs directly
The FindPackageHandleStandardArgs module was originally created outside
of CMake.  It was added for CMake 2.6.0 by commit e118a627 (add a macro
FIND_PACKAGE_HANDLE_STANDARD_ARGS..., 2007-07-18).  However, it also
proliferated into a number of other projects that at the time required
only CMake 2.4 and thus could not depend on CMake to provide the module.
CMake's own find modules started using the module in commit b5f656e0
(use the new FIND_PACKAGE_HANDLE_STANDARD_ARGS in some of the FindXXX
modules..., 2007-07-18).

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

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

  include(FindPackageHandleStandardArgs)

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

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

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

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

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

The only remaining solution to keep existing projects that exhibit this
problem building is to restore the change originally made in commit
b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake
everywhere, 2010-09-28).  This also avoids policy CMP0017 warnings for
this particular instance of the problem the policy addresses.
2011-01-20 10:56:49 -05:00
Brad King a146e03422 Fix relative CMAKE_USER_MAKE_RULES_OVERRIDE (#11725)
In commit 295b5b60 (Honor CMAKE_USER_MAKE_RULES_OVERRIDE in try_compile,
2010-06-29) we started passing the value of this variable when building
a try_compile project.  If the variable contains a relative path it must
be treated with respect to the file where it is first used.  Ensure that
the value is converted to a full path so that it is correctly referenced
in the try_compile projects.
2011-01-19 18:15:36 -05:00
Brad King 863c7dfd88 Merge topic 'fix-find-png-zlib'
30e19b7 Add new names for PNG and ZLIB libraries
2011-01-19 14:28:29 -05:00
Brad King d9fb64088b Merge topic 'fix-10031-add-freeglut'
efd1d9c Add freeglut as library name (#10031)
2011-01-19 14:28:26 -05:00
Brad King b9f9c90eaf Merge topic 'qt4-query-exec-process'
858fe0e Replace exec_program with execute_process for qmake queries.
2011-01-19 14:28:24 -05:00
Brad King ef1f9456aa Merge topic 'sco-compiler'
e60c8ec Factor SCO compiler info out of platform file (#11700)
db05da3 Recognize SCO UnixWare C/C++ compilers (#11700)
2011-01-19 14:28:19 -05:00
Brad King d0b4f13521 Merge topic 'fix-install-req-sys-libs'
96cd163 Add CPACK_NSIS_INSTALL_ROOT for CMake's own installer (#9148)
fa4a3b0 Add CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS variable
fc14492 VS10: Fix problems with InstallRequiredSystemLibraries.
2011-01-19 14:03:15 -05:00
Brad King a104712d41 Merge topic 'python-modules-header'
23635ff Bug #11715 - generate header in the build tree.
2011-01-19 14:02:57 -05:00
Brad King ef27b9cd89 Merge topic 'doc-CheckSymbolExists-enum'
4995b26 Update CheckSymbolExists copyright year
840f9c0 Document CheckSymbolExists more clearly (#11685)
2011-01-19 14:02:38 -05:00
Brad King 3b900dbd09 Merge topic 'doc-CheckFunctionExists-clarify-issue-10044'
114c322 Document CheckFunctionExists more clearly (#10044)
2011-01-19 14:02:33 -05:00
Clinton Stimpson 858fe0ed41 Replace exec_program with execute_process for qmake queries. 2011-01-17 19:14:22 -07:00
Marcus D. Hanwell 23635ff1a0 Bug #11715 - generate header in the build tree.
The module header was being placed in the source tree before. Thanks to
Marcel Loose for the patch, this ensures the file is written to the
build tree.
2011-01-17 15:29:01 -05:00
David Cole efd1d9c799 Add freeglut as library name (#10031)
Thanks to Thomas Sondergaard for the patch in the bug report.
2011-01-17 14:19:18 -05:00
Brad King 4995b267b7 Update CheckSymbolExists copyright year
Reflect that commit 840f9c05 (Document CheckSymbolExists more clearly,
2011-01-12) changed the file in 2011.
2011-01-17 14:10:55 -05:00
Brad King 114c3224a4 Document CheckFunctionExists more clearly (#10044)
State that the function need only be available at link time.  Refer to
CheckSymbolExists for verifying that a declaration exists.
2011-01-17 14:02:21 -05:00
Brad King e60c8ec6c7 Factor SCO compiler info out of platform file (#11700)
Move these flags out of the SCO_SV platform file so that other compilers
may be used on that platform without interference.
2011-01-17 09:57:17 -05:00
Brad King db05da35d2 Recognize SCO UnixWare C/C++ compilers (#11700)
These compilers define __SCO_VERSION__ as VvvYYYYMML:

     V = major version
    vv = minor version
  YYYY = release year
    MM = release month

http://osr600doc.sco.com/en/manCP/cc.CP.html
http://osr600doc.sco.com/en/manCP/CC.CP.html
2011-01-17 09:52:33 -05:00
David Cole 30e19b79dd Add new names for PNG and ZLIB libraries
Thanks to Pau Garcia i Quiles for the patch on the CMake
mailing list.
2011-01-14 12:28:10 -05:00
Brad King cabb6cd00e Document Check(C|CXX)SourceCompiles behavior more clearly (#11688)
Explicitly state up front that the macros try to link an executable and
that the source provided must define 'main'.
2011-01-14 07:36:59 -05:00
David Cole fa4a3b04d0 Add CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS variable
The parent commit added a warning message whenever a required file
does not exist.

As it turns out, the "required" files never exist when built with
Visual Studio Express editions. Add a variable to suppress these
warning messages because only packagers or naive includers of
this file will care to see such warning messages.

We want to warn about this condition by default so that people who
are using InstallRequiredSystemLibraries without understanding it
fully will have a chance of understanding why it's not working in
the event of missing required files.

But we also want to give projects the ability to suppress this warning
(by "project's choice default") so that they can encourage users who
are restricted to using an Express edition to build their project.

Packagers should explicitly use...

  -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS=OFF

...when building releases. That way, their release build process will warn
them about any missing files, but only if their project CMakeLists files
use a construct similar to CMake's:

  IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
    SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
  ENDIF()
2011-01-13 16:52:51 -05:00
David Cole fc144924a0 VS10: Fix problems with InstallRequiredSystemLibraries.
Thanks to "J Decker" on the CMake mailing list for pointing out
that one of the MSVC10_CRT_DIR settings was using "VC90" instead
of "VC100".

After fixing that, I added the code to generate a CMake warning
if one of the files we think is "required" does not exist.

Then, with VS10, there were several other problems that the
warning revealed:

 - MSVC10_REDIST_DIR needed more PATHS to be found correctly

 - the 64-bit directory is named "x64" now, not "amd64" as in
   previous VS versions

 - manifest files no longer exist as separate files in the
   redist subdirectories (they must be built-in as resources
   to the dlls...?)
2011-01-13 13:08:59 -05:00
Brad King 840f9c055c Document CheckSymbolExists more clearly (#11685)
The check works for macros, functions, and variables, but not for types
or enumeration values.  Clearly describe the behavior of the check with
respect to each symbol type.
2011-01-12 08:58:19 -05:00
Brad King 28a0403c34 Merge topic 'resolve/python-versions/policy-CMP0017'
784d5ce Merge branch 'policy-CMP0017' into resolve/python-versions/policy-CMP0017
2d3594b Python additional version support, bug #10279.
2011-01-11 15:59:34 -05:00
Brad King 784d5ce0f8 Merge branch 'policy-CMP0017' into resolve/python-versions/policy-CMP0017
Conflicts:
	Modules/FindPythonInterp.cmake
2011-01-11 15:56:59 -05:00
Brad King 46ed6c65a8 Merge topic 'improve-findgit'
ed2b314 Add PATH_SUFFIXES for finding git.
2011-01-11 15:53:43 -05:00
Brad King ad543dcf09 Merge topic 'archive-rule-variables'
c2d73c9 Allow platform files to set large archive rules (#11674)
2011-01-11 15:53:06 -05:00
Brad King 9a81f0dd0c Merge topic 'ep-fix-substitutions'
d67a513 ExternalProject: Replace location tags in CMAKE_CACHE_ARGS
d7a87b5 Merge branch 'ep-log-output-under-vs' into ep-fix-substitutions
2011-01-11 15:52:36 -05:00
Brad King c39abc2411 Merge topic 'ep-log-output-under-vs'
44aff73 ExternalProject: Avoid bleed-through output when logging.
2011-01-11 15:52:30 -05:00
Brad King 764015c284 Merge topic 'policy-CMP0017'
ce28737 Remove usage of CMAKE_CURRENT_LIST_DIR now that we have CMP0017
7db8db5 Improve documentation and messages for the new CMP0017
db44848 Prefer files from CMAKE_ROOT when including from CMAKE_ROOT
1e69c6f Merge branch 'user-policy-defaults' into policy-CMP0017
65a0a2a Merge branch 'include-command-whitespace' into policy-CMP0017
2011-01-11 15:52:13 -05:00
Brad King f04bbdf1d4 Merge topic 'fix-install-reqd-sys-libs'
753b429 InstallRequiredSystemLibraries debug-only (#11141)
492cd84 Add variable for InstallRequiredSystemLibraries dir (#11140)
dd5c592 Fix incorrect variable documentation (#11127)
2011-01-11 15:51:35 -05:00
Brad King b8e5d7b49c Merge topic 'qt4-find-plugins'
e6bb8c7 Add support for using static/dynamic Qt plugins.
2011-01-11 15:48:44 -05:00
Brad King b524f864ca Merge topic 'fix-9148-cpack-nsis-installer-root'
5a9e8e7 CPack: Add CPACK_NSIS_INSTALL_ROOT variable (#9148)
2011-01-11 15:48:34 -05:00
David Cole 5a9e8e701e CPack: Add CPACK_NSIS_INSTALL_ROOT variable (#9148)
Control the root directory of the default directory presented to
the end user of an NSIS installer by a CPack variable.

Previously, the value used in the NSIS script was $PROGRAMFILES,
which is equivalent to the "ProgramFiles" environment variable.
That default value is still the same, but now a project may
override the value by setting this new variable.
2011-01-11 15:42:42 -05:00
Marcus D. Hanwell 2d3594b1bb Python additional version support, bug #10279.
Introduced an additional variable, Python_ADDITIONAL_VERSIONS, to both
FindPythonLibs and FindPythonInterp. Changed FindPythonInterp to loop
over versions rather than hardcoding all versions (more like libs).
2011-01-10 13:44:45 -05:00
Brad King c2d73c938a Allow platform files to set large archive rules (#11674)
Commit aaa88d33 (Build large archives incrementally, 2008-08-04)
hard-coded rules to create static archives incrementally in each
language information file.  Set each rule conditionally to allow
compiler and platform information files to override the language
default rules.

Inspired-by: Harald Pohl <pohl.h@eppendorf.de>
2011-01-10 09:58:55 -05:00
David Cole d67a513447 ExternalProject: Replace location tags in CMAKE_CACHE_ARGS
When we added CMAKE_CACHE_ARGS, we did not try it with any
<SOURCE_DIR> or <INSTALL_DIR> references. This commit fixes
that accidental omission.
2011-01-07 08:04:16 -05:00
David Cole d7a87b52a0 Merge branch 'ep-log-output-under-vs' into ep-fix-substitutions 2011-01-07 07:59:21 -05:00
David Cole 44aff73d4a ExternalProject: Avoid bleed-through output when logging.
Unset VS_UNICODE_OUTPUT when executing a command whose output
is being logged to a file. Previously, running Microsoft tools
in sub-processes of Visual Studio would send their output to
the Visual Studio output pipe named by this environment variable.

Unsetting it forces the output back to the normal stdout and stderr
channels where cmake can intercept it and direct it to the
appropriate log files.
2011-01-06 18:29:44 -05:00
Mike McQuaid bee514c361 Add CPack NSIS MUI_FINISHPAGE_RUN support (#11144)
MUI_FINISHPAGE_RUN is frequently used with NSIS and provides a checkbox
on the finish page of an installer which specifies whether the specified
executable should be run when the installer exits. This commit adds support
for this setting in CPack.
2011-01-06 16:21:36 -05:00
Mike McQuaid 702c8f8ba7 Add CPACK_NSIS_EXECUTABLES_DIRECTORY (#7828)
NSIS installers default to assuming the executables exist in a
directory named "bin" under the installation directory. As this
isn't usual for Windows programs, the addition of this variable
allows the customization of this directory and links still to be
created correctly.
2011-01-06 16:21:23 -05:00
Mike McQuaid 753b429ec4 InstallRequiredSystemLibraries debug-only (#11141)
Add support to InstallRequiredSystemLibraries to only install
debug libraries when both debug and release versions are available.

This is as if you are building a debug package then only the debug
versions are needed but not the release.
2011-01-06 12:22:03 -05:00
Mike McQuaid 492cd84fc5 Add variable for InstallRequiredSystemLibraries dir (#11140)
InstallRequiredSystemLibraries currently defaults to installing to
bin on WIN32 and lib otherwise. This patch allows you to configure
this by using the variable CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION.

It also switches the logic to use a single INSTALL(PROGRAMS) command
rather than two deprecated uses of the INSTALL_PROGRAMS command.
2011-01-06 12:21:35 -05:00