Fix setting classpath when encountering a jar argument to add_jar to
actually set the variable that is used to specify the classpath to
javac, instead of just uselessly appending the jar to
CMAKE_JAVA_INCLUDE_PATH (which is never used again at the point where it
is modified). Also, list jars so specified as dependencies of compiling
the java sources for the jar target.
Since commit e03f83f3 (ProcessorCount test: fix path to cmsysTestsCxx
executable, 2013-01-24) the directory references a target that is not
built when BUILD_TESTING is OFF. It makes no sense to add tests without
BUILD_TESTING anyway.
While at it, use add_subdirectory instead of subdirs to add CMakeTests.
According to XL C/C++ V9.0 documentation the default for -qpic/-qnopic
is platform-dependent. It won't hurt to add the option on platforms
where it is the default, so always add it when we want position
independent code.
d90f49b CTest: Fail early without PROJECT_BINARY_DIR (#14005)
2e1c2bd build_command: Fail early without CMAKE_MAKE_PROGRAM (#14005)
4e5cb37 Refactor RunCMake.build_command test to allow more cases
ab079ee Avoid crash when checking property compatibility without link info
92a2ab7 Avoid crash when checking property link dependencies without link info
The parent commit accidentally referenced QT_QMAKE_QMAKE_EXECUTABLE
which does not exist. Use QT_QMAKE_EXECUTABLE instead.
Reported-by: m.hergarden@euphoria-it.nl
The commit in qtbase 9dfba89c (Add implementations of QAIM::sibling in
public APIs., 2012-09-26) added a buggy implementation of sibling(), and
the commit f136701b (Use the base implementation of
QAbstractItemModel::sibling in QSIM., 2013-02-21) resolves it.
Workaround the bug for Qt releases that have it.
Do not use PROJECT_BINARY_DIR before it is defined. If it is not
defined when needed, fail with an error message suggesting that the
project() command be invoked first.
If CMAKE_MAKE_PROGRAM is not set fail with an error message instead of
crashing. Suggest calling project() or enable_language() first to
ensure that CMAKE_MAKE_PROGRAM is set.
Move the ErrorsOFF/ON common logic from CMakeLists.txt into an
ErrorsCommon file to allow other test cases to be added that do not use
the Errors test logic.
Commit 79568f95 (automoc: Add source file to target early to set the
linker language, 2013-02-20) changed automoc initialization to a two
step process. In the first step, the generated source file was added
to the target, which allows the link language to be determined.
However, this bypassed the check for the availability of Qt itself.
At build-time the automoc file could not be generated because the moc
tool was not available to create it.
The solution is to only add the automoc file to the target if Qt is
found.
Teach the compatibility check added by commit 042ecf04 (Add API to
calculate link-interface-dependent bool properties or error, 2013-01-06)
to return early if no link information is available. This avoids
crashing in a case that should fail with an error message.
Teach the isLinkDependentProperty helper added by commit e9879910 (Make
INTERFACE determined properties readable in generator expressions,
2013-01-19) to return early if no link information is available.
The CMake language implicitly flattens lists so a ";" in a list element
must be escaped with a backslash. List expansion removes backslashes
escaping semicolons to leave raw semicolons in the values. Teach
ExternalData_Add_Test and ExternalData_Expand_Arguments to re-escape
semicolons found in list elements so the resulting argument lists work
as if constructed directly by the set() command.
For example:
ExternalData_Add_Test(Data NAME test1 COMMAND ... "a\\;b")
ExternalData_Expand_Arguments(Data args2 "c\\;d")
add_test(NAME test2 COMMAND ... ${args2})
should be equivalent to
set(args1 "a\\;b")
add_test(NAME test1 COMMAND ... ${args1})
set(args2 "c\\;d")
add_test(NAME test2 COMMAND ... ${args2})
which is equivalent to
add_test(NAME test1 COMMAND ... "a;b")
add_test(NAME test2 COMMAND ... "c;d")
Note that it is not possible to make ExternalData_Add_Test act exactly
like add_test when quoted arguments contain semicolons because the CMake
language flattens lists when constructing function ARGN values. This
re-escape approach at least allows test arguments to have semicolons.
While at it, teach ExternalData APIs to not transform "DATA{...;...}"
arguments because the contained semicolons are non-sensical.
Suggested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Wihtout this, if qmake binary is from Qt5 the FindQt4 fails even though
the Qt4 version of qmake would be installed as qmake-qt4.
On Archlinux this is the case.
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Extend the range of valid target names with the + sign. This character
can commonly be used for target names, such as those containing 'c++'.
Add a test but skip it for Borland and Watcom tools which do not support
the character.
Suggested-By: Benjamin Kloster
In addition to adding the cupti library, find_local_library_first has
been renamed to cuda_find_local_library_first with a backward
compatibility macro to find_local_library_first. Also added
cuda_find_local_library_first_with_path_ext to handle different paths.
This adds a new variable, CUDA_SEPARABLE_COMPILATION, and two new
functions, CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS.
When CUDA_SEPARABLE_COMPILATION is specified then CUDA runtime objects
will be compiled with the separable compilation flag. These object
files are collected in a target named variable that can be used in
CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS.
When the command is invoked without an explicit build directory path we
compute it from the source directory path. When either the source or
build tree is the root of a Windows drive letter it will have a trailing
slash. Handle slashes consistently when substituting the current output
directory for the current source directory.
While at it, use cmSystemTools::IsSubDirectory instead of FindLastString
to verify that the source directory is a subdirectory.
Inspired-by: Graham Menhennitt <graham@menhennitt.com.au>
* Clarify accepted values of <LANG> suffix in CMAKE_COMPILER_IS_GNU<LANG>.
* Clarify fact that target property GENERATOR_FILE_NAME usually cannot be
used at configure time.
* Clarify that enable_language() can only be used in global scope of
top-level project using language.
* State that enable_language(... OPTIONAL) currently doesn't work.
* Document regular expression operator precedence.
The flag was added incorrectly by commit 9c3a6eb4 (Need -brtl when creating
shared libraries, 2003-05-16). According to "man ld" the -G option implies
"-brtl -bnortllib ...", -brtl implies "-brtllib", and -brtllib should only be
used for executables, not shared libraries. Therefore it is incorrect and
unnecessary to specify -brtl explicitly after -G.
Reported-by: Kevin Burge <kcburge@gmail.com>