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.
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.
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.
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()
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...?)
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.
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
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.
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).
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>
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.
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.
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.
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.
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.
In InstallRequiredSystemLibraries the documentation details the
variable CMAKE_SKIP_INSTALL_RULES to skip installation. This
actually doesn't do anything, the variable required is named
CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP. This commit amends the
documentation to point to the correct variable.
971692c Build enable_language command during bootstrap
960ace1 Add testing for windows resources for mingw/msys/cygwin and remove for watcom.
060d6e8 Add support for windres to cygwin.
b2f308c Add support for windows resources with mingw/msys.
This puts the new search behaviour for included files in action, i.e.
now when a file from Modules/ include()s another file, it also gets the
one from Modules/ included, i.e. the one it expects.
Alex
Since commit 70c2dc8a (Make compiler id detection more robust,
2008-03-10) we store compiler identification strings in test binaries
using the form
char* info = "info";
Use the const-correct
char const* info = "info";
form instead. This allows the C++ compiler identification to work with
"-Werror -Wall" or equivalent flags if the compiler would warn about
const-to-non-const conversion.
The TI DSP compiler predefines "__TI_COMPILER_VERSION__". Use this to
identify the C and C++ compilers. For assembler language the C compiler
executable is used:
$ cl6x -h
TMS320C6x C/C++ Compiler v6.1.11
Tools Copyright (c) 1996-2009 Texas Instruments Incorporated
Use this command-line option and output to recognize the assembler.
The Mac linker defines flag -headerpad_max_install_names but not all
front-ends recognize the flag and pass it through (many did in the past,
such as the Apple port of GCC). Use the -Wl, option prefix to tell
front-ends to pass it through without trying to interpret it.
One of Cygwin's goals is to build projects using the POSIX API with no
Windows awareness. Many CMake-built projects have been written to test
for UNIX and WIN32 but not CYGWIN. The preferred behavior under Cygwin
in such projects is to take the UNIX path but not the WIN32 path.
Unfortunately this change is BACKWARDS INCOMPATIBLE for Cygwin-aware
CMake projects! Some projects that previously built under Cygwin and
are Cygwin-aware when they test for WIN32 may now behave differently.
Eventually these projects will need to be updated, but to help users
build them in the meantime we print a warning about the change in
behavior. Furthermore, one may set CMAKE_LEGACY_CYGWIN_WIN32 to request
old behavior during the transition.
Normally we avoid backwards incompatible changes, but we make an
exception in this case for a few reasons:
(1) This behavior is preferred by Cygwin's design goals.
(2) A warning provides a clear path forward for everyone who may see
incompatible behavior, and CMAKE_LEGACY_CYGWIN_WIN32 provides a
compatibility option. The warning and compatibility option both
disappear when the minimum required version of CMake in a project is
sufficiently new, so this issue will simply go away over time as
projects are updated to account for the change.
(3) The fixes required to update projects are fairly insignificant.
Furthermore, the Cygwin distribution has no releases itself so project
versions that predate said fixes tend to be difficult to build anyway.
(4) This change enables many CMake-built projects that did not
previously build under Cygwin to work out-of-the-box. From bug #10122:
"I have built over 120 different source packages with (my patched)
CMake, including most of KDE4, and have found that NOT defining
WIN32 on Cygwin is much more accurate." -- Yaakov Selkowitz
A fully compatible change would require patches on top of these project
releases for Cygwin even though they otherwise need not be aware of it.
(5) Yaakov has been maintaining a fork of CMake with this change for the
Cygwin Ports distribution. It works well in practice. By accepting the
change in upstream CMake we avoid confusion between the versions.
CMake itself builds without WIN32 defined on Cygwin. Simply disable
CMAKE_LEGACY_CYGWIN_WIN32 explicitly in our own CMakeLists.txt file.
09d1c10 FortranCInterface: Recognize NAG Fortran module symbols
af2ad90 Add NAG Fortran compiler information files
24cc3d4 Recognize the NAG Fortran compiler
83892c4 Allow Fortran platform files to set empty values
fe3f878 Detect object files in implicit link information
Use "int main(void)" instead of just "int main()" so that compiling with
"gcc -Werror=strict-prototypes" works. Test this check using the flags
"-Werror -Wstrict-prototypes" to work with old GCC versions.
Since commit aff31479 (Modernize GNU compiler info on Windows,
2009-12-02) the file Modules/Platform/Windows-g++.cmake has been unused.
It just includes the non-existent Modules/Platform/Windows-gcc.cmake so
remove it outright.
This moves Intel compiler info on Windows into new-style modules
Platform/Windows-Intel-<lang>.cmake
using language-independent helper module
Platform/Windows-Intel.cmake
to define macros consolidating the information.
Commit 4430bccc (Change the way 32/64 bit compiles are detected with
MSVC and intel, 2009-11-19) added detection of the target processor to C
and CXX language builds with MS and Intel tools. Do the same for Intel
Fortran for Windows (ifort). Use /machine:<arch> to link executables.
3bc828d Fixed bug where last entry would be lost.
b316087 Escape file write expansion, and build up lists.
68cd3fe Added CMAKE_CACHE_ARGS to ExternalProject.
27ee50a Add ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT as a ADVANCED cache variable (#9631)
50d21d4 Add cache var CMAKE_ECLIPSE_MAKE_ARGUMENTS when using the Eclipse generator
This variable can be set to command line arguments which will be passed
to make when eclipse invokes make, e.g. you can enter "-j8" to get
8 parallel builds (#9930)
Alex
Escaped the @var@ in the file writes - this was being expanded at file
write and so not causing a reconfigure at the right time. I also took
care of build up lists of lists in the variables, especially important
for things like MPI_EXTRA_LIBRARY. Added some error checking, and use
the tmp_dir for initial cache file.
On Windows the limit for command line arguments is 8192 characters, and
this was limiting longer paths with some of our more nested projects
such as Library. Placing the -D arguments into CMAKE_CACHE_ARGS will
write out an initial cache file, that will be passed to CMake with a -C
argument as the initial cache.
By forcing the cache variables we preserve the existing behavior with
-D, to change the values of cache variables in our inner projects.
On Linux the NAG Fortran compiler uses gcc under the hood to link. Use
"-Wl,-v" to pass "-v" to the underlying gcc compiler to get verbose link
output. Detect the NAG Fortran directory (using -dryrun) and then honor
object files in the directory referenced in the implicit link line.
Pass real linker options with "-Wl,-Xlinker,". The -Wl, gets through
the NAG front-end and the -Xlinker gets through the gcc front-end.
The Numerical Algorithms Group (NAG) Fortran compiler does not document
a preprocessor macro to identify it. Check for identifying output using
the -V option.
Teach CMakeFortranInformation to use default flags only for variables
that have not been set at all, rather then not set or empty. This will
allow platform or compiler-specific information files to set empty
values without getting the defaults.
The NAG Fortran compiler implicitly passes object files by full path to
the linker. Teach CMakeParseImplicitLinkInfo to parse object files that
match some tool-specific regular expression.
FindTCL.cmake switched variables in the FIND_LIBRARY invocation. The
FIND_LIBRARY() statement for TCL used the TK variables and vice versa.
This patch reverses that into the right usage.
Closes debian issue 600245.
Also, improve the documentation of the fixup_bundle and fixup_bundle_item
functions to clarify that plugin type "libs" need to be copied into
the bundle *before* calling fixup_bundle.
Commit e93a4b4d34 changed the way that
the libs parameter to fixup_bundle is interpreted. Before the commit,
the libs were copied into the bundle first and then fixed up. After
the commit, the copy was skipped, assuming the libs were in the bundle
in the first place, and then the fixups occurred as before.
However, before the commit, it was possible to name a lib from outside
the bundle, and have it copied in and then fixed up. Its resolved
embedded name was always inside the bundle before. After, its resolved
embedded name was just the same as its resolved name, which is in its
original location, and not necessarily inside the bundle.
This manifested itself as a problem with the ParaView call to
fixup_bundle and its many plugins. Previously, ParaView had simply
passed in the list of plugin file names as they existed in the build
tree, and left the copying into the bundle up to the fixup_bundle
function. When built with CMake 2.8.3 (the first version to contain
the above named commit) the fixup_bundle call would inadventently
fixup libraries in the build tree, not libraries that were in the
bundle. Furthermore, the plugins would not be in the final bundle.
This points out the fact that the fix for the bugs made by the above
commit was a backwards-incompatible change in behavior.
This commit makes it an error to try to fixup an item that is not
already inside the bundle to make the change in behavior apparent
to folks who were depending on the prior copy-in behavior: now,
they should get an error, and hopefully, reading the new and
improved documentation, should be able to resolve it in their
projects by adding code to install or copy in such libraries prior
to calling fixup_bundle.
Whew.
e0b6016 Some more fixes for nasm support, from Etienne (#10069)
d25c2eb Use CMAKE_ASM_NASM_FLAGS for nasm instead of FLAGS
e614e9b Add support for yasm, a nasm compatible assembler
79dd9be We already have 2010, fix copyright year.
ffeca06 Add missing copyright headers
7b337ac Improve misleading comments.
e1fc9b9 Add support for nasm assembler, patch by Peter Collingbourne (see #10069)
Use the Config mode of find_package to search for ITKConfig. This makes
FindITK a thin-wrapper around a standard find_package, bringing benefits
like searching lib64 paths when appropriate. This does for FindITK what
commit 2c1a01dc (Modernize FindVTK module, 2009-10-07) did for FindVTK.
The Mac linker defines -headerpad_max_install_names and the GCC
front-end passes this flag through. The PGI compiler does not know
about this flag, so we must use -Wl,-headerpad_max_install_names to pass
it to the linker instead.
CMakeDetermineASMCompiler.cmake relied on that somebody else (usually
during enabling C or CXX) already included that file, and broke if that
was not the case.
Thanks to Louis for the patch
Alex
The Cray Fortran compiler needs "-em" to enable module output and also
"-J." to place the .mod files in the current working directory (instead
of next to the .o file).
Previously FindPerlLibs did not work with the Mac stock Perl because it
includes patches. From "perl -V":
Locally applied patches:
/Library/Perl/Updates/<version> comes before system perl directories
installprivlib and installarchlib points to the Updates directory
Adjust paths accordingly.
48e80eb Fixes to GetPrerequisites for cygwin
bee4802 Append the gp_tool path to the system PATH using native slashes.
8e550ba Remove unecessary TO_CMAKE_PATH for gp_cmd_dir.
1684198 Switch to CMAKE_PATH when doing PATH comparisons on Windows.
be94c49 Fixed appending PATH to dumpbin tool from growing without bounds.
Fix IF(WIN32) guards check for cygwin. Fix checking if the depenency is in a system location to use cygwin style paths on cygwin. Also change GetPrerequisites to switch gp_tool to tools that are very unlikely to be found, ie. dumpbin on Apple and otool on Windows/Unix.
Users PATH may contain elements that end with backslash. This will escape the semicolon when iterating resulting in mismatches.
Fix indentation.
Fix whitespace
This fixes bugs #0011355 and 0008342.
The merged patch is a contribution from Michael Lasmanis and Petri Hodju
with some extra documentation added by the merger.
IF(... MATCHES ...) used for comparing directories chokes especially in the case of C:\Program Files (x86)\<blah> because of regex pattern matching. Switched this to use STREQUAL in a loop instead.
Fixed parallel build for projects using generators that have the
CMAKE_EXTRA_GENERATOR as well as CMAKE_GENERATOR. Thanks to Bill Hoffman
for helping me to track this one down, I missed parallel builds.
There is no need to introduce this extra variable as FindBoost
can simply rely on if Boost_USE_STATIC_RUNTIME is defined
or not to disable the old searching behavior for static runtime
libraries on WIN32.
On a Win32 system with a German version of SilkSVN I couldn't run CMake
again on the working copy as the cache is displayed as corrupted. The
cause is that the regular expression to find the version number will not
match and put everything from the "svn --version" output into the cache,
which contains umlauts and other funny characters.
Fix the regexp to not only match " version " but also " Version " as
it's in the German output. I have no idea what will happen on a French
or Japanese system. This should be easy to test as it happens also on a
German Linux system.
b935f00 Close ENDFUNCTION() properly with the same name as FUNCTION()
07bca48 Set a default DESCRIPTION if none is given for ALL mode of feature_summary()
d5b2915 APPEND and not-APPEND mode of feature_summary() were swapped
In each CMake<lang>Information.cmake file we use an _INCLUDED_FILE
variable to track whether a compiler information file has been loaded.
Reset this variable for each language.
This fixes Fortran under VS generators with the Intel plugin.
Previously the variable would be left set true from C and C++ and then
Fortran would not load old-style files like Platform/Windows-ifort.
If a Qt installation is in CMAKE_PREFIX_PATH and a
QT_QMAKE_EXECUTABLE points to a qmake for a different Qt installation,
prefer finding libs in the latter Qt installation.
Use a separate variable to pass to the BUILD_COMMAND call
and then use set(CACHE) to transfer that to MAKECOMMAND.
That way, if MAKECOMMAND is in the cache already, it is
left untouched. Fixes regression introduced in commit
0b38bb4c with the fix for bug #2336.
Thanks to Evgeniy P for the patch.
Parse compiler flags like "-fmessage-length=0 -fstack-protector
-funwind-tables -fasynchronous-unwind-tables -fno-strict-aliasing" from
the output of "mpicc -show". We already handle preprocessor definition
arguments like -DUSE_STDARG. Honor '-f' flags too.
Add Boost_REALPATH option for people packaging Boost with their app:
Boost_REALPATH Resolves symbolic links for discovered boost libraries
to assist with packaging. For example, instead of
Boost_SYSTEM_LIBRARY_RELEASE being resolved to
"/usr/lib/libboost_system.so" it would be
"/usr/lib/libboost_system.so.1.42.0" instead.
This does not affect linking and should not be
enabled unless the user needs this information.
* Add a warning if the user sets Boost_ROOT which is not correct
* Clarify directions to the user for viewing debugging messages
* Move the CMAKE_FIND_LIBRARY_SUFFIXES tweak outside of a for loop
* Fixed issue 11204: FindBoost.cmake had trouble discovering libraries
when both -sgd and -gd libraries were available by adding a new option
Boost_USE_STATIC_RUNTIME.
Backwards compatibility of searching for first -gd and then -sgd on
WIN32 is maintained unless the user sets Boost_COMPAT_STATIC_RUNTIME to
false (or they have set Boost_USE_STATIC_RUNTIME).
* Fixed issue 8529: FindBoost was unable to detect boost libraries compiled against
STLport, by reworking the way the Boost ABI tag is calculated. There are additional
ABI tag options available now as well.
* Boost_DEBUG now reports the full list of filenames being searched for when
find_library is called.
Use a combination of response files and the archiver to support long
object file lists that do not fit in the Windows command-line length
limit. This can work only with GCC >= 4 because the MinGW GCC 3.x
front-ends do not support response-file syntax.
CUDA 3.2 on Windows systems changed the layout of the library paths. This adds the extra
directories needed to locate the new files.
I also explicitly disable emulation mode for CUDA 3.1+. This feature was deprecated in
3.0 and ultimately removed in 3.1. The script errors out if CUDA_BUILD_EMULATION is
turned on. I didn't want to ignore emulation mode (even with a warning - which most
people may not even see) and have users confused as to why it wasn't working.
The default value for CMAKE_INSTALL_PREFIX should be
based on what architecture the built targets are, not
what architecture CMake itself is.
This fix merely guesses better what the built targets
architecture is. It still may guess incorrectly in some
cases. For those cases, it will have to be up to build
scripts and developers on projects to pass in a correct
value for CMAKE_INSTALL_PREFIX with -D on the command line
or via 'force cache value' logic in CMakeLists.txt files.
7944e4e Allow testing of .CPP on WIN32 as it is a case insensitive OS and should work.
ba0a890 Only test for .CPP on Microsoft compilers which will handle .CPP as c++.
d26cd46 Only use .CPP .CXX and .C++ do not work by default with g+++.
ced61f5 Let CMake recognize .CPP .CXX and .C++ as c++ files.
ede24f8 ENH #8993: FindwxWidgets add support for wx-config custom options.
3dbeeb7 BUG #8184: Fixed FindwxWidgets wrong order of default libs for MinGW.
f46712e BUG #11123: Generic include dir should come after config specific one.
6cb14eb STYLE: Clarified/Fixed documentation of UsewxWidgets.
36c15a2 BUG #10658: FindwxWidgets USE_FILE should not include .cmake extension.