Commit Graph

4601 Commits

Author SHA1 Message Date
Stephen Kelly 7521da2852 Introduce CMAKE_STAGING_PREFIX variable.
This variable can be useful in cross-compiling contexts where the
sysroot is read-only or where the sysroot should otherwise remain
pristine.

If the new CMAKE_STAGING_PREFIX variable is set, it is used instead
of CMAKE_INSTALL_PREFIX when generating the installation rules in
cmake_install.cmake.

This way, the CMAKE_INSTALL_PREFIX variable
always refers to the installation prefix on the target device, regardless
of whether host==target.

If any -rpath paths passed to the linker contain the CMAKE_STAGING_PREFIX,
the matching path fragments are replaced with the CMAKE_INSTALL_PREFIX.
Matching paths in the -rpath-link are not transformed.

The cross-prefix usr-move workaround is assumed not to require extension
regarding CMAKE_STAGING_PREFIX. The staging area is a single prefix, so
there is no scope for cross-prefix symlinks. The CMAKE_INSTALL_PREFIX
is still used to determine the workaround path, and that variable
remains the relevant one even if CMAKE_STAGING_PREFIX is used. If the
generated export files are deployed to the target, the workaround
will still be in place, and still be employed if required.
2013-11-21 11:48:03 +01:00
Brad King 46ec48c93d Merge topic 'cross-compiling-toolchain-variables'
7cd65c9 Add CMAKE_SYSROOT variable to set --sysroot when cross compiling.
5096967 Allow toolchain files to specify an external toolchain.
76552d5 Add compiler target compile options.
f41ecd1 CMakeDetermineCompilerId: Look for internal file only on host
2013-11-19 12:41:57 -05:00
Stephen Kelly 7cd65c97fa Add CMAKE_SYSROOT variable to set --sysroot when cross compiling.
As CMAKE_ROOT_FIND_PATH can be a list, a new CMAKE_SYSROOT is
introduced, which is never a list.

The contents of this variable is passed to supporting compilers
as --sysroot. It is also accounted for when processing implicit
link directories reported by the compiler, and when generating
RPATH information.
2013-11-19 12:39:39 -05:00
Stephen Kelly 5096967ecd Allow toolchain files to specify an external toolchain.
Clang can compile code, but uses the gcc tools for other tasks such
as linking. The -gcc-toolchain option can be used for that, but
generalize so that other compilers can be treated the same.

If such a location is specified, use it as a hint for finding
the binutils executables.
2013-11-19 12:39:34 -05:00
Stephen Kelly 76552d595d Add compiler target compile options.
For clang, this allows passing -target <triple> to the compiler, and
for qcc, -V<arch> using toolchain files containing something like

 set(triple arm-linux-gnueabihf)
 set(CMAKE_C_COMPILER "/usr/bin/clang")
 set(CMAKE_C_COMPILER_TARGET ${triple})
 set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
 set(CMAKE_CXX_COMPILER_TARGET ${triple})

or

 set(arch gcc_ntoarmv7le)
 set(CMAKE_C_COMPILER /opt/qnx650/host/linux/x86/usr/bin/qcc)
 set(CMAKE_C_COMPILER_TARGET ${arch})
 set(CMAKE_CXX_COMPILER /opt/qnx650/host/linux/x86/usr/bin/QCC)
 set(CMAKE_CXX_COMPILER_TARGET ${arch})

Both clang and qcc are inherently cross compiler( driver)s.

When cross-compiling with clang, use the CMAKE_${lang}_COMPILER_TARGET
as the _CMAKE_TOOLCHAIN_PREFIX to find the appropriate binutils.

When cross-compiling with QNX qcc, use the CMAKE_${lang}_COMPILER_TARGET
to set the appropriate _CMAKE_TOOLCHAIN_PREFIX.
2013-11-19 12:38:53 -05:00
Stephen Kelly f41ecd1db4 CMakeDetermineCompilerId: Look for internal file only on host
The find_file this module uses to locate the compiler id source file
must always look on the host and never in CMAKE_FIND_ROOT_PATH, even
when a toolchain file has

 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Add NO_CMAKE_FIND_ROOT_PATH to the find_file call to avoid rerooting.
2013-11-19 12:36:27 -05:00
Brad King 1da77bf1ee Merge topic 'cleanup-build-commands'
4cce44b Help: Document the CMAKE_MAKE_PROGRAM variable in more detail
558c74d VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators
5229f2d Tests: Do not use an explicit make program for VS generators
72dd738 Tests: Fix MFC test heuristic for empty CMAKE_TEST_MAKEPROGRAM
fd6076d Tests: Pass CMAKE_MAKE_PROGRAM instead of --build-makeprogram
68031ab Tests: Configure SubProject-Stage2 test more robustly
003d10c Tests: Simplify VSExcludeFromDefaultBuild configuration
e47d934 Tests: Simplify VSProjectInSubdir configuration
e965cb1 Tests: Simplify CTest.BuildCommand.ProjectInSubdir configuration
72bf255 Tests: Pass --build-options to every test
4d1d772 ctest: Teach --build-options to allow zero options
96966b5 ctest: Make the --build-makeprogram optional for --build-and-test
91a0211 Simplify some calls to cmGlobalGenerator::Build
123a060 Teach GenerateBuildCommand to find its own make program
5f5c92b VS: Add internal APIs to find MSBuild, devenv/VCExpress, and msdev
4ac75fd Prefer CMAKE_MAKE_PROGRAM over CMAKE_BUILD_TOOL (#14548)
...
2013-11-19 10:55:39 -05:00
Brad King 8564682136 Merge topic 'doc-ExternalProject-formatting'
01ecd24 ExternalProject: Format module documentation
2013-11-19 09:47:39 -05:00
Brad King 01ecd24fa6 ExternalProject: Format module documentation
Manually revise the .rst format of the documentation.  Use inline
literal quotes appropriately in paragraph text.  Move the :: literal
block openers to the end of the preceding paragraphs.  Convert the
command signature documentation and examples to cmake code-block
directives.
2013-11-19 09:27:08 -05:00
Brad King 558c74d0ab VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators
Drop the "Modules/CMakeVS*FindMake.cmake" files.  Override the
cmGlobalGenerator::FindMakeProgram method for VS generators to use their
internal APIs to locate the build tool.  Set the CMAKE_MAKE_PROGRAM as a
normal variable for use by project code, but do not cache it.  This will
allow CMake and CTest to select the proper tool at build time.
2013-11-18 11:30:50 -05:00
Brad King 4ac75fdfe6 Prefer CMAKE_MAKE_PROGRAM over CMAKE_BUILD_TOOL (#14548)
Historically these were both added for the Makefile and Visual Studio
generators, respectively.  Later the VS generators started using the
CMAKE_MAKE_PROGRAM cache entry to find the IDE build tool, and the
CMAKE_BUILD_TOOL was simply set as an alias.

Fix the documentation to explain that CMAKE_MAKE_PROGRAM is the modern
variable and that CMAKE_BUILD_TOOL is the compatibility alias, not the
other way around.  Replace uses of CMAKE_BUILD_TOOL with
CMAKE_MAKE_PROGRAM in CMake-provided modules.  Nothing needs to lookup
CMAKE_BUILD_TOOL in the cache, so simply set it as a normal variable.
2013-11-18 08:26:23 -05:00
Nils Gladitz 7621ad6eae CPack: don't write internal variables to CPackConfig.cmake
The internal variables CPACK_ADDCOMP_COMPONENTS,
CPACK_ADDCOMP_STR and CPACK_ADDCOMP_UNAME were being needlessly
exported to CPackConfig.cmake.
Prefixing them with an underscore prevents this.

CPACK_ADDCOMP_STR was particularily problematic since it contains
unescaped quotes.
2013-11-17 11:02:41 +01:00
Brad King 5084cac09f Merge topic 'gp-ld_library_path'
e130b9e GetPrerequisites:  Preserve search path order from caller.
2013-11-14 11:28:34 -05:00
Brad King 3993300ad3 Merge topic 'openmp-cray'
ebf70b0 FindOpenMP: fix detecting compilers that do not need any special flag (#14567)
2013-11-14 11:28:24 -05:00
Brad King 42eaf34168 Merge topic 'configure_file-drop-IMMEDIATE'
15610bb Drop use of configure_file IMMEDIATE option
2013-11-14 11:28:07 -05:00
Clinton Stimpson e130b9ebaa GetPrerequisites: Preserve search path order from caller. 2013-11-14 11:26:23 -05:00
Rolf Eike Beer ebf70b037d FindOpenMP: fix detecting compilers that do not need any special flag (#14567) 2013-11-13 21:41:33 +01:00
Daniele E. Domenichelli 15610bb5b1 Drop use of configure_file IMMEDIATE option
Since commit 7d47c693 (Drop compatibility with CMake < 2.4, 2013-10-08)
we no longer need to use the configure_file IMMEDIATE option to support
compatibility modes less than 2.0.
2013-11-13 10:12:17 -05:00
Brad King 8eb20eeabe ExternalData: Allow local stores without any URL templates
Allow ExternalData_URL_TEMPLATES to be empty if a value for
ExternalData_OBJECT_STORES is provided.  Assume in this use case that
the object stores will already contain all needed objects.  Extend the
Module.ExternalData test to cover this case (all objects in stores).
Extend the RunCMake.ExternalData test to cover the non-failure message
case when stores are provided without URL templates.
2013-11-13 10:03:36 -05:00
Brad King 5473b327c6 Merge topic 'doc-ExternalData-network-path'
f3883f3 ExternalData: Show example network path URL template
ff6818b ExternalData: Format module documentation
2013-11-13 09:58:18 -05:00
Nils Gladitz 096591b96a CPackWiX: Add variables for custom tool extensions and flags 2013-11-12 14:10:01 -05:00
Brad King f3883f366d ExternalData: Show example network path URL template
In the ExternalData_URL_TEMPLATES example, add an entry showing how to
use the "file://" protocol with a network filesystem path.
2013-11-12 11:26:28 -05:00
Brad King ff6818bc0a ExternalData: Format module documentation
Manually revise the .rst format of the documentation.  Use inline
literal quotes appropriately in paragraph text.  Move the :: literal
block openers to the end of the preceding paragraphs.  Convert the
command signature documentation and examples to cmake code-block
directives.
2013-11-12 11:22:07 -05:00
Brad King 177f5e51d2 Merge topic 'osx-no-PackageMaker'
7947981 CPack: Disable OS X PackageMaker by default (#13662)
2013-11-05 11:42:10 -05:00
Brad King 46316a0569 Merge topic 'FindPHP4-no-cache-output'
a06debc FindPHP4: Drop extra content from reported PHP4_INCLUDE_PATH (#14540)
2013-11-05 08:16:57 -05:00
Brad King d94416725e Merge topic 'FindJNI-biarch'
cde56c1 FindJNI: Support biarch installations (#14541)
2013-11-05 08:16:51 -05:00
Brad King 7ccb8fafdb Merge topic 'ninja-deps-intel'
d439083 Ninja: add depfile support for Intel's compiler
2013-11-05 08:16:42 -05:00
Modestas Vainius cde56c1223 FindJNI: Support biarch installations (#14541)
On biarch architecture, CMAKE_SYSTEM_PROCESSOR might be a 64bit one
while the system 32bit one. Take this into consideration while looking
for Java library directory.

Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718290
2013-11-04 08:55:02 -05:00
Brad King a06debcde9 FindPHP4: Drop extra content from reported PHP4_INCLUDE_PATH (#14540)
The set() call for this variable left out the CACHE keyword.  It does
not need to be cached anyway, so drop the other CACHE set() signature
arguments.

Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=722475
Reported-by: Modestas Vainius <modax@debian.org>
Inspired-by: Mathieu Malaterre <malat@debian.org>
2013-11-04 08:51:46 -05:00
Brad King f3698f7c4a Merge topic 'cpack-drag-n-drop-rez'
53d6ebb cpack: For DragNDrop generator, add sysroot option when calling Rez.
193029c cpack: For DragNDrop generator, add sysroot option when calling Rez.
2013-11-04 07:53:25 -05:00
Peter Kümmel d439083287 Ninja: add depfile support for Intel's compiler 2013-11-04 13:29:19 +01:00
Brad King 922876b0c0 Merge branch 'vs12-parallel-cl-FS' into release 2013-11-02 13:41:42 -04:00
Brad King 7947981c2b CPack: Disable OS X PackageMaker by default (#13662)
As mentioned in commit 4693cf84 (Xcode: Detect new default locations of
Xcode 4.3 bits and pieces) PackageMaker was split out of Xcode 4.3 and
above into a separate Auxiliary tools package.  Since Xcode 5.0 or so,
Apple no longer distributes PackageMaker as part of the available
development tools so it can only be obtained from old packages.

Disable the CPACK_BINARY_PACKAGEMAKER option by default as is the case
for most other tool-dependent generators.
2013-11-01 15:41:16 -04:00
Brad King f53878b0d5 FindBoost: Clarify example static libs option (#13663)
State explicitly in the example that it will only find static libraries.
2013-11-01 11:24:06 -04:00
Brad King a42a66547b FindBoost: Refine .rst formatting
Move the '::' starting literal blocks to the end of the preceding
paragraph.  Convert the "Boost CMake" divider to a section header.
2013-11-01 11:24:06 -04:00
Brad King e065decd43 Merge topic 'add-CMAKE_FIND_NO_INSTALL_PREFIX'
fe057ab Allow disabling adding the install prefix to the prefix search path.
2013-11-01 09:40:19 -04:00
Clinton Stimpson 53d6ebb360 cpack: For DragNDrop generator, add sysroot option when calling Rez. 2013-11-01 05:31:07 -06:00
Clinton Stimpson 193029c4aa cpack: For DragNDrop generator, add sysroot option when calling Rez.
Also adding overwrite option (-ov) in case multiple temporary
dmg files are being created.

Fixes bug #14536.
2013-10-31 20:25:12 -06:00
Stephen Kelly fe057ab3cd Allow disabling adding the install prefix to the prefix search path.
In certain scenarios, it is preferable to keep a 'dirty' install prefix
than to clear it, and to expect that content will not be found there.
Add a CMAKE_FIND_NO_INSTALL_PREFIX variable that can be set to disable
searching the install prefix.
2013-10-31 16:40:24 +01:00
Brad King afe6adfaba Merge topic 'external-language-compiler-id'
e65c788 CMakeDetermineCompilerId: Load src from CMAKE_MODULE_PATH (#14481)
2013-10-29 09:45:40 -04:00
Brad King fcbe435c23 Merge topic 'Qt-auto-generators'
9c87d9c Add automatic rcc invocation for Qt.
84218e1 Add automatic uic invocation for Qt.
94a0ca6 Record which files are skipped by automoc.
18fb758 Run the main executable created in the autogen tests.
e485ba1 Rename the QtAutomoc tests to QtAutogen.
7ce65c3 Add extra checks for the AUTOMOC target property.
32771fc Update output messages for generic use.
f371ab5 Rename RunAutomoc to RunAutogen.
85b3d6e Extract an SetupAutoMocTarget method.
ca124a1 Rename the AutomocInfo.cmake file to be more generic.
a342c9f Move some makefile definitions up away from moc-specific code.
98632ef Add the AUTOGEN_TARGETS_FOLDER and obsolete AUTOMOC_TARGETS_FOLDER.
63378ba Rename some variables to reflect broader scope.
97f1aa3 Rename method to reflect generic use.
4abb111 Rename local variable to reflect generic use.
03878c9 Move variable set to where it is used.
...
2013-10-28 15:23:09 -04:00
Dragos Carp e65c788767 CMakeDetermineCompilerId: Load src from CMAKE_MODULE_PATH (#14481)
Support new languages using CMAKE_MODULE_PATH.
2013-10-28 08:54:40 -04:00
Brad King 16df2456a4 Merge topic 'enable-language-require-compiler'
3e04946 Require CMAKE_<LANG>_COMPILER to be found as a full path
6007f7c CMakeDetermineCompilerId: Always use compiler detected from IDE
332771c CMakeDetermine*Compiler: Remove temporary cache entry
2013-10-28 08:39:29 -04:00
Brad King e378bc6441 Merge topic 'ninja-use-deps'
eeb4aec Ninja: use deps = gcc/msvc feature
2013-10-28 08:38:40 -04:00
Brad King 3e04946f7b Require CMAKE_<LANG>_COMPILER to be found as a full path
All generators now support detection of the full path to the compiler, so
require it to be so.  This will allow CMake<LANG>Information.cmake and
other logic to assume the full path to the compiler tool is available.

The Makefile generators already rejected CMAKE_<LANG>_COMPILER values
that did not name an existing compiler.  Extend this error message to
all generators, make it occur as early as possible, and improve the
message with advice about how to set the compiler.  If the full path to
the compiler is not known, finish enabling languages with a fatal error
so configuration does not continue.

For now, allow the RC language compiler to not be a full path.  Later we
will need to detect the full path to "rc" under the VS IDE.

Add a RunCMake.CompilerNotFound test to cover failure cases.
Fix the RunCMake.CompilerChange test EmptyCompiler case to work
when configuration does not continue past enable_language.
2013-10-28 08:36:14 -04:00
Brad King 6007f7ca01 CMakeDetermineCompilerId: Always use compiler detected from IDE
When compiler id detection also provides a CMAKE_<LANG>_COMPILER
value, use it unconditionally.  It is known to be the compiler
that is actually in use by IDE builds in VS and Xcode.  Do not
let a stray cache entry try to say otherwise.
2013-10-28 08:36:14 -04:00
Brad King ef13fc4dfc Merge topic 'ctest-p4'
970c823 ctest_update: Add support for Perforce p4 client
2013-10-26 10:29:28 -04:00
Brad King fc15fe75c5 Merge topic 'clang-binutils'
b84f5c2 Find appropriate binutils when cross-compiling with clang
2013-10-26 10:29:12 -04:00
Brad King 86a15dbd28 Merge topic 'QNX-ninja-generator'
02cf77f QNX: Don't attempt to create depfiles
2013-10-26 10:29:06 -04:00
Brad King d36d5d8ffe Merge topic 'python-interp-remove-debug-messages'
49c4699 python: remove debug statements from FindPythonInterp.cmake.
2013-10-26 10:28:44 -04:00