summaryrefslogtreecommitdiffstats
path: root/Source/cmGetFilenameComponentCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmSystemTools: Fix 'ErrorOccurred' spellingFeRD (Frank Dana)2022-06-131-2/+2
| | | | | | | | Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to 's_ErrorOccurred' and 's_FatalErrorOccurred', respectively. Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and 'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
* Rename cmProp in cmValueMarc Chevrier2021-09-211-2/+2
|
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-2/+3
|
* get_filename_component: make errors fatalAsit Dhal2020-06-181-0/+2
| | | | | | Make all errors in `get_filename_component` fatal. Fixes: #20015
* cmMakefile::AddCacheDefinition: Add overload that accepts std::string valueVitaly Stakhovsky2020-03-111-2/+2
|
* cmCommand refactor: cmGetFilenameComponentCommandGabor Bencze2019-08-201-13/+12
|
* Source sweep: Use cmIsOn instead of cmSystemTools::IsOnSebastian Holtermann2019-08-171-1/+1
| | | | | | | | | This replaces invocations of - `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn` - `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND` - `cmSystemTools::IsOn` with `cmIsOn` - `cmSystemTools::IsOff` with `cmIsOff`
* cmStringAlgorithms: cmIsSpace, cmTrimWhitespace, cmEscapeQuotes, cmTokenizeSebastian Holtermann2019-08-051-1/+2
| | | | | | | | | | This adds the following functions to `cmStringAlgorithms`: - `cmIsSpace` - `cmTrimWhitespace` (moved from `cmSystemTools::TrimWhitespace`) - `cmEscapeQuotes` (moved from `cmSystemTools::EscapeQuotes`) - `cmTokenize` (moved from `cmSystemTools::tokenize` and adapted to accept `cm::string_view`)
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-2/+2
| | | | | | | | | | | | | | | | This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value argument instead of a `const char *`. Benefits are: - `std::string` can be passed to `cmMakefile::AddDefinition` directly without the `c_str()` plus string length recomputation fallback. - Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at compile time. In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid `std::string::c_str` calls and the `std::string` is passed directly. Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
* cmGetFilenameComponentCommand: Add more componentsTushar Maheshwari2019-01-241-0/+4
| | | | | LAST_EXT: gets last extension from filename with multiple periods NAME_WLE: gets the name without the last extension
* Using front() and back() instead of calculationsCengizhan Pasaoglu2018-11-061-5/+5
|
* get_filename_component: Revise PROGRAM/PROGRAM_ARGS split semanticsBrad King2017-09-131-1/+24
| | | | | | | | | | | | | | | | | | | | The KWSys `SystemTools::SplitProgramFromArgs` implementation goes into an infinite loop when the value is just " " (a space). Since the "program path with unquoted spaces plus command-line arguments" operation it is trying to provide is poorly defined (string parsing should not depend on filesystem content), just stop using it. Instead consider the main two use cases the old approach tried to handle: * The value is the name or absolute path of a program with no quoting or escaping, but also no command-line arguments. In this case we can use the value as given with no parsing, and assume no arguments. * The value is a command-line string containing the program name/path plus arguments. In this case we now assume that the command line is properly quoted or escaped. Fixes: #17262
* Access string npos without instancePavel Solodovnikov2017-06-011-3/+3
|
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-0/+4
|
* cmState: Move CacheEntryType enum to separate namespaceStephen Kelly2016-10-191-6/+6
| | | | Port dependent code to the change.
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+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.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-79/+42
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* get_filename_component: Teach new BASE_DIR parameter.James Johnston2015-08-181-4/+16
| | | | | | In the get_filename_component command, add a new BASE_DIR parameter to use with the ABSOLUTE and REALPATH options. This will be used when finding an absolute path from a relative path.
* get_filename_component: Fix bug where CACHE was ignored.James Johnston2015-08-061-2/+2
| | | | | | | | | | If PROGRAM_ARGS is provided to get_filename_component, fix bug where the command failed to honor the CACHE argument. Added test cases to RunCMake.get_filename_component that fail when the bug is not fixed to prevent regressions. Signed-off-by: James Johnston <johnstonj.public@codenest.com>
* cmMakefile: Rename GetCurrent{,Source}Directory.Stephen Kelly2015-04-201-1/+1
| | | | Match the names used in cmake code.
* cmState: Move CacheEntryType enum from cmCacheManager.Stephen Kelly2015-04-131-4/+4
|
* Replace foo.size() pattern with !foo.empty().Stephen Kelly2015-01-181-2/+2
|
* Remove some unneeded c_str calls.Stephen Kelly2014-11-231-1/+1
|
* strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-2/+2
| | | | | Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.
* Remove some c_str() calls.Stephen Kelly2014-03-111-6/+6
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* get_filename_component: Add DIRECTORY option (#14091)Brad King2013-04-161-1/+1
| | | | | The name "PATH" is not precise so add equivalent option "DIRECTORY". Document the latter as preferred and the former as a legacy alias.
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-4/+4
| | | | | | | | | | | | | | | | | 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/ \+$//'
* Fix get_filename_component(... REALPATH) work dirBrad King2009-11-181-1/+1
| | | | | | | The commit "Fix get_filename_component ABSOLUTE mode" broke REALPATH treatment of relative paths because it stopped storing the absolute path in local variable 'filename'. This commit fixes the call to GetRealPath to use the proper local variable and adds a test.
* Fix get_filename_component() registry viewBrad King2009-09-301-1/+21
| | | | | | | Some find-modules use get_filename_component() to expand registry values. We need to look in both the 32-bit and 64-bit registry views when expanding values. We prefer the one that the target application would see. See issue #8792.
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* BUG: Fix get_filename_component ABSOLUTE modeBrad King2009-07-231-13/+3
| | | | | | | This teaches the command to recognize full windows paths when built on UNIX. CollapseFullPath knows when the input path is relative better than FileIsFullPath because the latter is only meant for paths from the host platform.
* ENH: Add get_filename_component(... REALPATH)Brad King2009-02-091-1/+7
| | | | | | | This patch from Philip Lowman creates a REALPATH mode in the get_filename_component command. It is like ABSOLUTE, but will also resolve symlinks (which ABSOLUTE once did but was broken long ago). See issue #8423.
* BUG: Alternative fix to bug #8423Brad King2009-02-061-2/+1
| | | | | | | | | The patch used to fix this bug used SystemTools::GetRealPath which works only for existing files. It broke the case of using the command get_filename_component for a non-existing file. Also, it changed long-standing behavior in a possibly incompatible way even for existing files. This reverts the original fix and instead updates the documentation to be consistent with the behavior.
* BUG: fix for #8423Bill Hoffman2009-01-291-1/+2
|
* ENH: add return and break support to cmake, also change basic command ↵Ken Martin2008-01-231-1/+1
| | | | invocation signature to be able to return extra informaiton via the cmExecutionStatus class
* STYLE: fix line lengthKen Martin2006-05-101-12/+12
|
* STYLE: some m_ to this-> cleanupKen Martin2006-03-151-6/+6
|
* BUG: ABSOLUTE option should evaluate relative paths with respect to ↵Brad King2006-01-311-0/+14
| | | | CMAKE_CURRENT_SOURCE_DIR. This addresses bug#2797.
* Several fixes/improvements:Brad King2003-02-071-1/+5
| | | | | | | | | | | | | - Fixed CollapseFullPath to work on relative paths with base paths not in the current working directory. - INCLUDE command now supports relative paths (using above fix). - Added ABSOLUTE option to GET_FILENAME_COMPONENT command to unwind symlinks and relative paths. - Fixed libName_EXPORTS macro definition to be valid C identifier. - Added DEFINE_SYMBOL target propterty for customizing the export symbol. - Implemented LINK_FLAGS target propterty for libraries in VC6 and VC7. Several of these fixes were contributed by Gareth Jones.
* ENH: add checking for NOTFOUNDBill Hoffman2003-01-311-1/+1
|
* FIX: this command was not processing its arg to expand registery valuesSebastien Barre2003-01-231-0/+1
|
* ERR: Fixed signed/unsigned warning.Brad King2002-11-201-1/+1
|
* allow flags to be in the CC and CXX environment variablesBill Hoffman2002-11-191-1/+29
|
* ENH: Added reference to Copyright.txt. Removed old reference to ITK ↵Brad King2002-10-231-3/+3
| | | | copyright. Changed program name to CMake instead of Insight in source file header. Also removed tabs.
* removed all source lists from the system and made them vectors. Also ↵Ken Martin2002-06-271-1/+1
| | | | appended _CMAKE_PATH to the end of the automatic cache entries for executables and libraries. Odds of all these changes working are slim but cmake builds and passes all its tests. VTK40 starts building
* ENH: expand variables in arguments before the commands get themBill Hoffman2002-03-051-1/+0
|
* ENH:Updated copyrightWill Schroeder2002-01-211-29/+5
|
* The result of this utility command can now be optionally added to the cacheSebastien Barre2001-10-231-1/+23
|
* ENH: change InitialPass to take a const reference to the argument string, to ↵Bill Hoffman2001-09-201-1/+1
| | | | avoid changes to the file cache