Document the logic that parses for backward compatibility the old
variables that were used to control add_jar prior to named argument
support. In particular, document that the reason this logic exists is
for backward compatibility, and that new features do not need to add to
it.
This fixes#14210. In 2.8.10 CMakeDetermineCompiler.cmake was
modified (or added), and now the _INIT variable must not
be set to a list anymore, before it worked.
Alex
dc1d025 OS X: Add test for rpaths on Mac.
8576b3f OS X: Add support for @rpath in export files.
00d71bd Xcode: Add rpath support in Xcode generator.
94e7fef OS X: Add RPATH support for Mac.
RPATH support is activated on targets that have the MACOSX_RPATH
property turned on.
For install time, it is also useful to set INSTALL_RPATH to help
find dependent libraries with an @rpath in their install name.
Also adding detection of rpath conflicts when using frameworks.
That will allow things like this:
find_package(Qt4)
qt4_generate_moc(myfile.h moc_myfile.cpp TARGET foo) # Note, foo target doesn't
# exist until below.
add_library(foo ...)
The qt4_generate_moc call would use the INCLUDE_DIRECTORIES from
the foo target using generator expressions. Currently it reads
the INCLUDE_DIRECTORIES directory property, meaning that include_directories()
is required.
Support for the TARGET is also added to qt4_wrap_cpp, but not qt4_automoc,
as that is deprecated in favor of the AUTOMOC target property.
The moc tool reports failure if the Q_INTERFACES macro is used with
an argument which has not appeared with Q_DECLARE_INTERFACE, so that is
the basis of the unit test.
The command line arguments are now always written to a file, which is
passed to moc as the @atfile. This was already the case on Windows, but
now it is used everywhere. The reason for that is that it is not currently
possible to expand the list of includes from a target directly in
a add_custom_command invokation (though that may become possible in the
future). There is not a big disadvantage to using the file anyway on
unix, so having one code path instead of two is also a motivation.
This corresponds to the g++ and clang++
option -fvisibility-inlines-hidden on linux. On Windows with MinGW,
this corresponds to -fno-keep-inline-dllexport. That option is
not supported by clang currently.
This is initialized by CMAKE_<LANG>_VISIBILITY_PRESET. The target
property is used as the operand to the -fvisibility= compile option
with GNU compilers and clang.
In commit 5b9149e0 (FindBoost: Overhaul caching and search repeat
behavior, 2012-09-24) we refactored the internal library search to use a
_Boost_FIND_LIBRARY macro to wrap around find_library calls. However,
CMake macros re-process escape sequences when evaluating calls inside
the macro after substituting placeholders (a historical bug). In order
to avoid escape sequences, convert backslashes to forward slashes before
passing arguments to the _Boost_FIND_LIBRARY macro.
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 Qt 5.1, Qt5::Core has a INTERFACE_QT_MAJOR_VERSION property
of '5', and since CMake 2.8.11, Qt4::QtCore has an
INTERFACE_QT_MAJOR_VERSION of '4'. This was introduced in
commit 4aa10cd6 (FindQt4: Set the INTERFACE_QT_MAJOR_VERSION for
Qt4::QtCore, 2013-03-16), to produce an error if Qt 4 and Qt 5
are erroneously used by the same target. This can also be used
however to determine the Qt major version, and therefore the
particular moc executable to use during automoc steps. This means
that targets in a single buildsystem can use a selection of Qt 4
and Qt 5, and still take advantage of the CMAKE_AUTOMOC feature
without conflicting.
The ExternalData_LINK_CONTENT option tells ExternalData to convert real
data files it finds into content links and to "stage" the original
content in a ".ExternalData_<algo>_<hash>" file. However, after a data
object has been staged it is possible that a user-provided pattern in
the "REGEX:" option will later match the staged object file. We must
not process staged object files even when a user pattern matches them.
Fix the implementation to not match a staged object file as a normal
data file for conversion. Extend the RunCMake.ExternalData test to
cover this case.
Modify FindProtobuf.cmake to find the pthread library on UNIX platforms,
and to add the same to PROTOBUF_LIBRARIES, as this is a link dependency
of libraries using the protobuf headers.
The variables in this module are used to configure a header file
with defines whose name depends on the name of the target.
As valid names of targets may be invalid for use as defines, convert
the names of the defines used to C identifiers first. This is already
done in C++ code for the DEFINE_SYMBOL property.
This is not as simple as ensuring that the BASE_NAME is a C identifier,
because most of the define names are configurable, and because use of
a BASE_NAME which is not a C identifier, such as 4square can become a
C identifier by specifying a prefix in the generate_export_header
macro.
The significant issue with MODULEs is that on Windows, the exported
symbols must be dllexported and they are not imported.
In other export macro implementations this is done by defining an
export macro outside of any ifdef which depends on definitions set
on the command line. However, with cmake we already expect the
DEFINE_SYMBOL to be defined, so the regular EXPORT macro can be
used by such plugins.
Teach CMakeParseImplicitLinkInfo to convert the CMAKE_LINKER file name
to a regular expression that matches only the original name. Escape
special characters like '+' so they are not treated as regex syntax.
Extend the ImplicitLinkInfoTest to test handling of a CMAKE_LINKER value
with many special characters.