SelectLibraryConfigurations module currently cache and mark as advanced
the variable ${basename}_LIBRARY.
${basename}_LIBRARY_RELEASE and ${basename}_LIBRARY_DEBUG are usually
cached, because they often come from find_library().
${basename}_LIBRARY on the other hand is always of type
"optimized;${${basename}_LIBRARY_RELEASE};debug;${${basename}_LIBRARY_DEBUG}"
or just "${basename}_LIBRARY_RELEASE" or "${basename}_LIBRARY_DEBUG" if
only one version of the library is not found, if both have the same
value, or if configuration types are not supported.
Caching and marking as advanced just ${basename}_LIBRARY_RELEASE and
${basename}_LIBRARY_DEBUG is enough, just by modifying these two
variables, the user has enough control on finding the library, and
having 3 variables is redundant and confusing.
When CMake reports failure to configure a project, especially when the
toolchain does not initialize properly, the true reason may be clear
from reading the CMakeFiles/CMake(Output|Error).log files. Advise users
to look at these files if they exist when configuration fails.
Add RunCMake.Configure test to check that the log files are mentioned
when configuration fails.
We have two mappings for the "/MAP" flag. The first does not care
whether there is a value and activates the GenerateMapFile boolean
setting. The second takes a value and puts it in the MapFileName
setting. The latter must treat the ":" as part of the flag.
This is similar to commit 8ae66bf4 (Fix optionally-valued booleans in VS
10 flag table, 2009-10-23).
The wording "Commands in the file are processed immediately as if they
were written in place of the include command" sounds as if some kind of
macro replacement is performed. This is not accurate. Update the
wording to describe behavior of the included code in terms of the
variable access scope.
Always populate the INTERFACE_LINK_LIBRARIES for interface
entries. Don't populate the old interface properties
matching (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?
if CMP0022 is NEW.
Because the INTERFACE_LINK_LIBRARIES property is now populated by
the target_link_libraries when operating on a static library,
make an equivalent change which populates the property with
the same value when the old link_libraries() command is used. This
silences the policy warning in that case.
This property is generated only for targets which have recorded
policy CMP0022 as NEW, and a compatibility mode is added to
additionally export the old interfaces in that case too.
If the old interfaces are not exported, the generated export files
require CMake 2.8.12. Because the unit tests use a version which
is not yet called 2.8.12, temporarily require a lower version.
This property replaces the properties which
match (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?, and is enabled
for IMPORTED targets, and for non-IMPORTED targets only with a policy.
For static libraries, the INTERFACE_LINK_LIBRARIES property is
also used as the source of transitive usage requirements content.
Static libraries still require users to link to all entries in
their LINK_LIBRARIES, but usage requirements such as INCLUDE_DIRECTORIES
COMPILE_DEFINITIONS and COMPILE_OPTIONS can be restricted to only
certain interface libraries.
Because the INTERFACE_LINK_LIBRARIES property is populated unconditionally,
we need to compare the evaluated result of it with the link implementation
to determine whether to issue the policy warning for static libraries. For
shared libraries, the policy warning is issued if the contents of
the INTERFACE_LINK_LIBRARIES property differs from the contents of the
relevant config-specific old LINK_INTERFACE_LIBRARIES property.
We support multiple commands per external project step by using
the COMMAND keyword. Document this behavior and show an example.
While at it, document that shell operators and current working
directory behavior is not defined.
CMake requires the top-level CMakeLists.txt to contain a direct call to
the project() command and will insert one if there is not. Document
this requirement since some authors have tried to use include() to load
a file calling the project command.
If a non-IMPORTED library is added to the INTERFACE_LINK_LIBRARIES
of a IMPORTED target, the non-IMPORTED target needs to become a
target dependency and link dependency of the consuming target.
This is already the case since commit 30962029 (Make targets depend
on the link interface of their dependees, 2012-12-26), and fixed in
the parent commit, so test that it works.
This was missing from commit 30962029 (Make targets depend on the
link interface of their dependees., 2012-12-26), which caused
only immeditate entries of the link interface to become target
depends.
Entries from the cmMakefile are processed and maintained similarly
to other include directories. The include_directories(SYSTEM)
signature affects all following targets, and all prior targets
in the same makefile.
Add to the brief documentation of the Visual Studio 10, 11, and 12
generators the corresponding VS product year. Clarify that VS11 is for
Visual Studio 2012, and VS12 is for Visual Studio 2013.
The line
set( ${basename}_LIBRARY )
removes the normal variable, but if the corresponding cached variable is
present then line
list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
uses that and fails. Replace the original line with
set( ${basename}_LIBRARY "" )
to set the normal variable to empty instead of unsetting it.
In CMakeTestFortranCompiler we build a test program using a Fortran 90
construct to check whether the compiler supports the language. Some
compilers have options to require explicit variable types. Fix the test
program to use an explicit variable type so it passes under such a
configuration.
Suggested-by: Neil Carlson <neil.n.carlson@gmail.com>