summaryrefslogtreecommitdiff
path: root/Modules/CMakeDetermineSystem.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Warn if CMAKE_CROSSCOMPILING is true without CMAKE_SYSTEM_NAME setMartin Storsjö2023-03-241-0/+7
| | | | | Also clarify the `CMAKE_CROSSCOMPILING` documentation to state that CMake sets the variable automatically.
* Modules: Record system inspection steps in the configure logBrad King2023-01-181-6/+7
| | | | | | | | Replace old-style `file(APPEND .../CMake{Output,Error}.log)` logging with calls to `message(CONFIGURE_LOG)` to record the steps in the `CMakeConfigureLog.yaml` configure log instead. Issue: #23200
* CMakeDetermineSystem: use execute_process() vs. exec_program()Michael Hirsch2022-11-131-14/+38
|
* CMakeDetermineSystem: Remove unreachable codeCraig Scott2022-05-081-1/+0
|
* MSYS: Add support for running under MSYS runtime environmentOrgad Shaneh2021-04-261-1/+2
| | | | Detect MSYS as CYGWIN, with the required adaptations.
* Refactor: Add cmSystemTools::GetSystemName()Kyle Edwards2021-03-151-31/+8
| | | | And use it for CMAKE_HOST_SYSTEM_NAME and CMAKE_SYSTEM_NAME.
* macOS: Offer control over host architecture on Apple Silicon hostsBrad King2020-12-101-9/+28
| | | | | | | | | | | | | | | | | | | | | | | | | Since commit b6c60f14b6 (macOS: Default to arm64 architecture on Apple Silicon hosts, 2020-09-28, v3.19.0-rc1~63^2) we use `sysctl` to detect that we are running on Apple Silicon in a way that pierces Rosetta. This always sets `CMAKE_HOST_SYSTEM_PROCESSOR` to be `arm64` on such hosts. However, macOS offers strong support for running processes under an emulated `x86_64` architecture. Teach CMake to select either `arm64` or `x86_64` as the host architecture on Apple Silicon based on the architecture of its own process. When CMake is built as a universal binary, macOS will select whichever slice (architecture) is appropriate under the user's shell, and `CMAKE_HOST_SYSTEM_PROCESSOR` will match. Also offer a `CMAKE_APPLE_SILICON_PROCESSOR` variable and environment variable to provide users with explicit control over the host architecture selection regardless of CMake's own architecture. Finally, if `CMAKE_OSX_ARCHITECTURES` is not set, pass explicit flags to the toolchain to use selected host architecture instead of letting the toolchain pick. Fixes: #21554
* macOS: Default to arm64 architecture on Apple Silicon hostsBrad King2020-09-301-4/+15
| | | | | | | | Detect `arm64` hardware using a method that pierces Rosetta. If `CMAKE_OSX_ARCHITECTURES` is not set, pass explicit flags to the toolchain to use `arm64` instead of letting the toolchain pick. Fixes: #20989
* Android: add support for native compilation, such as with the Termux appButta2019-10-151-1/+1
| | | | | | | | | The CMake support for Android assumes cross-compilation using the NDK, so stub out that Android NDK support and use the Linux support that's already invoked. Set CMAKE_HOST_SYSTEM_NAME to "Android", rather than "Linux". Issue: #19840
* Remove now-unused code once used on IRIXBrad King2019-01-111-1/+0
| | | | | We dropped support for IRIX as a host platform long ago. Remove some leftover code.
* Various typo fixesLuz Paz2018-01-041-1/+1
| | | | Some are user-facing. Others are source comments.
* AIX: Properly detect host system versionGregor Jasny2017-03-291-1/+9
| | | | | | | | | | CMakeDetermineSystem.cmake uses "uname -r" to get CMAKE_HOST_SYSTEM_VERSION on AIX. AIX uses "uname -v" for the major version and "uname -r" for the minor version. Thanks to Chris Taylor for the suggested patch. Closes #10749
* Use looked up uname path for command executionGregor Jasny2017-02-191-4/+4
|
* Make CMAKE_HOST_SYSTEM_NAME available in scripting contextGregor Jasny2017-02-191-2/+0
|
* Simplify CMake per-source license noticesBrad King2016-09-271-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* CMakeDetermineSystem: Load platform-specific helper modulesBrad King2016-08-121-0/+1
| | | | | | | | | | | Once CMAKE_SYSTEM_NAME is known, load a platform-specific Platform/<os>-Determine module in order to enable custom determination of the other settings needed for the CMakeSystem module (e.g. CMAKE_SYSTEM_PROCESSOR). Also add a hook in Modules/CMakeSystem.cmake.in to allow platform-specific information to be saved.
* Allow CMAKE_SYSTEM_VERSION to be set without CMAKE_SYSTEM_NAMEGilles Khouzam2015-10-021-1/+3
| | | | | | Teach CMakeDetermineSystem to check for a CMAKE_SYSTEM_VERSION setting even when CMAKE_SYSTEM_NAME is not set. This will allow builds on the host OS to target other versions of the OS without full cross-compiling.
* Allow CMAKE_TOOLCHAIN_FILE to be an empty stringAndrey Pokrovskiy2015-04-221-1/+1
| | | | | Do not try to include() an empty string in the generated CMakeSystem module.
* Fix CMAKE_HOST_SYSTEM_PROCESSOR detection on GNU/Hurd (#15147)Felix Geyer2014-09-101-1/+1
| | | | | On Debian GNU/Hurd 'uname -p' prints "unknown", so use 'uname -m' instead.
* Replace string(REGEX REPLACE) with string(REPLACE) where possibleRolf Eike Beer2014-04-141-2/+2
| | | | The simple replacement is much faster.
* OS X: Use 'uname -m' for processor (#14712)Brad King2014-01-201-1/+6
| | | | | | | | | | | | In commit 2412d9bc (Use 'uname -m' for processor on Cygwin, 2010-09-21) it was pointed out that POSIX requires 'uname -m' but not 'uname -p': http://www.opengroup.org/onlinepubs/9699919799/utilities/uname.html On OS X x86_64, 'uname -p' returns i386 while 'uname -m' returns x86_64. Since the latter is the POSIX-compliant option trust its value. However, on OS X ppc, 'uname -m' returns 'Power Macintosh' so add a special-case to convert that to 'powerpc'.
* Drop use of configure_file IMMEDIATE optionDaniele E. Domenichelli2013-11-131-1/+1
| | | | | | 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.
* fix Windows processor detectionRolf Eike Beer2013-03-061-1/+1
| | | | Thanks to Martin Koller for this.
* properly detect processor architecture on WindowsRolf Eike Beer2013-02-251-1/+5
| | | | | | | | CMake is usually run as a 32 bit process even on 64 bit Windows, so the PROCESSOR_ARCHITECTURE environment variable would always return x86. This post gives a description on how to do it properly: http://blogs.msdn.com/b/david.wang/archive/2006/03/26/howto-detect-process-bitness.aspx
* VS: Make DetermineCompilerId working with WinCE tooPatrick Gansterer2012-11-271-0/+6
| | | | | | Add a dummy mainCRTStartup() function, since the linker searches for it instead of main() and set the CMAKE_SYSTEM_* variables depending on the MSVC_C_ARCHITECTURE_ID and CMAKE_VS_WINCE_VERSION variables.
* Make platform information files specific to the CMake versionBrad King2012-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | At the top of a build tree we configure inside the CMakeFiles directory files such as "CMakeSystem.cmake" and "CMake<lang>Compiler.cmake" to save information detected about the system and compilers in use. The method of detection and the exact results store varies across CMake versions as things improve. This leads to problems when loading files configured by a different version of CMake. Previously we ignored such existing files only if the major.minor part of the CMake version component changed, and depended on the CMakeCache.txt to tell us the last version of CMake that wrote the files. This led to problems if the user deletes the CMakeCache.txt or we add required information to the files in a patch-level release of CMake (still a "feature point" release by modern CMake versioning convention). Ensure that we always have version-consistent platform information files by storing them in a subdirectory named with the CMake version. Every version of CMake will do its own system and compiler identification checks even when a build tree has already been configured by another version of CMake. Stored results will not clobber those from other versions of CMake which may be run again on the same tree in the future. Loaded results will match what the system and language modules expect. Rename the undocumented variable CMAKE_PLATFORM_ROOT_BIN to CMAKE_PLATFORM_INFO_DIR to clarify its purpose. The new variable points at the version-specific directory while the old variable did not.
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-23/+23
| | | | | | | | | | | | | | | | | Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Convert CMake-language commands to lower caseKitware Robot2012-08-131-86/+86
| | | | | | | | | | | | | | | | | Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code: cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-26/+26
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* OpenBSD: Use 'arch -s' for host processor (#12143)Brad King2011-05-021-2/+5
| | | | | | | On OpenBSD 'uname -p' returns a long descriptive name for the processor. Use 'arch -s' instead to get a short cpu name. Suggested-by: Stuart Henderson
* Use 'uname -m' for processor on Cygwin (#10774)Yaakov Selkowitz2010-09-211-3/+3
| | | | | | | | POSIX requires 'uname -m' but not 'uname -p': http://www.opengroup.org/onlinepubs/9699919799/utilities/uname.html Indeed Cygwin 'uname -p' returns "unknown".
* Modules: Fix spelling 'To distributed' -> 'To distribute'Todd Gamblin2010-08-091-1/+1
|
* Support GNU/kFreeBSDBrad King2009-10-051-0/+6
| | | | | | | | | | | | | GNU/kFreeBSD = FreeBSD kernel + userspace with glibc. Linux.cmake doesn't contain anything too OS specific, so we can forward to it. Here are outputs of /bin/uname on author's machine: uname -p ==> i386 uname -o ==> GNU/kFreeBSD uname -s ==> GNU/kFreeBSD uname -r ==> 5.4-1-686 Patch from Modestas Vainius. See issue #9659.
* Convert CMake non-find modules to BSD LicenseBrad King2009-09-281-0/+13
| | | | | | | This adds copyright/license notification blocks CMake's non-find modules. Most of the modules had no notices at all. Some had notices referring to the BSD license already. This commit normalizes existing notices and adds missing notices.
* STYLE: don't use an extra file to generate CMakeSystem.cmake but insteadAlexander Neundorf2007-08-151-19/+10
| | | | | | | configure the toolchain file into it if required -also search for nm, objdump and objcpy, so these can be used in macros Alex
* ENH: set UNIX, WIN32 and APPLE in cmMakefile.cxx as it was before, so itAlexander Neundorf2007-08-101-13/+0
| | | | | | | works for scripts, then reset them in CMakeSystemSpecificInformation.cxx, so the platform modules can set them again for the target system Alex
* ENH: UNIX, CYGWIN, WIN32, APPLE, QNXNTO and BEOS are not longer set inAlexander Neundorf2007-08-091-5/+18
| | | | | | | | | | | | | | cmMakefile.cxx, but now in the platform files and are now valid for the target platform, not the host platform. New variables CMAKE_HOST_WIN32, CMAKE_HOST_UNIX, CMAKE_HOST_APPLE and CMAKE_HOST_CYGWIN have been added in cmMakefile.cxx (...and have now to be used in all cmake files which are executed before CMakeSystemSpecificInformation.cmake is loaded). For compatibility the old set is set to the new one in CMakeDetermineSystem.cmake and reset before the system platform files are loaded, so custom language or compiler modules which use these should still work. Alex
* ENH: determine the current system also in cpack, so the search paths areAlexander Neundorf2007-07-241-32/+37
| | | | | | | | | | | loaded Additionally the makefile in cmCPackGenericGenerator is now protected instead of private, so with these two changes the cpack generators should now be able to find their tools and how to call these tools from cmake scripts, instead of hardcoding the search order and command line (as done e.g. in cmCPackZIPGenerator.cxx) Alex
* ENH: also load a processor-specific file if existsAlexander Neundorf2007-06-051-11/+22
| | | | | | | -also try the basename file if the compiler id file doesn't exist -don't rely so much on the CMAKE_TOOLCHAIN_FILE Alex
* ENH: always provide CMAKE_SYSTEM_XXX() and MAKE_HOST_SYSTEM_XXX() variables,Alexander Neundorf2007-05-291-59/+78
| | | | | | so when cross compiling the build host platform can be tested Alex
* BUG: now the toolchain file is configured into the buildtree, otherwise e.g.Alexander Neundorf2007-05-221-8/+17
| | | | | | | | | | | | | | | | | | CMAKE_SOURCE_DIR can't be used there ENH: modify CMakeCCompilerId.c and .h so that sdcc can compile them. As they were the preprocessor produced: 9 "test.c" static char const info_compiler[] = "INFO:compiler[" # 40 "test.c" "" "]"; and the mixing of the preprocessing directives and the string constants didn't work. Alex
* STYLE: use a separate source file for generating CMakeSystem.cmake if ↵Alexander Neundorf2007-05-211-2/+9
| | | | | | CMAKE_TOOLCHAIN_FILE is used Alex
* BUG: Use @ONLY substitution to configure CMakeSystem.cmake.Brad King2007-05-201-1/+1
|
* ENH: merge CMake-CrossCompileBasic to HEADAlexander Neundorf2007-05-171-28/+51
| | | | | | | | | | | | | | | | | | | | | | | | -add a RESULT_VARIABLE to INCLUDE() -add CMAKE_TOOLCHAIN_FILE for specifiying your (potentially crosscompiling) toolchain -have TRY_RUN() complain if you try to use it in crosscompiling mode (which were compiled but cannot run on this system) -use CMAKE_EXECUTABLE_SUFFIX in TRY_RUN(), probably TRY_RUN won't be able to run the executables if they have a different suffix because they are probably crosscompiled, but nevertheless it should be able to find them -make several cmake variables presettable by the user: CMAKE_C/CXX_COMPILER, CMAKE_C/CXX_OUTPUT_EXTENSION, CMAKE_SYSTEM_NAME, CMAKE_SYSTEM_INFO_FILE -support prefix for GNU toolchains (arm-elf-gcc, arm-elf-ar, arm-elf-strip etc.) -move ranlib on OSX from the file command to a command in executed in cmake_install.cmake -add support for stripping during install in cmake_install.cmake -split out cl.cmake from Windows-cl.cmake, first (very incomplete) step to support MS crosscompiling tools -remove stdio.h from the simple C program which checks if the compiler works, since this may not exist for some embedded platforms -create a new CMakeFindBinUtils.cmake which collects the search fro ar, ranlib, strip, ld, link, install_name_tool and other tools like these -add support for CMAKE_FIND_ROOT_PATH for all FIND_XXX commands, which is a list of directories which will be prepended to all search directories, right now as a cmake variable, turning it into a global cmake property may need some more work -remove cmTestTestHandler::TryExecutable(), it's unused -split cmFileCommand::HandleInstall() into slightly smaller functions Alex
* ENH: better processor detection on linuxBill Hoffman2007-02-211-6/+11
|
* ENH: centralized locaiton of CMakeFiles settingKen Martin2006-06-141-2/+3
|
* ENH: check return value for uname -pBill Hoffman2006-05-141-4/+4
|
* ENH: check return value for uname -pBill Hoffman2006-05-141-6/+9
|
* ENH: add documentation support for modulesBill Hoffman2005-12-141-0/+1
|
* ENH: put cmake files intoa CMakeFiles subdir to clean up bin treeKen Martin2005-07-291-2/+2
|