CMAKE_SYSTEM_PROCESSOR is not guaranteed to be defined (per
http://www.cmake.org/Wiki/CMake_Cross_Compiling), and when cross
compiling where it happens to be undefined, this module was broken.
Reviewed-by: Rolf Eike Beer <eike@sf-mail.de>
Previously only the CMAKE_{C,CXX}_FLAGS_<CONFIG> flags were inspected
for relevant flags when compiling the intermediate link file. We need
to also consider the configuration agnostic flags, CMAKE_{C,CXX}_FLAGS
as well.
AppleClang does not support the cxx_thread_local feature, even
though it is based on a Clang version which does support the
feature.
http://stackoverflow.com/a/23850891/2428389
A possible reason for that is that thread_local might be used as
a variable in existing Apple SDK headers.
Extend the WriteCompilerDetectionHeader module to generate a define
for that feature with portability fallbacks. For the avoidance of
making it easy to write code which looks correct but which has odd
runtime behavior, don't set the define symbol at all if no
equivalent keyword is known.
The SunPro Fortran compiler uses "-F" instead of "-E" to request
preprocessing. The output does not go to stdout so use "-o" to
specify the output file.
This fixes the guess originally made by commit b6b37e30 (Makefile: Add
assembly and preprocessed targets for Fortran, 2014-11-05).
bb83cdaa Help: Add notes for topic 'AppleClang-5.1-features'
bd6b42c1 Features: Record for AppleClang 5.1
b341799e Tests: Fix RunCMake.CompileFeatures test NonValidTarget2 case
Fix capitalization of Qt4_FOUND variable when setting it to false in
this case. This caused find_package(Qt4) to appear successful when it
was not. Note that the legacy QT4_FOUND variable is unconditionally
overwritten at the end of the file with the value of Qt4_FOUND.
If this option is enabled, the test step is created with the
EXCLUDE_FROM_MAIN option, and if TEST_BEFORE_INSTALL is enabled, the
install step does not depend on the test step.
This means that the test step is never executed, unless the test target
is explicitly created by calling ExternalProject_Add_StepTarget, or by
passing it with the STEP_TARGETS option, or with the EP_STEP_TARGETS
directory property.
The FindXerces module was added in commit v3.1.0-rc1~155^2 (FindXerces:
New module to find Apache Xerces-C++, 2014-08-17). However, there are
two implementations of Xerces, one in C++:
http://xerces.apache.org/xerces-c/
and one in Java:
http://xerces.apache.org/xerces-j/
Rename FindXerces to FindXercesC to clarify that it is about the C++
implementation.
While at it, add the missing CMake 3.1 release note about this module.
Suggested-by: Erik Sjölund <erik.sjolund@gmail.com>
When compiling the ABI detection test project, do not override
CMAKE_EXE_LINKER_FLAGS completely. The normally selected value of this
variable may influence how the link is done and may be needed to be
representative of how the calling project will be built. Instead pass a
variable that try_compile will reference as additional flags. Leave
this behavior of try_compile undocumented for now.
Revert the feature added by commit v3.1.0-rc1~420^2~2 (FindOpenGL:
Provide imported targets for GL and GLU, 2014-05-31). Unfortunately it
does not work on Windows because the full path to each library file is
not actually known. The IMPORTED_LOCATION of an imported target must be
a full path, but OPENGL_gl_LIBRARY is just 'opengl32' on Windows because
the actual library file is in some implicit link directory that we may
know know.
More infrastructure will be needed in CMake to allow a name-only
imported library. Until that exists, we will not be able to provide
imported targets in FindOpenGL.
In commit v3.1.0-rc1~640^2~5 (Clean up usage of if(... MATCHES regex)
followed string(REGEX REPLACE regex), 2014-04-06) we accidentally broke
logging of the implicit library detection. Restore use of the
intermediate 'lib' variable so that the log message is constructed
properly.
Reported-by: Bill Somerville <bill@classdesign.com>
In commit 079e8469ab (... OpenGL always needs X11 on Unix, 2002-09-05)
the FindOpenGL module was taught to search for X11 as a dependency of
the OpenGL library. This was done without a detailed explanation, and
the dependency should not be explicitly needed because OpenGL headers
should not expose applications to X11 APIs directly.
Unfortunately the only way to know if anything legitimately depends on
this behavior (perhaps in static library cases) is to simply remove it
and wait for issues to be reported. If so, then we can add some kind of
compatibility setting for this later. Add a release note to draw
attention to this change.
Reported-by: Dainius "GreatEmerald" Masiliūnas <pastas4@gmail.com>
Some applications only need the OpenSSL crypto library and want to avoid
linking against the SSL library. Set OPENSSL_CRYPTO_LIBRARY and
OPENSSL_SSL_LIBRARY in the code paths that do not need to find them
separately, and document them publicly. This allows applications to be
more specific when linking against OpenSSL.
f327a9fd Merge branch 'default-lang-dialect' into step2
36bb100e Fix the test for running the CxxDialog unit test.
a3d0ae17 Features: Fix the default C dialect for Clang and GNU.
49e2b689 Features: Fix references to CXX compiler version in Clang-C.cmake.
7565ab2c Features: Test the CXX compiler only if it has features.
These all test the same variable for different values, so only one of them can
ever be true. This also allows to completely remove one variable that only
flagged if one of the conditions matched.
The __STDC_VERSION__ macro may be defined or not depending on the
implementation dialect of C. Test that it is defined before testing
its value.
The CXX tests do not need such a change because they define __cplusplus
in all dialects.
Extend the write_compiler_detection_header interface to allow
specifying a location for supplementary files, and getting the
list of resulting files as a variable.
Clang 3.4 uses C99 by default, and Clang 3.6 uses C11 by default:
http://thread.gmane.org/gmane.comp.compilers.clang.devel/39379
GNU 4.9 uses C90 by default, and GNU 5.0 uses C11 by default:
https://gcc.gnu.org/gcc-5/changes.html
Test that the default compiler settings result in the expected dialect
macros being defined for both C and CXX. Remove the unused main.c
file from the CompileFeatures unit test.
fa1a066a Merge branch 'backport-fix-CMP0054-MSVC' into fix-CMP0054-MSVC
4d52cd36 Avoid if() quoted auto-dereference when checking for "MSVC"
543c4304 Avoid if() quoted auto-dereference when checking for "MSVC"
OS X provides a stub 'java' to inform callers that Java is not present.
When checking the 'java -version' output, look for such a message and if
found pretend 'java' was not found.
Suggested-by: Sean McBride <sean@rogue-research.com>
Improve the fix from commit v2.8.9~136^2 (CPackRPM: avoid leakage of RPM
directive from one component to another, 2012-06-05) to clean up more
temporary variables.
Reviewed-by: Domen Vrankar <domen.vrankar@gmail.com>
Since commit b22e2de8 (HPUX support, 2001-11-05) the FindCurses
module searches for a 'cur_colr' library, but that is not needed
anymore. AFAICT, the cur_colr package was introduced in HP-UX 10.00 and
marked as deprecated in 10.30 by X/OPEN curses (which replaced the even
older HP curses in 10.10).
In order to use cur_colr after 10.10 you should use the
/usr/include/curses_colr when compiling. Since FindCurses doesn't even
search that path the headers cannot possibly match out of the box. If
users want cur_colr they can set the cache entries by hand.
There is no 64-bit version of cur_colr in 11.11PA and it will be gone
completely in 11.31PA:
http://h21007.www2.hp.com/portal/download/files/unprot/STK/HPUX_STK/impacts/i964.html
It is simplest to drop cur_colr support from FindCurses since it was
only partially implemented anyway.
The external project's build process may generate byproducts on which
other rules in the driving project's build later depend. Provide a way
for the driving project to specify what byproducts it expects to be made
available by the custom commands that drive the external project.
32b91b9e Features: Run GNU feature tests with std=c++14 when available.
82c283f9 Features: Use the correct dialect flag when recording features.
b18155b7 Features: Reorder the GNU C dialect feature tests
e68d5c60 Features: Split the Clang testable features to a separate file.
3c497f11 Help: Add notes for topic 'ExternalProject_UPDATE_DISCONNECTED'
aba5cec6 ExternalProject: Add unit tests for UPDATE_DISCONNECTED
3f606fa7 ExternalProject: Add UPDATE_DISCONNECTED option
c0b749cf ExternalProject: Always add a command to a step
Features are currently recorded accidentally for all versions of
AppleClang > 3.4 (I have no idea how that relates to upstream
Clang). Presumably that version has the features which are
accidentally recorded, but in the future features will be
recorded initially for only AppleClang >= 5.1, which would
appear as a feature regression.
Commit v3.1.0-rc1~635^2~11 (Don't load Clang-CXX from
AppleClang-CXX., 2013-11-11) ajusted the logic for the CXX
language. Make a similar change for the C language.
Add support for Sun/Uniforum/GNU gettext libintl. This belongs in CMake
rather than upstream because:
* There are multiple upstreams (Sun, GNU).
* It may or may not be in the glibc C library depending
upon the platform and build options used.
Although we already have a FindGettext module, that is for the tools.
This module is for the library, and is independent because it's
perfectly OK to use libintl without the gettext tools (and vice versa),
and they might not all be found. Add cross references between the two
modules in notes to make the relationship clearer.
The change in commit v3.1.0-rc1~85^2 (ExternalProject: Fix download
retry logic, 2014-09-13) dropped the file(DOWNLOAD) EXPECTED_HASH
argument. This prevents file(DOWNLOAD) from skipping the download if
the output file already exists with the proper hash. Restore this check
with explicit code in the download script.
Reported-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
b6b37e30 Makefile: Add assembly and preprocessed targets for Fortran
0842b084 Makefile: Refactor checks for lang-specific targets and export compile cmds
Since commit v3.1.0-rc1~1^2~1 (Xcode: Fix compiler id detection for iOS
tools, 2014-10-22) our compiler id detection project sets the product
type to 'com.apple.product-type.bundle.unit-test'. This causes the Ld
command line on which we match the path to the compiler to have a
'CompilerIdC.xctest/' component. The commit updated our regex to match
this, but placed it before the extra './' component that Xcode 5.0 and
below produce. Xcode <= 5.0 prints '/./CompilerIdC.xctest/', so switch
the order of the two components in the regex to match it.
If UPDATE_DISCONNECTED is set, the update step is not executed
automatically when building the main target. The update step can still
be added as a step target and called manually. This is useful if you
want to allow to build the project when you are disconnected from the
network (you might still need the network for the download step).
This is disabled by default.
The directory property EP_UPDATE_DISCONNECTED can be used to change
the default value for all the external projects in the current
directory and its subdirectories.
Some generators (i.e. Xcode) will not generate a file level target if
no command is set, and therefore the dependencies on this target will
be broken.
This patch sets an empty echo command that does nothing to avoid this
issue.
The ExternalProject_Add_StepDependencies function add some dependencies
for some external project step.
The syntax is:
ExternalProject_Add_Step_Dependencies(<name> <step> [target1 [target2 [...]]])
This function takes care to set both target and file level dependencies,
and will ensure that parallel builds will not break.
It should be used instead of add_dependencies() when adding a dependency
for some of the step targets generated by ExternalProject. See also:
http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/8680/focus=8926
When adding step targets using ExternalProject_Add_StepTargets, the
STEP_TARGETS argument or the EP_STEP_TARGETS property, ExternalProject
sets all the dependencies for the main project to that target. Due to
this, the update target cannot be used without downloading and building
all the dependencies.
In order to be able to add step targets that do not depend on other
external projects, this patch adds:
* An optional "NO_DEPENDS" argument to the
ExternalProject_Add_StepTargets function. If this argument is set,
then no dependencies are set for the target (file dependencies will
still be set).
* A new argument INDEPENDENT_STEP_TARGETS to the ExternalProject_Add
function and a new directory property EP_INDEPENDENT_STEP_TARGETS that
behave like STEP_TARGETS and EP_STEP_TARGETS, but cause the
ExternalProject_Add_StepTargets to be called with the NO_DEPENDS
argument.
1531df2b configure_file: Warn about unknown arguments
4abbb140 Qt4: Fix configure_file call to use COPYONLY, not COPY_ONLY
bd7ba8e2 KWSys: Fix configure_file call to use COPYONLY, not COPY_ONLY
e9282782 Help: Fix configure_file call to use COPYONLY, not COPY_ONLY
Cleanup of Windows-wcl386.cmake in commit v3.1.0-rc1~693^2 (Watcom:
Cleanup Windows-wcl386 configuration, 2014-04-01) also introduced use of
the 'symfile' link option but did not mention it in the commit message.
There is no way to set the symbol file name of a target, so it is better
to revert that change. It is easy to run 'wstrip *' if the symbols need
to be stripped, but it is very difficult to get the right names for the
.sym files to install with debug/rel_with_deb_info configurations.
609037f4 ExternalProject: Add unit tests for CMAKE_CACHE_DEFAULT_ARGS
98cdb658 ExternalProject: Add CMAKE_CACHE_DEFAULT_ARGS arguments
36cf8a1e Tests/Tutorial: Fix when USE_MYMATH is OFF
This argument allows to set default arguments that are written in the
initial cache file, but that are not forced, and therefore allows the
user to change these values later (CMAKE_ARGS and CMAKE_CACHE_ARGS
always overwrite the values).
Also add some documentation to explain the differences between these 3
arguments.
Extend ExternalProjectLocal test to cover CMAKE_CACHE_DEFAULT_ARGS.
With CMAKE_C_COMPILER=clang and CMAKE_C_FLAGS='-Wall -Werror', this test
breaks with -Werror,-Wuninitialized. Fix this by getting rid of the
temporary variable.