In commit 236133e7 (Handle targets in the LINK_LIBRARIES of try_compile,
2013-02-09) an error return case was added without closing the file in
progress. Add the missing fclose() call.
Spotted by sevenhill.
In commit 0c727b90 (install(EXPORT): Force absolute paths for usr-move,
2013-03-08) and commit d4774140 (configure_package_config_file: force
absolute paths for usr-move, 2013-01-24) we supported Linux
distributions implementing the "/usr move" by assuming that installation
to (/usr)?/lib(64)? represents a non-relocatable system package.
When cross-compiling one may prepare a package for installation into a
system location on a target machine but install the package files on the
*host* machine inside another path for use with CMAKE_FIND_ROOT_PATH.
In this case the package development files must still be relocatable.
Handle "/usr move" with a new approach that works with relocatable
files. Teach configure_package_config_file and install(EXPORT) to
generate special logic in a package configuration file or targets file
for installation under (/usr)?/lib(64)?. Teach the file to recognize
when it is loaded through a symlink that refers to the same realpath as
its original install destination. In such a case, use the original
install prefix. Otherwise, compute the prefix relative to the current
file location to make it relocatable.
In VS IDE generators add a pre-build event to perform automoc instead of
using a separate custom target. This reduces the number of targets in the
.sln that need to be loaded by the IDE.
This also works around a VS 11 bug as discussed in issue 13900.
Suggested-by: Hauke Heibel <hauke.heibel@gmail.com>
When called with a non-existent LHS target name the user may be trying
to add file-level dependencies. Clarify the error message to explain
the difference between target-level and file-level dependencies. Point
the reader at the commands and options needed for the latter.
Using XXX as name of the package is ambiguous, since it can be
interpreted as "ALLUPPERCASE" and also as "ExactCase (if the name
is already ALLUPPERCASE)".
After extensive discussion there is the conclusion that ExactCase
is intended, so using a CamelCased name makes that more obvious.
Alex
Modify add_jar to (partly) use cmake_parse_arguments, and to require
using the named argument list INCLUDE_JARS to specify jar files (or jar
targets) to use as dependencies when creating a jar. This preserves the
ability to have such, while restoring the historic behavior that jar
files listed as sources are ignored. (The code now explicitly ignores
them, however, rather than adding them to an unused local variable, so
that it is more clear that nothing is being done with them.)
In GNU.cmake, -isystem is not used if APPLE is set. However, Clang has
pretty much always supported -isystem, so we should always use it.
In the future, GNU.cmake should do a version check to see if -isystem is
supported.