summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
Commit message (Collapse)AuthorAgeFilesLines
* Add MirBSD platform support (#14659)Brad King2013-12-191-0/+1
| | | | | Add a Modules/Platform/MirBSD.cmake module that just includes the OpenBSD platform module.
* OS X: Fix app bundle search path during cross compiling (#14603)Flynn Marquardt2013-12-021-1/+3
| | | | | In "Modules/Platform/Darwin.cmake" the variable _apps_paths stays empty if cross compiling. Do not de-duplicate an empty list.
* Introduce CMAKE_STAGING_PREFIX variable.Stephen Kelly2013-11-212-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add compiler target compile options.Stephen Kelly2013-11-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Allow disabling adding the install prefix to the prefix search path.Stephen Kelly2013-10-312-9/+18
| | | | | | | 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.
* Merge topic 'QNX-ninja-generator'Brad King2013-10-261-0/+3
|\ | | | | | | | | 02cf77f QNX: Don't attempt to create depfiles
| * QNX: Don't attempt to create depfilesStephen Kelly2013-10-251-0/+3
| | | | | | | | | | The qcc driver can not handle the flags. This makes it possible to use qcc with the Ninja generator.
* | Merge topic 'intel-no-i_dynamic'Brad King2013-10-261-2/+2
|\ \ | | | | | | | | | | | | f61bcbc Intel: Drop deprecated -i_dynamic flag from Fortran (#14507)
| * | Intel: Drop deprecated -i_dynamic flag from Fortran (#14507)Brad King2013-10-241-2/+2
| |/ | | | | | | | | | | | | The -i_dynamic flag is deprecated and not even listed in the manual for Intel Composer XE 2013. Reported-by: Izaak Beekman <zbeekman@gmail.com>
* | Drop compatibility with CMake < 2.4Brad King2013-10-232-11/+0
|/ | | | | | | | | | | | Drop all behavior activated by setting CMAKE_BACKWARDS_COMPATIBILITY to a value lower than 2.4, and generate an error when projects or the user attempt to do so. In the error suggest using a CMake 2.8.x release. Teach cmake_minimum_required to warn about projects that do not require at least CMake 2.4. They are not supported by CMake >= 3.0. Replace the documentation of CMAKE_BACKWARDS_COMPATIBILITY with a reference to policy CMP0001.
* Merge topic 'vs12-parallel-cl-FS'Brad King2013-10-213-1/+7
|\ | | | | | | | | 216afc8 MSVC: Add /FS flag for cl >= 18 to allow parallel compilation (#14492)
| * MSVC: Add /FS flag for cl >= 18 to allow parallel compilation (#14492)Brad King2013-10-183-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In generators such as Ninja that can run multiple "cl" processes that refer to the same compiler .pdb file (/Fd) at the same time, MSVC from Visual Studio 2013 complains: fatal error C1041: cannot open program database '.../vc120.pdb'; if multiple CL.EXE write to the same .PDB file, please use /FS According to "cl /?": /FS force to use MSPDBSRV.EXE Add the flag to compilation lines for this compiler version just after the /Fd option.
* | Intel: When simulating MSVC, re-use Windows-MSVC (#14476)Brad King2013-10-183-93/+16
| | | | | | | | | | | | | | | | | | Teach CMake(C|CXX|Fortran)CompilerId* to report the MSVC version simulated by the Intel compiler, if any. Refactor the Windows-Intel platform information helper module to load Windows-MSVC instead of duplicating the information. Teach Windows-MSVC to understand when it is loaded as the simulated Fortran compiler (its preprocessor is simulated).
* | OS X: Encode -F framework search flag in per-language platform variableBrad King2013-10-101-0/+5
| | | | | | | | | | | | | | | | | | Compilers for languages other than C and C++ on OS X may not understand the -F framework search flag. Create a new platform information variable CMAKE_<LANG>_FRAMEWORK_SEARCH_FLAG to hold the flag, and set it for C and CXX lanugages in the Platform/Darwin module. Reported-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge topic 'haiku-updates'Brad King2013-10-091-13/+114
|\ \ | | | | | | | | | | | | | | | | | | | | | 54ef2be Haiku: Include files cleanup in cmCTest 38d5555 Haiku: Remove outdated preprocessor checks 1dc61f8 Haiku: Remove use of B_COMMON_DIRECTORY 7ebc1cb Haiku: Several fixes to platform module
| * | Haiku: Several fixes to platform moduleAdrien Destugues2013-10-081-13/+114
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Do not define BEOS anymore (this includes workarounds which we don't need most of the time in Haiku, so we prefer opt-in IF(HAIKU) in the cmake files instead). * On the other hand, do define UNIX (we are trying to be compliant) and HAIKU (there is still a number of things we don't do like the average UNIX clone) * Do not use UnixPaths, as our filesystem hierarchy isn't anything like what it expects. * Do not use -nostart, which the compiler doesn't know about anymore. This used to be an Haiku extension to gcc, and is equivalent to -shared which is the default gcc option. * While "dl" functions are provided in libroot, this is always implicitly linked so there is no need to tell cmake about it. * Forcing position-independent code is not needed, so remove it. * On the other hand, include appropriate linker options for executables and shared libraries. * Support for the two available compilers in Haiku (gcc2 and gcc4) and pick the right headers and libraries according to the currently selected one. * With the adoption of the package manager, the directory layout was changed. Tell cmake where to look for header files and libraries. * As we don't define BEOS anymore, enable the workaround we still need for HAIKU as well. This is the lack of a libm (it is part of the implicitly linked in libroot) Applied-by: Rolf Eike Beer <eike@sf-mail.de>
* | Merge topic 'apple-clang-id'Brad King2013-10-092-0/+2
|\ \ | | | | | | | | | | | | | | | | | | 1763c31 Set policy CMP0025 to NEW while building CMake itself aa53ee5 Add policy CMP0025 for Apple Clang compiler id compatibility ab65862 Clang: Add separate "AppleClang" compiler id
| * | Clang: Add separate "AppleClang" compiler idBrad King2013-10-082-0/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | Apple distributes their own Clang build with their own version numbers that differ from upstream Clang. Use the __apple_build_version__ symbol to identify the Apple Clang compiler and report the Apple Build Version as the fourth version component in CMAKE_<LANG>_COMPILER_VERSION. Add Compiler/AppleClang-<lang> and Platform/Darwin-AppleClang-<lang> modules that simply include the upstream equivalents. Fix comparisons of CMAKE_<LANG>_COMPILER_ID to Clang in CMake's own source and tests to account for AppleClang.
* | Clang: Support Windows variants for GNU and MSVC (#13035, #14458)Brad King2013-10-044-2/+42
|/ | | | | | | | | | | | | | | | Teach the compiler identification preprocessor tests to report when Clang simulates MSVC, and what version. If not MSVC, assume GNU. Teach compiler information modules Clang-(C|CXX) to recognize when Clang simulates MSVC and skip loading the GNU information. Teach the Windows-MSVC platform information to recognize when it is loaded as the simulated compiler and use that version information instead of the real compiler's (different) version scheme. Add platform modules Windows-Clang-(C|CXX) and support module Windows-Clang to load either Windows-MSVC or Windows-GNU and wrap the corresponding information macros.
* OS X: Search system SDKs for frameworksBrad King2013-09-271-0/+9
| | | | | | | | In Modules/Platform/Darwin.cmake set CMAKE_SYSTEM_FRAMEWORK_PATH to include framework directories from inside the system SDK corresponding to CMAKE_OSX_SYSROOT. Suggested-by: Sean McBride <sean@rogue-research.com>
* MSVC: Fix WinCE arch family preprocessor symbol (#14436)Patrick Gansterer2013-09-251-4/+11
| | | | | | | | | In commit bd827f98 (Use COFF file header header for architecture detection, 2013-08-05) the MSVC_<lang>_ARCHITECTURE_ID value computed by CMakeDetermineCompilerId.cmake changed for WinCE architectures to be the exact architecture read from the PE header. Fix platform preprocessor definitions in Modules/Platform/Windows-MSVC.cmake to correspond to the architecture family (ARM or SHx) instead of the specific architecture.
* MSVC: Fix version test for linking corelibc on Windows CE (#14420)Patrick Gansterer2013-09-231-1/+1
| | | | | | In commit 8fcf0ab0 (Add support for new Windows CE compiler, 2013-08-04) we made corelibc conditional on the MSVC version, but the version value was incorrect. Update it to use corelibc for VS 2008 and below.
* MSVC: Drop /link from executable link lines with NinjaBrad King2013-09-111-1/+0
| | | | | | | In commit fb9f73de (MSVC: Invoke 'link' directly for executables, 2013-04-08) we forgot to remove the /link option handling added by commit e31df039 (Ninja: move <OBJECTS> in front of the first linker option, 2012-09-27) to the Platform/Windows-MSVC module. Drop it now.
* OS X: Do not default to non-existent deployment target SDKBrad King2013-08-141-2/+14
| | | | | | | Since commit 95f78e08 (OS X: Search for SDK based on deployment target, 2013-08-02) we select the default OS X SDK path to match the deployment target. Fix this behavior in the case that the matching SDK does not exist and fall back to the SDK for the current host OS X version.
* Revert "Add compiler target compile options."Stephen Kelly2013-08-091-3/+0
| | | | This reverts commit 2d9ec1dadfdd10043a98d425abb25d0aef117699.
* Merge topic 'wince800'Brad King2013-08-081-1/+5
|\ | | | | | | | | | | 0416a0e VS11: Add support for Windows CE SDKs 8fcf0ab Add support for new Windows CE compiler
| * Add support for new Windows CE compilerPatrick Gansterer2013-08-071-1/+5
| | | | | | | | | | The new compiler versions do not need corelibc.lib as a default link library and a architecture detection workaround.
* | Merge topic 'osx-no-command-line-tools'Brad King2013-08-071-0/+6
|\ \ | |/ |/| | | | | 03ab170 OS X: Enable command-line build without tools in PATH
| * OS X: Enable command-line build without tools in PATHBrad King2013-08-061-0/+6
| | | | | | | | | | | | | | | | | | | | Teach modules CMakeDetermineCompiler and CMakeUnixFindMake to ask Xcode where to find the compiler or make tools, using 'xcrun --find', if none is found in the PATH. Teach module Platform/Darwin to add the path to the SDK to CMAKE_SYSTEM_PREFIX_PATH so that find_* command look there. Also add the SDK /usr/include directory to the implicit include list in CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES to suppress explicit -I options for it.
* | WIN: Use COFF file header header for architecture detection (#14083)Patrick Gansterer2013-08-051-7/+0
|/ | | | | Read the machine field from the COFF file header to get the exact target architecture for ARM and SHx on the Windows platform.
* OS X: Search for SDK based on deployment target (#14324)Brad King2013-08-021-1/+5
| | | | | | | | When available, use CMAKE_OSX_DEPLOYMENT_TARGET instead of the host OS X version to select the default SDK. This makes sense because one should use the SDK matching the deployment target. Suggested-by: John Ralls <jralls@ceridwen.us>
* OS X: Add Fortran library version flags (#14249)Graham Markall2013-07-164-0/+31
| | | | | | | | | The linker flags for setting the compatibility and current versions of libraries on Darwin are set for the supported Fortran compilers. Set CMAKE_Fortran_CREATE_SHARED_LIBRARY for the NAG Fortran compiler to have no space after <SONAME_FLAG> so the NAG compiler can parse the argument correctly.
* OS X: Add copyright notices to Darwin-*-Fortran.cmakeBrad King2013-07-163-0/+39
|
* Merge branch 'master' into vs12-generatorBrad King2013-06-287-21/+23
|\ | | | | | | | | Resolve conflicts in Tests/Preprocess/CMakeLists.txt by keeping the side from 'master'.
| * Embarcadero: Use response files only for includes, objects, and libsBrad King2013-06-271-3/+4
| | | | | | | | | | | | Leave other flags directly in the Makefile command lines and outside any special inline response file syntax. Otherwise Borland does not support flags with quotes in response files.
| * Add compiler target compile options.Stephen Kelly2013-06-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Merge topic 'rpath-on-mac'Brad King2013-06-031-0/+5
| |\ | | | | | | | | | | | | | | | | | | | | | 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.
| | * OS X: Add RPATH support for Mac.Clinton Stimpson2013-06-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Merge topic 'xcode-shlib-versioning'Brad King2013-06-031-6/+2
| |\ \ | | |/ | | | | | | | | | cbe3f20 Xcode: Add support for shared library versioning
| | * Xcode: Add support for shared library versioningClinton Stimpson2013-05-291-6/+2
| | | | | | | | | | | | | | | Add a post-build command to shared library targets to create the versioning symbolic links.
| * | Merge topic 'vs-configurations'Brad King2013-05-162-5/+0
| |\ \ | | | | | | | | | | | | | | | | 42bb42d VS: Always initialize CMAKE_CONFIGURATION_TYPES in IDE generators
| | * | VS: Always initialize CMAKE_CONFIGURATION_TYPES in IDE generatorsBrad King2013-05-132-5/+0
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initialize the CMAKE_CONFIGURATION_TYPES cache entry early during EnableLanguage like the Xcode generator does. Avoid depending on the MSVC compiler information module to do it. Otherwise code like project(MyProj NONE) sets CMAKE_CONFIGURATION_TYPES late (in GenerateConfigurations), and to only "Debug" and "Release" instead of the standard set of 4. Reported-by: Paul Smith <paul@mad-scientist.net>
| * | Merge topic 'doc-improvements'Brad King2013-05-161-1/+1
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7cc2805 Docs: Clarify wording "flag used" => "flag (to|will) be used" 2378a69 Docs: Clarify that CMAKE_*_(PREFIX|SUFFIX) affect filenames 56ca34d Docs: Update description of CMAKE_(BUILD_TYPE|CONFIGURATION_TYPES) 2bab472 VS10: add detailed comment about MIDL processing e619111 Explain distribution of Win9x binary on all Windows versions. 5ca4336 FindwxWidgets: add DOC strings with usual style f57800d Fix spelling and typos (product names) bf019d7 Fix spelling and typos (non-binary) ddac8d3 Fix spelling and typos (affecting binary data / module messages) 86832ce Fix spelling and typos (affecting users)
| | * | Fix spelling and typos (non-binary)Andreas Mohr2013-05-071-1/+1
| | |/
| * | Merge topic 'WindowsPaths-MinGW-cross-compile-only'Brad King2013-05-161-2/+4
| |\ \ | | | | | | | | | | | | | | | | f9eee7f Windows: Search '/' prefix only when cross compiling (#10994)
| | * | Windows: Search '/' prefix only when cross compiling (#10994)Brad King2013-04-251-2/+4
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit dac78148 (...makes the mingw cross compiler work out of the box..., 2007-08-02) added to CMAKE_SYSTEM_PROGRAM_PATH and CMAKE_SYSTEM_LIBRARY_PATH paths like "/bin" and "/lib" with no Windows drive letter so that cross-compiling to Windows from Linux would search these paths under CMAKE_FIND_ROOT_PATH. Later commit 2a782880 (...use CMAKE_SYSTEM_PREFIX_PATH when possible, 2008-01-16) generalized this approach by instead adding "/" to CMAKE_SYSTEM_PREFIX_PATH. Both commits assumed that the paths would never match anything on Windows hosts without a drive letter. However, Windows evaluates these paths relative to the current working drive letter so find_* commands may report paths like "/lib/..." when paths like "c:/lib/..." exist on what happens to be current drive. Such drive-less paths are not reliable when the working drive changes, so we should not use them. Fix WindowsPaths.cmake to add '/' to CMAKE_SYSTEM_PREFIX_PATH only when cross-compiling to Windows from a non-Windows host. This will avoid searching and finding local paths without a drive letter on Windows.
| * | MSVC: Invoke 'link' directly for executablesBrad King2013-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the CMAKE_<LANG>_LINK_EXECUTABLE rule variable to invoke the linker directly instead of through the compiler. We already do this for DLL linking with CMAKE_<LANG>_CREATE_SHARED_LIBRARY. This also works around a VS 6 cl bug. While invoking the link tool internally it fails to correctly quote flags like /pdb:... with spaces in the value.
| * | VS: Separate compiler and linker PDB files (#11899, #14062)Brad King2013-04-052-4/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MS tools create two types of PDB files as explained here: http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.71%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.80%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.90%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.100%29.aspx One is created by the compiler (/Fd) and the other by the linker (/pdb). The two options should not specify the same file. Split them up. In the VS IDE generators, simply drop ProgramDataBaseFileName to take the VS default "/Fd$(IntDir)vc$(PlatformToolsetVersion).pdb". In the Makefile generators, set "/Fd" on the compile line to be the directory containing object files (with a trailing slash the compiler will add the "vc$(PlatformToolsetVersion).pdb" filename automatically). Drop the /Fd option from the exe link command line and add "/pdb" instead (already done for dll linking). Update these rules for both MSVC and Intel tools. Drop support for PDB_OUTPUT_DIRECTORY and PDB_NAME in STATIC libraries because the generated .pdb files are only from /Fd and not real linker-generated .pdb files. Update documentation to clarify that the PDB_* properties are only for linker .pdb files. This regresses the PDBDirectoryAndName test for STATIC libraries. Since it is not clear at this time what should be done for STATIC library .pdb files, comment out the relevant portion of the test and leave a TODO comment.
* | VS12: Add Visual Studio 12 generator (#14251)Brad King2013-06-281-1/+4
|/ | | | | | | | | | | | | | Copy cmGlobalVisualStudio11Generator to cmGlobalVisualStudio12Generator and update version numbers accordingly. Add the VS12 enumeration value. Add module CMakeVS12FindMake to find MSBuild. Look for MSBuild in its now-dedicated Windows Registry entry. Teach the platform module Windows-MSVC to set MSVC12 and document the variable. Teach module InstallRequiredSystemLibraries to look for the VS 12 runtime libraries. Teach tests CheckCompilerRelatedVariables, Preprocess, VSExternalInclude, and RunCMake.GeneratorToolset to treat VS 12 as they do VS 10 and 11. Inspired-by: Minmin Gong <minmin.gong@gmail.com>
* Merge topic 'aix-shared-flags'Brad King2013-03-122-2/+2
|\ | | | | | | | | bce7a2a AIX: Do not use -brtl to create shared libraries (#13997)