Commit Graph

114 Commits

Author SHA1 Message Date
Brad King 47dd761379 Merge branch 'doc-CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT' into release 2016-11-21 11:52:32 -05:00
Brad King df9fea7f49 Help: Document CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT variable
This variable documentation was simply missing.

Suggested-by: Craig Scott <craig.scott@crascit.com>
2016-11-21 11:52:00 -05:00
Brad King ea8eba0bbf Android: Add CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE
Expose the binutils' machine name (typically used as a prefix on the
tool names) publicly.  This is expected to match the `gcc -dumpmachine`
value.

Suggested-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
2016-11-18 10:03:15 -05:00
Brad King 0d3eb139e1 Android: Add CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG variable
The NDK provides prebuilt toolchain files in directories named for the
host architecture.  The NDK build system calls this `HOST_TAG`.
Expose the value publicly for use by clients that need to pass it
to external tools.

Suggested-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
2016-11-18 10:03:07 -05:00
Brad King ded15f26b8 Merge topic 'codelite-organize-by-target'
cbe48879 CodeLite: Optionally use targets to create (sub)project files
2016-09-27 08:22:53 -04:00
Minze Zwerver cbe4887927 CodeLite: Optionally use targets to create (sub)project files
The basic codelite generator creates .project files based on the
`project()` stanza.  Add a `CMAKE_CODELITE_USE_TARGETS` option to use
the targets instead.
2016-09-26 13:40:38 -04:00
Brad King b35568f3f9 Xcode: Add option to set Swift language version
Create a new CMAKE_Swift_LANGUAGE_VERSION variable to specify the
SWIFT_VERSION attribute in a generated Xcode project.  Ideally this
would be a `<LANG>_STANDARD` property but since Swift support is
very minimal we should reserve that property for more complete
treatment later.

Issue: #16326
2016-09-26 08:46:23 -04:00
Pierluigi Taddei 31be918b0b find_package: Optionally sort globbed directories in a meaningful order
Add `CMAKE_FIND_PACKAGE_SORT_{ORDER,DIRECTION}` variables to specify
sort order and direction.

When multiple package with the same name have been found in the same
location sorting option can be used to force a specific version to be
loaded (e.g. libA_1.12.0 instead of libA_1.1.0).  Currently sorting by
NAME and by NATURAL order have been implemented.

Natural ordering makes use of the `strverscmp(3)` ordering.
2016-09-15 13:35:25 -04:00
Brad King a6d3f5418c Help: Clarify documentation of CMAKE_COMPILER_IS_GNU{CC,CXX,G77}
Closes: #16308
2016-09-14 10:09:39 -04:00
Ruslan Baratov 3e8615ef9c Document XCODE variable 2016-08-31 14:17:51 +03:00
Brad King 7b637ebdc9 Android: Add `ANDROID` variable to indicate the target
Allow projects to use `if(ANDROID)` to condition their Android-specific
code paths.
2016-08-23 13:10:51 -04:00
Brad King 6b84df8da9 Help: Document cross compiling for Android
CMake now supports cross compiling for Android using the NDK or a
standalone toolchain.  Document the associated variables and how how to
write toolchain files for Android.
2016-08-23 12:53:10 -04:00
Brad King 8a98cf6432 Honor CMAKE_*_LINKER_FLAGS[_<CONFIG>]_INIT set in toolchain files
Document these variables.

Change our convention for setting these variables from:

    set(CMAKE_EXE_LINKER_FLAGS_INIT "...")

to

    string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ...")

so that any value previously set by a toolchain file will be used.
2016-07-14 15:47:32 -04:00
Brad King a66004bee0 Honor CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in toolchain files
Document these variables.

Change our convention for setting these variables from:

    set(CMAKE_C_FLAGS_INIT "...")

to

    string(APPEND CMAKE_C_FLAGS_INIT " ...")

so that any value previously set by a toolchain file will be used.

Automate the conversion with:

    sed -i 's/set *(\(CMAKE_\(C\|CXX\|Fortran\|RC\|ASM\|${[^}]\+}\)_FLAGS\(_[^_]\+\)\?_INIT \+"\)/string(APPEND \1 /' \
      Modules/Compiler/*.cmake Modules/Platform/*.cmake

and follow up with some manual fixes (e.g. to cases that already
meant to append).  Also revert the automated changes to contexts
that are not protected from running multiple times.
2016-07-06 10:13:31 -04:00
Bill Hoffman 96242f8022 Add options to run `ldd -u -r` as a "link-what-you-use" tool
Create a LINK_WHAT_YOU_USE target property and corresponding
CMAKE_LINK_WHAT_YOU_USE variable to enable this behavior.
Extend link commands by running `ldd -u -r` to detect shared
libraries that are linked but not needed.
2016-06-17 10:56:40 -04:00
Brad King d256ba078a try_compile: Optionally forward custom platform variables to test project
Add a `CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` variable to specify a list
of custom variables to be forwarded to a `try_compile` test project.
This will be useful for platform information modules or toolchain files
to forward some platform-specific set of variables from the host project
(perhaps set in its cache) to the test project so that it can build the
same way.
2016-05-25 09:36:19 -04:00
Brad King c13408279f Add a variable to specify language-wide system include directories
Create a `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` variable to specify
system include directories for for `<LANG>` compiler command lines.
This plays a role for include directories as the existing
`CMAKE_<LANG>_STANDARD_LIBRARIES` variable does for link libraries.
2016-05-25 09:30:31 -04:00
Brad King 7807b3a9db Help: Document CMAKE_<LANG>_STANDARD_LIBRARIES variable
Also drop documentation of non-existent CMAKE_STANDARD_LIBRARIES
variable.
2016-05-24 11:40:25 -04:00
Nicolas Despres 8a862a4d4b Ninja: Support embedding of CMake as subninja project
Add a `CMAKE_NINJA_OUTPUT_PATH_PREFIX` variable.  When it is set, CMake
generates a `build.ninja` file suitable for embedding into another ninja
project potentially generated by an alien generator.
2016-05-17 09:34:12 -04:00
Brad King de3c7bd799 Merge topic 'AddDocumentationForEclipseVariables'
7b3a1069 Help: Document Eclipse-generator related variables (#15827)
2016-04-18 08:57:32 -04:00
Alex Neundorf 7b3a1069bf Help: Document Eclipse-generator related variables (#15827) 2016-04-18 08:56:19 -04:00
Stafen Teleman 5dc6cfd6ea Solaris: Add a CMAKE_HOST_SOLARIS variable (#16061) 2016-04-15 13:25:45 -04:00
Daniel Pfeifer 5e62444cff Add options to run clang-tidy with the compiler
Create a <LANG>_CLANG_TIDY target property (initialized by a
CMAKE_<LANG>_CLANG_TIDY variable) to specify a clang-tidy command line
to be run along with the compiler.
2016-04-13 09:56:10 -04:00
Ben Boeckel 06b310b5d5 cmCTestGIT: add an option to initialize submodules on update
Currently, CTest will not initialize any submodules within the already
checked out source tree. Add an option to do so. The use case for not
doing so is that some submodules may not be necessary for the current
test and keeping network usage down may be important.
2016-04-01 15:50:31 -04:00
Attila Krasznahorkay b1e1aa1e6a Makefile: Optionally scan only source and build trees for dependencies
Add a `CMAKE_DEPENDS_IN_PROJECT_ONLY` variable to activate the behavior.
2016-03-22 16:04:15 -04:00
Brad King b42866a34a Drop Visual Studio 6 generator
This generator has been deprecated since CMake 3.3.  Remove it.
Update documentation, modules, and tests to drop content specific
to this generator.
2016-03-09 09:42:18 -05:00
Brad King 7f1bd9fe69 try_compile: Add option to control type of target
Create a `CMAKE_TRY_COMPILE_TARGET_TYPE` option to specify use
of `add_library(... STATIC ...)` for the generated test project.
This will be useful for cross-compiling toolchains that cannot
link a binary without custom flags or scripts.
2016-02-19 14:07:38 -05:00
Sebastian Schuberth 6e92f7b2de Help: Document the CMAKE_EXPORT_COMPILE_COMMANDS variable 2016-01-15 15:04:33 -05:00
Ruslan Baratov 565d080a9a Xcode: Add support for combined install on iOS
This patch solves the problem of installing both: Device and Simulator
libraries on iOS. Before only one of them was installed.

If the IOS_INSTALL_COMBINED property is set on a target, a
special install hook will be activated which builds the corresponding
target and combines both at the install location.

The original patch was contributed by Ruslan Baratov, and polished by
Gregor Jasny.
2015-12-10 22:36:12 +01:00
Gilles Khouzam 3f077996f5 VS: Add support for selecting the Windows 10 SDK (#15670)
Teach the VS 2015 generator to produce a WindowsTargetPlatformVersion
value.  Use the CMAKE_SYSTEM_VERSION to specify the version and if not
set choose a default based on available SDKs.  Activate this behavior
when targeting Windows 10.

Co-Author: Brad King <brad.king@kitware.com>
2015-10-02 09:53:25 -04:00
Brad King fcd9f85660 Merge topic 'ctest-variable-docs'
4da5a227 Help: document CTEST_CUSTOM_* variables
70c0cc72 ctest_read_custom_files: mention that ctest does this automatically
71c67e83 CTEST_CUSTOM_*: treat variables as lists
936a95d4 CTestCoverageCollectGCOV: replace tabulators
2015-09-22 10:47:05 -04:00
Ben Boeckel 4da5a22774 Help: document CTEST_CUSTOM_* variables 2015-09-22 10:44:52 -04:00
Chuck Atkins 9784af1b50 CMP0065: Restrict the use of CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS
This new policy restricts the addition of the shared library link flags
to executables only when the ENABLE_EXPORTS property is set to True.
2015-09-21 10:12:13 -04:00
Brad King 6e3151f6cc CTest: Document and test custom output size settings
Add documentation and tests for the existing

 CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE
 CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE

CTest variables.
2015-09-18 11:32:05 -04:00
Chuck Atkins 675ef165f2 Allow LINK_SEARCH_{START,END}_STATIC props to have default values.
Use the CMAKE_LINK_SEARCH_START_STATIC and CMAKE_LINK_SEARCH_END_STATIC
variables to initialize the LINK_SEARCH_START_STATIC and
LINK_SEARCH_END_STATIC target properties respectively.
2015-08-13 10:34:44 -04:00
Brad King a5412fbab4 Merge topic 'ctest-change-id'
601ff0ec CTest: Optionally add a ChangeId attribute on XML Site tags
2015-07-17 10:36:17 -04:00
Zack Galbreath 601ff0ec55 CTest: Optionally add a ChangeId attribute on XML Site tags
Add variable CTEST_CHANGE_ID to configure the setting.  This allows
CTest clients to give CDash information about what change is being
tested so that CDash can take actions to report the results (e.g. to a
pull request page).
2015-07-17 10:26:28 -04:00
Mikhail Filimonov 8c0afaf450 VS: Add more Nsight Tegra generator Android property settings
Extend the Nsight Tegra project generator to add bunch of properties
with the backing variables to fine-tune the generated projects.

Add target properties that map to all "Configuration" PropertyGroups for
each configuration:

* ANDROID_ARCH
* ANDROID_STL_TYPE

Add target properties that map to the AntBuild section of vcxproj files:

* ANDROID_ANT_ADDITIONAL_OPTIONS
* ANDROID_ASSETS_DIRECTORIES
* ANDROID_JAR_DEPENDENCIES
* ANDROID_JAR_DIRECTORIES
* ANDROID_JAVA_SOURCE_DIR
* ANDROID_NATIVE_LIB_DEPENDENCIES
* ANDROID_NATIVE_LIB_DIRECTORIES
* ANDROID_PROCESS_MAX
* ANDROID_PROGUARD
* ANDROID_PROGUARD_CONFIG_PATH
* ANDROID_SECURE_PROPS_PATH
* ANDROID_SKIP_ANT_STEP

Reviewed-by: Dmitry Polyanitsa <dpolyanitsa@nvidia.com>
2015-07-14 14:24:05 -04:00
Brad King ad91d0edd5 Merge topic 'auto_export_dll_symbols'
8f86407c Windows: Optionally generate DLL module definition files automatically
069aa93b bindexplib: Add support for "/bigobj" format objects
61bbbdcf bindexplib: Fix treatment of some symbols
de70c922 bindexplib: Teach DumpFile to return errors
8ea69dfe bindexplib: Build source as part of CMakeLib
2963cb2a bindexplib: Wrap long lines
4ff09893 bindexplib: Drop code that CMake does not need
7de8276c bindexplib: Add copyright/license notice block
65086ad7 bindexplib: Import original implementation from CERN
2015-07-08 09:19:07 -04:00
Bill Hoffman 8f86407cfd Windows: Optionally generate DLL module definition files automatically
Create target property WINDOWS_EXPORT_ALL_SYMBOLS to automatically
generate a module definition file from MS-compatible .obj files and give
it to the linker in order to export all symbols from the .dll part of a
SHARED library.
2015-07-06 11:11:02 -04:00
Betsy McPhail f62d301b92 ctest: Optionally avoid starting tests that may exceed a given CPU load
Add a TestLoad setting to CTest that can be set via a new --test-load
command-line option, CTEST_TEST_LOAD variable, or TEST_LOAD option to
the ctest_test command.  Teach cmCTestMultiProcessHandler to measure
the CPU load and avoid starting tests that may take more than the
spare load currently available.  The expression

 <current_load> + <test_processors> <= <max-load>

must be true to start a new test.

Co-Author: Zack Galbreath <zack.galbreath@kitware.com>
2015-06-30 10:21:37 -04:00
Brad King c1113705d7 Merge topic 'compiler-launcher'
698f7597 Add options to launch the compiler through tools like ccache or distcc
2015-06-15 09:45:28 -04:00
Bill Hoffman 698f75971b Add options to launch the compiler through tools like ccache or distcc
Create a <LANG>_COMPILER_LAUNCHER target property (initialized by a
CMAKE_<LANG>_COMPILER_LAUNCHER variable) to specify a compiler launcher
tool.  This will supersede the CMAKE_<LANG>_COMPILER_ARG1 approach to
using such tools.  The old approach set CMAKE_<LANG>_COMPILER to the
launcher tool while the new approach leaves this variable set to the
actual compiler.

Implement this property for Makefile and Ninja generators.  It cannot be
implemented for VS or Xcode generators as the IDE build tools offer no
such hooks.
2015-06-15 09:36:48 -04:00
Brad King 8c64c4783d Help: Document CMAKE_FIND_APPBUNDLE and CMAKE_FIND_FRAMEWORK
Add dedicated documents for these and link to them instead of
duplicating their documentation in every find command.
2015-06-08 15:45:59 -04:00
Brad King 25b4483ef8 Help: Document CMAKE_SYSTEM_APPBUNDLE_PATH variable 2015-06-08 15:21:47 -04:00
Brad King e2f349864d Help: Document CMAKE_SYSTEM_FRAMEWORK_PATH variable 2015-06-08 15:15:47 -04:00
Brad King ada5ffce7b Add options to run include-what-you-use with the compiler
Create a <LANG>_INCLUDE_WHAT_YOU_USE target property (initialized by a
CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE variable) to specify an IWYU command
line to be run along with the compiler.
2015-05-19 13:16:29 -04:00
Robert Goulet a6e4e73da3 VS: Add option to put INSTALL target in .sln default build
Add a CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD variable to control
this behavior.
2015-05-06 10:31:39 -04:00
Brad King d401aa21c9 Help: Revise buildsystem artifact file type documentation (#15539)
Add sections to the cmake-buildsystem(7) manual and cross-reference
them with relevant variables and target properties.  This avoids
duplicating the information and allows it to be more detailed.
2015-04-29 11:17:59 -04:00
Geoff Viola 48004d9dbe Add a 'Green Hills MULTI' generator on Windows
Green Hills MULTI is an IDE for embedded real-time systems.  The IDE's
product page can be found here:

 http://www.ghs.com/products/MULTI_IDE.html

It supports cross compiling on ARM, Intel x86, and other architectures
with various operating systems.  The IDE exists on Linux and Windows
host systems, but CMake will currently only generate the project files
on Windows host systems.
2015-04-20 13:55:40 -04:00