Fixes mantis bug report with id 15169. Some
component specific attributes were leaking
to next component. Leakage handling was
implemented in different locations but there
were still attributes that leaked. Patch
encapsulates generator into function so all
current leaks are fixed and no future leaks
can occur.
Implement a brand new FindMatlab module:
- Add support for versions and components.
- Find Matlab and its version in a more precise and multiplatform way.
- Add API to create a new mex extension with documentation.
- Add API to add matlab unit tests (with or without the unit test framework).
- Find as much as possible based on a single Matlab_ROOT_DIR cache entry
and allow the user to change it to re-find everything.
Protect against variables named "CSHARP", "PERL", "PYTHON", or "UNKNOWN"
when CMP0054 is not set to NEW.
Reported-by: Tuukka Pasanen <tuukka@iocaste.ilmi.fi>
Previously the module did not support projects using installation
components because install(PROGRAMS) was never called with COMPONENT.
Add an option to specify the COMPONENT so that projects doing this do
not have to resort to using CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP and
writing the install rule by hand.
In commit 3ec02547 (CPackRPM: Allow multiple path relocation prefixes
for one package, 2015-01-21) a regression was introduced that causes
parent directories of relocation paths to be incorrectly included in
the rpm. Fix this and make the test case more strict to cover it.
In Platform/Windows-MSVC the C and CXX flags are initialized to
contain preprocessor definitions describing the platform. On
WinCE platforms this may not be just -DWIN32. This information
may be important to RC sources too, so add such preprocessor
definitions to the default RC flags.
Suggested-by: Gunnar Roth <gunnar.roth@gmx.de>
The RC language is special in that it is automatically enabled
on Windows-based platforms when another primary language is
enabled. Move enablement of RC from early in the enablement
of the other language to late. This will allow it to use
information detected as part of enabling C, CXX, or Fortran.
3d612c73 MSVC: Compile with arch-specific flags on ARM platforms (#14552)
886dcaa7 MSVC: Distinguish among ARM architectures more precisely (#14552)
ea986676 MSVC: Define /DWINCE when building for WinCE platforms (#14552)
Allow URL templates to contain a %(algo:<key>) placeholder that is
replaced by mapping the canonical hash algorithm name through a map
defined by the <key>.
Extend the Module.ExternalData test to cover the behavior.
Extend the RunCMake.ExternalData test to cover error cases.
Refactor the Check*CompilerFlag modules to pass the flags to
Check*SourceCompiles using CMAKE_REQUIRED_FLAGS instead of
CMAKE_REQUIRED_DEFINITIONS. Both end up being used, but the variable
for "FLAGS" is more precise.
The change in commit v2.8.12~218^2 (CPackRPM protect '@' character in
filename processed in the spec file, 2013-07-05) was not necessary after
commit v2.8.12~439^2 (Add support for componentized USER spec file,
2013-04-01). The latter replaced ${VAR} references in the spec file
template string with \@VAR\@ references, thus protecting '@' symbols
automatically. This caused CPackRPM to break paths with @ symbols.
Revert the change to fix the behavior, and add a test case.
Otherwise find_library is unable to lookup the XCTest framework which
is not located in the SDK serach path:
In the 10.10 SDK the SDK frameworks are located here:
$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks
whereas the Platform SDKs are located here:
$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/Library/Frameworks
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
If a feature is added multiple times via ADD_FEATURE_INFO it should
appear only once in FEATURE_SUMMARY.
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
CPACK_RPM_<component>_PACKAGE_ARCHITECTURE variable allows
the same project to support packages of different architectures
including noarch, native and foreign architectures.
BuildArch must only be added to a spec file for a "noarch" package or
rpmbuild will fail. For all others, the --target argument sets the
package architecture. In the process of Fixing rpm architecture, we
make it mandatory, adding a default value of native architecture (the
same as if no --target argument is present). Update the documentation
at the top of the file to make it mandatory.
Clang Static Analyzer is so smart that it reports a defect when this
intended null-deref is encountered. Use sizeof instead which has no
runtime effects.
This check was first added by commit v3.0.0-rc5~6^2 (FindCurses: Detect
and satisfy ncurses dependency on tinfo, 2014-01-17), but it is not
correctly conditioned on existence of the tinfo library and fails if the
code path is taken but tinfo is not found. However, since commit
v3.2.0-rc1~369^2 (FindCurses: Drop search for deprecated HP-UX cur_colr
library, 2014-11-17) the result of the check is not used, so simply drop
it.
Since jsoncpp 0.7.0 (2014-11-20) the upstream may provide a CMake
package configuration file such that find_package(jsoncpp) will find a
jsoncppConfig.cmake file. In order to avoid conflicting with this
(especially on case-insensitive filesystems), and since we always prefer
projects to provide package config files (that they maintain), it is
better to not provide FindJsonCpp publicly.
Move FindJsonCpp into a private source directory that is not installed
so that we can still use it for building CMake itself.
Reported-by: Ryan Pavlik <ryan.pavlik@gmail.com>
4cf3589e Help: Add notes for topic 'compiler-version-Fortran'
f611406f Fortran: Test that CMAKE_Fortran_COMPILER_VERSION is set (#15372)
c6e1f464 Fortran: Detect G95 compiler version
0033faac Fortran: Detect PGI compiler version
302d47b1 Fortran: Detect XL and VisualAge compiler versions
8c8b77a5 Fortran: Detect GNU compiler version
49562a77 Fortran: Detect PathScale compiler version
aa77b631 Fortran: Detect SunPro compiler version
2e09c423 Fortran: Detect Intel compiler version
e6ebc814 Fortran: Add infrastructure to detect compiler version (#15372)
Fortran does not offer syntax to compose a string literal at
preprocessing time from numeric compuations. Instead encode each digit
of each component as a separate INFO string and compose them in CMake
code after extraction. Support MAJOR, MINOR, PATCH, and TWEAK
components with up to 8 digits each.
When matching implicit library names, use a sentinel "x" to avoid
ever expanding the library name as a variable. This was detected
by a CMP0054 warning.
The project has moved from <http://www.coin3d.org/> to
<https://bitbucket.org/Coin3D/coin/wiki/Home>. Simply drop the
out-dated link. Few find modules have links to the project sites.
Anyone looking to use a given find module likely already knows about the
project it finds and can use a search engine to find its homepage.
The file(GLOB_RECURSE) call added by commit 3ec02547 (CPackRPM: Allow
multiple path relocation prefixes for one package, 2015-01-21) should
not follow directory symlinks, so make sure CMP0009 is set to NEW.
1814cf74 Help: Add notes for topic 'add-CheckFortranCompilerFlag'
54e900ab CheckFortranCompilerFlag: Add test case
393a45e2 CheckFortranCompilerFlag: Add module to check Fortran flag existence
This bug caused c_function_prototypes to not be recorded at configure
time when compiling with -std=gnu99 or similar. In the case of feature
recording, that was not a problem, because the logic in
CMakeDetermineCompileFeatures.cmake currently assumes that a feature
present for an earlier standard is present for a later standard.
However, the detection strings are also used in WriteCompilerDetectionHeader,
so the feature macro has been defined to '0' when using a later language
dialect.
Fix that by not checking the existence of the __STDC_VERSION__ macro at
all when detecting C90 features.
If no compiler feature information is known for a given compiler
version, do not set a language standard default either. The two
settings must be recorded consistently.
When targeting Windows with a 64-bit architecture, use "$PROGRAMFILES64"
to get the Program Files folder. Use CMAKE_SIZEOF_VOID_P to check for
the architecture size instead of CMAKE_CL_64 because the latter is not
defined for all compilers.
Inspired-by: Hugh Sorby <h.sorby@auckland.ac.nz>
Inspired-by: İsmail Dönmez <ismail@donmez.ws>
809a5a5e Help: Add notes for topic 'CTestCoverageCollectGCOV-refinements'
03c0812c CTestCoverageCollectGCOV: Fix handling of international characters
8caa4e72 CTestCoverageCollectGCOV: Add test case
5c828cc8 CTestCoverageCollectGCOV: Allow custom flags to gcov
30cb628e CTestCoverageCollectGCOV: Fix handling of large file counts
Initialize CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT from the value
of CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT rather than the one for
the DEBUG configuration. This typo has been present since the logic was
first added in commit 36db45082e (ENH: fix up several problems with new
stuff, 2002-11-11).
Reported-by: Gunnar Roth <gunnar.roth@gmx.de>
When loading the list of target support directories, read the file
with UTF-8 encoding since that is what CMake writes into the file.
This allows us to support international characters in the path to
the build tree containing the target support directories.
Add a GCOV_OPTIONS option to allow specification of custom flags. In
ctest_coverage gcov support, if you set CTEST_COVERAGE_EXTRA_FLAGS, they
get put on the command line before the -o. In this case we remove the
-b and replace it with GCOV_OPTIONS. All other arguments remain the
same.
The "cmakexbuild" wrapper is not needed for Xcode 4 and above, and the
path to it may change when CMake moves. Avoid storing a specific path
to a build program in CMakeCache.txt and instead compute the value for
CMAKE_MAKE_PROGRAM on demand. However, if a user does set the value
explicitly then honor it.
This does for Xcode what commit v3.0.0-rc1~260^2~4 (VS: Switch to
internal CMAKE_MAKE_PROGRAM lookup by generators, 2013-11-15) did for
Visual Studio generators.
This will make them use the 'console' pool with the Ninja generator.
Impacted targets are:
- Built-in targets: install, install/local, install/strip, tests,
package, package_source, rebuild_cache
- Targets provided by the CTestTargets module: Nightly, Continuous,
Experimental,
and all their variants (*Start, *Configure, ...)
Within an existing build tree, if the stamp for a step already exists
when one activates the ALWAYS option, we still want it to always build.
Remove the step stamp file during CMake configuration to ensure it does
not exist when the ALWAYS option is enabled.
f3e0b6f1 CTestCoverageCollectGCOV: Add module to run gcov
6dd980e0 ctest_submit: Make CDASH_UPLOAD mode arguments more strict
5dc33f89 ctest_submit: Add CDASH_UPLOAD mode to upload files to CDash
Provide a function to run gcov and create a tarball of results.
Since CDash tracks the md5sum of the files uploaded, use the
--mtime option with "cmake -E tar" so that tar files could be
created that would have the same md5sum with the same content.
965a50dc Features: Fix GNU 4.4 and 4.5 C standard level flags
7f4154a4 Features: Fix CompileFeatures non-feature tests for space in path
f40c19b5 Features: Fix CompileFeatures test for C non-features
004e1540 Features: Record for GNU 4.4.
2a5ca650 Features: Wrap failure-test in UNIX condition.
1ae2c6b2 Features: Blacklist cxx_constexpr test for GNU 4.5.
c66e3317 Features: Use a more-common feature in cycle-test.
c43a6dc5 Features: Update comment in test to match the code.
78259135 Features: Test presence of cxx_auto_type with genex.
7b9fc88b Features: Remove outdated comment.
00194ea7 Help: Add notes for topic 'SolarisStudio-compile-features'
bcb04783 Features: Record for SolarisStudio 12.4.
536c535c Features: Adjust cxx_variadic_templates unit test for SolarisStudio.
5d57970d Features: Use variable in cxx_inheriting_constructors test.
69182ce4 Features: Ensure that the cxx_auto_type test is correct.
59e6e15c Help: Add notes for topic 'WriteCompilerDetectionHeader-multi-file-lang'
54156d72 WCDH: Generate per-language files in multi-file mode.
d84d6ed4 WCDH: Allow compilers to specify features for one language but not the other.
7dcdfec9 WCDH: Find a language-specific DetermineCompiler.cmake if present.
In commit v2.8.6~102^2~18 (Better support for lib64 and Debian
multiarch, 2011-07-14) variable names "..._LANGUAGE_ARCHITECTURE" were
set instead of the correct "..._LIBRARY_ARCHITECTURE". Fix this typo
and also set the language-independent variable
CMAKE_LIBRARY_ARCHITECTURE.
b937f753 FindQt: explicitely mention that it cannot Qt5 or later
6af8cbf2 FindQt: fix variable name in error message
49d05a47 FindQt: fix setting DESIRED_QT_VERSION if "find_package(Qt VVV)" was called
In case the given version was not only "3" or "4", but something like "4.8"
DESIRED_QT_VERSION was set to an unsupported value. While at it also check
that the version passed in is really in the range of 3.x and 4.x. Also
suggest switching to the more specific find modules if possible.
770ba876 Help: Add notes for topic 'GNU-4.6-compile-features'
b15c008f Features: Record for GNU 4.6.
f13a2eb1 Features: Adjust the RunCMake test to use more-common features.
1f19ac4d Features: Adjust cxx_variadic_templates unit test for GNU < 4.7.
0798d1e5 Features: Extend the generalized_initializers test for GNU < 4.7.
938bd94e Features: Test __GXX_EXPERIMENTAL_CXX0X__ macro for GNU < 4.7 compatibility.
462c630b Features: Don't test __cplusplus value for CXX98 on GNU.
222ec86f Features: Test an old value of __STDC_VERSION__ for GNU < 4.7 compatibility.
6e909035 Features: Record C/CXX dialect flags for GNU 4.6.
bfc995cc Features: Remove wrong content from else() condition.
1532b921 Features: Make cxx_noexcept available from GNU 4.6.
1f4649e6 Features: Update the default_dialect test for old GNU-like compilers.
a60027a6 Features: Ensure appropriate return value from feature test macros.
The macro is defined to 1 for GNU 4.6, and such a test is only
useful for features in language dialects newer than the
default (CXX98 for GNU currently).
Test only that it has a truthy value.
As this is not elseif(), the content has no effect.
Rather than changing it to an elseif(), remove the conditional content.
All versions of GNU prior to 5.0 default to C90/89.
Clang-C.cmake has a similar code block which correctly uses
elseif() for setting the default C dialect to C99. That may have
been updated from a C90 default at some point, so leave the
version condition there in place for now.
GNU-CXX already has complex logic and sets the _result to 0 before
tests which may set it to something else.
Change the other modules to be consistent with that.
Add support for a special URL template to map the fetch operation
to a project-specified .cmake script insead of using file(DOWNLOAD).
Extend the Module.ExternalData test to cover the behavior.
Extend the RunCMake.ExternalData test to cover error cases.
Move the basic DATA{} description to a section just before the
file series description. Move all sections on referencing files
into subsections of a common "Referencing Files" section.
Subsume example usage into the introduction since it gives a
high-level starting point to understand the rest of the docs.
da928d30 Help: Add notes for topic 'Apple-compiler-selection'
1f085e11 OS X: Resolve compiler in /usr/bin to that reported by Xcode xcrun
85d31735 CMakeDetermineCompiler: Factor out xcrun invocation into a macro
dcd72a74 Help: Add notes for topic 'Xcode-clang-compile-features'
3ad893b5 Features: Record for historical Xcode clang versions.
98965fb1 Features: Record dialect flags for AppleClang 4.0+.
The compiler in the PATH on mac is a stub for a different delegate
depending on the environment. Rather than requiring xcode-select to
change the used Xcode globally, users should be able to choose the
compiler per-session. That is possible with the DEVELOPER_DIR
environment variable.
However, the environment can change between running CMake and invoking
the build. In such cases, CMake prefers to record the relevant paths
from the environment and use them when invoking the build. That is not
currently done for the compilers on APPLE, so the compiler used is not
the one reported when running cmake:
$ DEVELOPER_DIR=/Applications/Xcode2.app/Contents/Developer/ cc --version
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
$ DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/ cc --version
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
Update that now by querying Xcode for the correct compiler path if
the compiler located by ordinary means is located in /usr/bin.
Revert commits:
2d738ce3 Help: Add notes for topic 'feature_record_msvc'
f73718c9 Features: Enable writing of MSVC compiler feature header.
64c30bdc Features: Record for MSVC C++ 2015 and MSVC C 2010-2015.
225c0ef8 Features: Record for MSVC 2010-2013.
This topic was merged to master prematurely, so remove it.
In commit v3.1.0-rc1~113^2 (Use a more reliable regex for extracting
binary INFO strings, 2014-09-03) the matching of INFO: strings was made
more strict and no longer matches just "INFO:qnxnto". Use
"INFO:qnxnto[]" instead to conform to the new pattern.
When installing, MSMPI puts a trailing backslash in the MSMPI_BIN
environment variable. This causes trouble when concatenating in CMake
since the list separator is now escaped and no longer a list separator
due to the trailing backslash. Instead, use file(TO_CMAKE_PATH) to make
the path CMake-friendly.
The approach in commit v3.1.0-rc1~1^2 (Xcode: Fix compiler id detection
when code signing is required, 2014-10-22) still requires a code signing
key when targeting a real device. Instead set CODE_SIGNING_REQUIRED to
"NO" to tell Xcode not to sign at all. Drop the corresponding setting
of the code signing identity.
Since commit v2.8.8~173^2 (FindRuby: clean up querying variables from
Ruby, 2012-02-17) we query RbConfig::CONFIG first and, if the command
fails or its output equates to a false constant, then fall back to
querying Config::CONFIG.
Due to the above, an error condition exists with Ruby 2.2.0; when
querying RbConfig::CONFIG['TEENY'], the output of '0' will be discarded
since it matches the false constant '0'.
In previous versions this wasn't a problem, but Ruby 2.2 has completely
removed Config::CONFIG. This causes RUBY_VERSION_PATCH to be set to an
empty string and the Ruby version to be detected as '2.2.' (instead of
'2.2.0').
Fix the output check to explicitly look for an empty string before using
the fallback query method. (Someone more familiar with Ruby might be
able to deem the fallback as unnecessary and fully remove it.)
2d738ce3 Help: Add notes for topic 'feature_record_msvc'
f73718c9 Features: Enable writing of MSVC compiler feature header.
64c30bdc Features: Record for MSVC C++ 2015 and MSVC C 2010-2015.
225c0ef8 Features: Record for MSVC 2010-2013.
Notes:
VS2015 and above are the only MSVC versions to support cxx_final, so remove
usages from the tests, and instead only test for cxx_override.
VS2012 and above to conform to cxx_decltype_incomplete_return_types
proposal, but without support for auto return types the dcl.type.simple
example in the proposal doesn't compile.
VS2013 and above to conform to the updated cxx_contextual_conversions proposal,
but VS2010 and above pass the test.
Compilers such as MSVC have no explicit flags to enable C++11 mode,
it just is always on. So only run the link tests with compilers that require
a flag to specify the language version.
Initializer lists are only properly supported in 2015 and above.
Previous Visual Studio releases said they supported initializer lists
but silently produced bad code.