The commit "Consider link dependencies for link language" taught CMake
to propagate linker language preference from languages compiled into
libraries linked by a target. It turns out this should only be done for
some languages, such as C++, because normally the language of the
program entry point (main) should be used.
We introduce variable CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES to tell
CMake whether a language should propagate its linker preference across
targets. Currently it is true only for C++.
This teaches CMake to detect implicit link information for C, C++, and
Fortran compilers. We detect the implicit linker search directories and
implicit linker options for UNIX-like environments using verbose output
from compiler front-ends. We store results in new variables called
CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES
CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES
The implicit libraries can contain linker flags as well as library
names.
The commit "Do not compute link language for LOCATION" was wrong. The
variables
CMAKE_STATIC_LIBRARY_PREFIX_Java
CMAKE_STATIC_LIBRARY_SUFFIX_Java
are used for building Java .jar files. This commit re-enables the
feature and documents the variables:
CMAKE_EXECUTABLE_SUFFIX_<LANG>
CMAKE_IMPORT_LIBRARY_PREFIX_<LANG>
CMAKE_IMPORT_LIBRARY_SUFFIX_<LANG>
CMAKE_SHARED_LIBRARY_PREFIX_<LANG>
CMAKE_SHARED_LIBRARY_SUFFIX_<LANG>
CMAKE_SHARED_MODULE_PREFIX_<LANG>
CMAKE_SHARED_MODULE_SUFFIX_<LANG>
CMAKE_STATIC_LIBRARY_PREFIX_<LANG>
CMAKE_STATIC_LIBRARY_SUFFIX_<LANG>
Instead of making separate, repetitive entries for the _<LANG> variable
documentation, we just mention the per-language name in the text of the
platform-wide variable documentation. Internally we keep undocumented
definitions of these properties to satisfy CMAKE_STRICT mode.
The LOCATION property requires the full file name of a target to be
computed. Previously we computed the linker language for a target to
look up variables such as CMAKE_SHARED_LIBRARY_SUFFIX_<LANG>. This led
to locating all the source files immediately instead of delaying the
search to generation time. In the future even more computation will be
needed to get the linker language, so it is better to avoid it.
The _<LANG> versions of these variables are undocumented, not set in any
platform file we provide, and do not produce hits in google. This
change just removes the unused feature outright.
HP-UX uses both .sl and .so as extensions for shared libraries. This
teaches CMake to recognize .so shared libraries so they are treated
properly during link dependency analysis.
This moves the version numbers into an isolated configured header so
that not all of CMake needs to rebuild when the version changes.
Previously we had spaces, dashes and/or the word 'patch' randomly chosen
before the patch number. Now we always report version numbers in the
traditional format "<major>.<minor>.<patch>[-rc<rc>]".
We still use odd minor numbers for development versions. Now we also
use the CCYYMMDD date as the patch number of development versions, thus
allowing tests for exact CMake versions.
This creates variable CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES to
specify implicit include directories on a per-language basis. This
replaces the previous platform-wide variable. It is necessary to
avoid explicit specification of -I/usr/include on some compilers
(such as HP aCC) because:
1.) It may break ordering among system include directories defined
internally by the compiler, thus getting wrong system headers.
2.) It tells the compiler to treat the system include directory
as a user include directory, enabling warnings in the headers.
See issue #8598.
This creates the variable CMAKE_VERSION containing the full version of
cmake in "major.minor.patch" format. It is particularly useful with the
component-wise version comparison provided by the if() command.
The CMAKE_<CONFIG>_POSTFIX variable and <CONFIG>_POSTFIX property were
not documented. This updates the CMAKE_DEBUG_POSTFIX and DEBUG_POSTFIX
documentation to refer to the more general variable/property. It also
clarifies that the variable is used as the property default only for
non-executable targets. See issue #7868.
Some native build tools, particularly those for cross compiling, may
have a limit on the length of the full path to an object file name that
is lower than the platform otherwise supports. This change allows the
limit to be set by the project toolchain file through the variable
CMAKE_OBJECT_PATH_MAX.
CMAKE[_SYSTEM]_(LIBRARY|PROGRAM|INCLUDE|PREFIX)_PATH variables
-moved CMAKE_CROSSCOMPILING from "Variables that modify behaviour" to
"variables that Provide Information", since it should be used only for
testing whether we are currently in cross compiling mode, not for switching
between the modes.
Alex
- Policy is WARN by default so projects will build
as they did in 2.4 without user intervention
- Remove CMAKE_LINK_OLD_PATHS variable since it was
never in a release and the policy supercedes it
- Report target creation backtrace in warning message
since policy should be set by that point
- Use a response file when enabled by
CMAKE_<LANG>_USE_RESPONSE_FILE_FOR_OBJECTS
- Enable for C and CXX with cl (MSVC)
- Enable for Fortran with ifort (Intel Fortran)
- Move runtime path ordering out of cmComputeLinkInformation
into its own class cmOrderRuntimeDirectories.
- Create an instance of cmOrderRuntimeDirectories for runtime
path ordering and another instance for dependent library
path ordering.
- Replace CMAKE_DEPENDENT_SHARED_LIBRARY_MODE with explicit
CMAKE_LINK_DEPENDENT_LIBRARY_FILES boolean.
- Create CMAKE_LINK_DEPENDENT_LIBRARY_DIRS boolean.
- Create variables to specify -rpath-link flags:
CMAKE_SHARED_LIBRARY_RPATH_LINK_<LANG>_FLAG
CMAKE_EXECUTABLE_RPATH_LINK_<LANG>_FLAG
- Enable -rpath-link flag on Linux and QNX.
- Documentation and error message updates
- Split IMPORTED_LINK_LIBRARIES into two parts:
IMPORTED_LINK_INTERFACE_LIBRARIES
IMPORTED_LINK_DEPENDENT_LIBRARIES
- Add CMAKE_DEPENDENT_SHARED_LIBRARY_MODE to select behavior
- Set mode to LINK for Darwin (fixes universal binary problem)
- Update ExportImport test to account for changes
- This is purely an implementation improvement. No interface has changed.
- Create cmComputeLinkInformation class
- Move and re-implement logic from:
cmLocalGenerator::ComputeLinkInformation
cmOrderLinkDirectories
- Link libraries to targets with their full path (if it is known)
- Dirs specified with link_directories command still added with -L
- Make link type specific to library names without paths
(name libfoo.a without path becomes -Wl,-Bstatic -lfoo)
- Make directory ordering specific to a runtime path computation feature
(look for conflicting SONAMEs instead of library names)
- Implement proper rpath support on HP-UX and AIX.