summaryrefslogtreecommitdiff
path: root/Modules/Platform/UnixPaths.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Find: Support per call disabling of CMAKE_INSTALL_PREFIXRobert Maynard2022-04-151-0/+1
| | | | Fixes #23359
* Conda: Add CONDA_PREFIX as an acceptable system prefix pathRobert Maynard2020-05-211-0/+4
|
* Document which environment variables effect CMAKE_SYSTEM_PREFIX_PATHRobert Maynard2020-05-191-0/+7
|
* Compilers: Add paths from -print-sysroot to system prefix pathRobert Maynard2020-04-141-0/+4
|
* Prefix implicit include directories with sysroot on constructionBrad King2019-02-181-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | Since commit 7cd65c97fa (Add CMAKE_SYSROOT variable to set --sysroot when cross compiling., 2013-04-13, v3.0.0-rc1~342^2) we have prefixed the value of `CMAKE_SYSROOT` to implicit include directories. This was done because we hard-coded `/usr/include` as an implicit include directory without accounting for the sysroot. Instead we should prefix the hard-coded paths when they are constructed. Update the `Platform/UnixPaths` module to do this as `Platform/Darwin` already does. Since commit 5990ecb741 (Compute implicit include directories from compiler output, 2018-12-07, v3.14.0-rc1~108^2) the values of the `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variables are computed from a real compiler invocation so they already account for the sysroot prefix. In commit 6fc3382944 (Update logic for sysroot in detected implicit include directories, 2019-02-13, v3.14.0-rc2~6^2) we attempted to apply the prefix conditionally, but that is incorrect because the compiler's real implicit include directories are not all under the sysroot. Instead assume that all implicit include directories in `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` already have the sysroot prefix if needed. Code that constructs the value must be responsible for that because it is the only place that knows.
* Fix regression in -I/usr/include exclusion logicBrad King2019-02-131-5/+0
| | | | | | | | | | | | | The change in commit 15ad830062 (Refactor exclusion of -I/usr/include to avoid per-language values, 2019-01-21, v3.14.0-rc1~108^2~4) caused the exclusion to apply to Fortran, but it was only meant for C, CXX, and CUDA. The purpose of the change was to prepare for the value of `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` to be computed from the actual compiler instead of hard-coded. We need to preserve exclusion of `-I/usr/include` if the compiler has any implicit include directory that looks intended to replace it, e.g. `<sdk>/usr/include` on macOS. Fixes: #18914
* ParseImplicitIncludeInfo: keep implicit incl. consistent when rerunning cmakeChuck Cranor2019-01-301-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first time you run cmake, it sets the implicit include path to the value reported by the parser (and this value gets saved in CMake${lang}Compiler.cmake). But if you re-run cmake, UnixPaths.cmake blindly appends an extra /usr/include to the value saved in CMake${lang}Compiler.cmake. That should not be harmful in most cases, but we want later runs of cmake to be consistent with the initial one. Resolve using a solution suggested by Brad King: - UnixPaths now sets the default implicit include path in a new variable named _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT This value is only used the first time cmake is run (by CMakeDetermineCompilerABI.cmake when it calls the implicit include parser). - if CMakeDetermineCompilerABI.cmake successfully calls the implicit include parser, it overwrites the value in _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT with the value returned by the parser - CMakeDetermineCompilerABI.cmake always sets CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES to the above value of _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT - the final value of CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES gets saved to CMake${lang}Compiler.cmake when it is regenerated after the compiler tests are done. - CMakeDetermineCompilerABI.cmake is only executed the first time cmake is run. Additional runs of cmake directly load the implicit include path from the value saved in CMake${lang}Compiler.cmake (the parser and _INIT variable are not used). The above depends on UnixPaths.cmake being loaded to set the _INIT value before CMakeDetermineCompilerABI.cmake runs the implicit include parser.
* Refactor exclusion of -I/usr/include to avoid per-language valuesBrad King2019-01-211-0/+7
| | | | | | | | | | | Add a `CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES` to contain the hard-coded list of paths to be excluded from `-I` arguments so that the values remain excluded even if the per-language `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variants change. This is needed to preserve our historical exclusion of `-I/usr/include` even when it is not a real implicit include directory. A policy may be needed to remove it later.
* CUDA: Treat /usr/include as an implicit include directoryBrad King2017-11-271-0/+3
| | | | | | We already do this for C and C++. Fixes: #17512
* Merge topic 'move-platform-specific-paths'Brad King2017-03-201-22/+9
|\ | | | | | | | | | | | | | | | | 0b668e52 Cygwin: Move Cygwin-specific paths to the cygwin platform 2a8c2af4 SunOS: Move solaris-specific paths to the solaris platform 7eb1f5b7 Unix: Consolidate path components into prefixes Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !589
| * Cygwin: Move Cygwin-specific paths to the cygwin platformChuck Atkins2017-03-161-6/+0
| |
| * SunOS: Move solaris-specific paths to the solaris platformChuck Atkins2017-03-161-2/+0
| |
| * Unix: Consolidate path components into prefixesChuck Atkins2017-03-161-16/+11
| |
* | Add support for x32-abiSteven Newbury2017-03-071-0/+1
|/ | | | | | | | Detect x32-abi through CMakeCompilerABI infrastruture and use this information at runtime to determine the correct library paths with `FIND_LIBRARY_USE_LIBX32_PATHS`. Fixes: #15994
* 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.
* Teach find_library and find_package to search lib32 paths (#11260)Daniel Scharrer2016-06-101-1/+2
| | | | | | | Add a ``FIND_LIBRARY_USE_LIB32_PATHS`` global property analogous to the ``FIND_LIBRARY_USE_LIB64_PATHS`` property. This helps find commands on multilib systems that use ``lib32`` directories and either do not have ``lib`` symlinks or point ``lib`` to ``lib64``.
* Drop /lib32 and /lib64 from link directories and RPATH (#14875)Brad King2014-04-161-1/+1
| | | | | | | Extend CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES with these paths. We already have the equivalents under /usr. Systems that have these directories have their dynamic loaders configured already. Do not allow them to appear in the RPATH explicitly.
* Introduce CMAKE_STAGING_PREFIX variable.Stephen Kelly2013-11-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Allow disabling adding the install prefix to the prefix search path.Stephen Kelly2013-10-311-3/+6
| | | | | | | 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.
* Convert CMake-language commands to lower caseKitware Robot2012-08-131-15/+15
| | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | | | 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/ \+$//'
* Search MacPorts /opt/local prefix on MacBrad King2010-09-011-2/+2
| | | | | | Include this prefix in CMAKE_SYSTEM_PREFIX_PATH so that it will be used for all find* commands. Previously only find_library and find_path would look under /opt/local/lib and /opt/local/include, respectively.
* Modules: Fix spelling 'To distributed' -> 'To distribute'Todd Gamblin2010-08-091-1/+1
|
* Search prefix /usr before root prefix /Brad King2010-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit "Find locally installed software first" made /usr/local the first prefix searched to be consistent with the Filesystem Hierarchy Standard: http://www.pathname.com/fhs/ The standard also implies that the root prefix "/" should not have any package or development files. The "/bin" and "/lib" directories should have only minimal contents to boot the system. No "/include" ever exists. This commit re-orders the search path prefix list from /usr/local / /usr to /usr/local /usr / to prefer package and development files over low-level system files. See issue #10136. On Cygwin /usr/lib == /lib and /usr/bin == /bin. This change also makes search results report locations as "/usr/..." instead of "/lib/...". See issue #10122.
* Avoid (Unix|Windows)Paths.cmake multiple includeBrad King2009-10-051-0/+10
| | | | | | | | | | Block multiple inclusion because "Modules/CMakeCInformation.cmake" includes "Platform/${CMAKE_SYSTEM_NAME}" even though the generic module "CMakeSystemSpecificInformation.cmake" already included it. The extra inclusion is a work-around to address issue #4772 without intrusive platform file changes. Once those changes are made the work-around and these include blockers can be removed. See issue #9656.
* Add copyright notice to (Unix|Windows)Paths.cmakeBrad King2009-10-051-0/+14
| | | | | This commit adds our copyright notice to these non-trivial platform modules.
* Find locally installed software firstBrad King2009-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | This commit re-orders the search path prefix list from / /usr /usr/local to /usr/local / /usr so that locally-installed software is preferred. This makes the search consistent with the Filesystem Hierarchy Standard: http://www.pathname.com/fhs/ See issue #9657.
* ENH: Re-enable system include dir suppressionBrad King2009-02-251-0/+7
| | | | | | | | | | | | | | | This creates variable CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES to specify implicit include directories on a per-language basis. This replaces the previous platform-wide variable. It is necessary to avoid explicit specification of -I/usr/include on some compilers (such as HP aCC) because: 1.) It may break ordering among system include directories defined internally by the compiler, thus getting wrong system headers. 2.) It tells the compiler to treat the system include directory as a user include directory, enabling warnings in the headers. See issue #8598.
* ENH: Rename SET_PROPERITES command to SET_PROPERTY and give it a more ↵Brad King2008-01-171-1/+1
| | | | powerful signature.
* ENH: Convert Modules/Platform specification of system search paths to use ↵Brad King2008-01-161-16/+17
| | | | CMAKE_SYSTEM_PREFIX_PATH when possible.
* ENH: UNIX, CYGWIN, WIN32, APPLE, QNXNTO and BEOS are not longer set inAlexander Neundorf2007-08-091-0/+2
| | | | | | | | | | | | | | 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:Alexander Neundorf2007-07-271-2/+7
| | | | | | | | -add /usr/openwin/include and /usr/openwin/lib to the default search paths -add /${CMAKE_INSTALL_PREFIX}/(lib|bin|include) to the default cmake search paths -> this should help users who install stuff in their home Alex
* ENH: also add the install base dir of the running cmake to the searchAlexander Neundorf2007-07-161-0/+8
| | | | | | | directories for the FIND_XXX() commands, for the case that somebody has its own install tree Alex
* ENH: Added global property FIND_LIBRARY_USE_LIB64_PATHS to allow lib64 paths ↵Brad King2007-06-271-0/+2
| | | | to be searched optionally. Turn off the feature on debian systems. This addresses debian report 419007.
* ENH: Use CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES from platform files to ↵Brad King2007-05-181-0/+6
| | | | block link directories.
* BUG: if /opt/lib and /opt/csw/lib are searched for libs, then /opt/includeAlexander Neundorf2007-04-301-0/+1
| | | | | | | and /opt/csw/include should also be searched for headers (according to google they also exist) Alex
* BUG: Header and library search path ordering should be consistent.Brad King2006-09-281-6/+32
|
* ENH: add /opt/local/includeBill Hoffman2006-03-271-1/+1
|
* ENH: add more search paths and add UnixPaths to all unix platformsBill Hoffman2006-03-271-3/+4
|
* BUG: Fix '/use/lib' to be '/usr/lib'.Brad King2006-03-241-1/+1
|
* ENH: check in new find stuffBill Hoffman2006-03-021-0/+5