summaryrefslogtreecommitdiff
path: root/Source/cmTryRunCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-3/+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.
* Source: std::string related cleanupVitaly Stakhovsky2019-05-151-9/+9
|
* Merge topic 'cmrange-improvements'Brad King2019-02-251-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | b8031308f3 cmRange: Add unit tests a8d51ef8b7 cmRange: Add functions filter and transform da4773e8b8 cmRange: Add functions all_of, any_of, none_of 17a367e77f cmRange: Stylistic cleanup 9eb0e73f46 cmRange: Move to dedicated header file Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Artur Ryt <artur.ryt@gmail.com> Merge-request: !2972
| * cmRange: Move to dedicated header fileRegina Pfeifer2019-02-211-1/+1
| |
* | cmSystemTools: More functions accept `std::string` paramsVitaly Stakhovsky2019-02-201-3/+2
|/
* Merge topic 'modernize-for-loops'Brad King2019-02-111-4/+3
|\ | | | | | | | | | | | | | | | | 01b2d6ab74 Modernize: Use ranged for-loops when possible 15bdbec017 cmAlgorithms: Make cmRange advance/retreat safe for rvalues Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Merge-request: !2901
| * Modernize: Use ranged for-loops when possibleArtur Ryt2019-02-071-4/+3
| | | | | | | | | | | | | | Replaced most manual `const_iterator`-based loops and some reverse-iterator loops with range loops. Fixes: #18858
* | cmSystemTools::RunSingleCommand: Accept std::string argumentVitaly Stakhovsky2019-02-061-2/+2
|/
* Merge topic 'cmake-files-directory'Brad King2019-01-251-1/+1
|\ | | | | | | | | | | | | | | 3e867ed400 cmake: inlined files dir constant and removed it from cmake.h Acked-by: Kitware Robot <kwrobot@kitware.com> Rejected-by: vvs31415 <vstakhovsky@fastmail.com> Merge-request: !2655
| * cmake: inlined files dir constant and removed it from cmake.hBruno Manganelli2019-01-211-1/+1
| |
* | cmSystemTools::Error(): new overload accepting std::stringVitaly Stakhovsky2019-01-231-2/+2
| |
* | clang-tidy: Use emplaceRegina Pfeifer2019-01-171-2/+2
|/
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-1/+2
| | | | Reduce the number of files relying on `cmake.h`.
* try_compile/try_run: Add support for LINK_OPTIONS option.Marc Chevrier2018-12-011-1/+2
|
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-1/+1
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* Make use of std::chrono throughout every componentWouter Klouwen2018-01-231-2/+2
| | | | | | | | This commit continues the changes made in CTest to support std::chrono by applying it throughout every component where a duration was used. No functional change intended.
* TryRun: do not call strcpy()Rolf Eike Beer2017-10-081-4/+5
|
* Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-161-5/+5
|
* Use C++11 nullptrDaniel Pfeifer2017-08-241-11/+10
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Use the empty method to check for emptinessDaniel Pfeifer2016-10-301-2/+3
|
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-2/+8
|
* Separate compilation for commands included in cmBootstrapCommands2Daniel Pfeifer2016-10-211-0/+3
|
* cmState: Move CacheEntryType enum to separate namespaceStephen Kelly2016-10-191-5/+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.
* use CM_NULLPTRDaniel Pfeifer2016-06-281-12/+13
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-173/+116
| | | | | | | | | | | | | 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.
* Isolate formatted streaming blocks with clang-format off/onBrad King2016-05-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clang-format tool can do a good job formatting most code, but well-organized streaming blocks are best left manually formatted. Find blocks of the form os << "...\n" "...\n" ; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}' Find blocks of the form os << "...\n" << "...\n" << "...\n"; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}' Surround such blocks with the pair /* clang-format off */ ... /* clang-format on */ in order to protect them from update by clang-format. Use the C-style `/*...*/` comments instead of C++-style `//...` comments in order to prevent them from ever being swallowed by re-formatting of surrounding comments.
* 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.
* try_compile: Add option to control type of targetBrad King2016-02-191-1/+1
| | | | | | | Create a `CMAKE_TRY_COMPILE_TARGET_TYPE` option to specify use of `add_library(... STATIC ...)` for the generated test project. This will be useful for cross-compiling toolchains that cannot link a binary without custom flags or scripts.
* cmMakefile: Rename method to something more appropriate.Stephen Kelly2015-05-191-1/+1
| | | | Allow the name to be used for something more-suitable.
* cmSystemTools: Teach RunSingleCommand to separate stdout and stderrBrad King2015-04-201-1/+1
| | | | | | | Extend the RunSingleCommand signature to capture stdout and stderr separately. Allow both to be captured to the same std::string to preserve existing behavior. Update all call sites to do this so that this refactoring does not introduce functional changes.
* Merge topic 'introduce-cmState'Brad King2015-04-131-11/+10
|\ | | | | | | | | | | | | | | f081c5bd cmState: Move CacheEntryType enum from cmCacheManager. f71fdf0e cmMakefile: Remove unused CacheManager accessor. ff7169a0 Port to cmState. a6b1ad13 Introduce cmState class.
| * cmState: Move CacheEntryType enum from cmCacheManager.Stephen Kelly2015-04-131-4/+3
| |
| * Port to cmState.Stephen Kelly2015-04-131-7/+7
| |
* | Merge topic 'refactor-cache-api'Brad King2015-04-091-8/+11
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | ba404938 cmCacheManager: Port consumers to non-iterator API. f3922a9a Port QtDialog to non-iterator cache API. 3e6a76e4 Port CursesDialog to non-iterator cache API. 9e641567 cmMakefile: Port away from CacheEntry.Initialized. 1e2dbfce cmCacheManager: Add non-iterator-based API. 60a62a91 cmCacheManager: Return a C string from GetValue. 77f2807c cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue. 14973054 Add API for cache loading, deleting and saving to the cmake class. 1f2c12eb cmMakefile: Remove cache version accessors. 97c50a8d cmMakefile: Simplify GetDefinitions implementation.
| * cmCacheManager: Port consumers to non-iterator API.Stephen Kelly2015-04-081-8/+11
| | | | | | | | | | This simplifies reasoning about the follow-up commit which ports away from cmCacheManager to a class with the same method names.
| * Revert topic 'refactor-cache-api'Brad King2015-04-071-11/+8
| | | | | | | | | | | | This topic was never tested without some follow-up commits. The GetCacheEntryValue API returns a pointer to memory freed on return. It will have to be revised along with the rest of the original topic.
| * cmCacheManager: Port consumers to non-iterator API.Stephen Kelly2015-04-061-8/+11
| | | | | | | | | | This simplifies reasoning about the follow-up commit which ports away from cmCacheManager to a class with the same method names.
* | try_run: Use CMAKE_CROSSCOMPILING_EMULATOR.Matt McCormick2015-04-081-2/+24
|/ | | | | | | If the CMAKE_CROSSCOMPILING_EMULATOR variable is defined, and CMAKE_CROSSCOMPILING is TRUE, then use CMAKE_CROSSCOMPILING_EMULATOR to run the try_run executables. This prevents the need to populate TryRunResults.cmake when cross compiling.
* Merge topic 'try-run-link-libraries'Brad King2015-01-261-1/+2
|\ | | | | | | | | | | | | d0adcccb try_run: Add tests for LINK_LIBRARIES with mock libraries. 223c5cb7 try_run: Add test for bad link libraries. e2b1f058 try_run: Add support for LINK_LIBRARIES option.
| * try_run: Add support for LINK_LIBRARIES option.Matt McCormick2015-01-261-1/+2
| | | | | | | | | | | | | | | | Most functionality is already implemented in Source/cmCoreTryCompile.{h,cxx}. Document and improve argument parsing. This functionality is already being used by a number of modules, like CheckCSourceCompiles.cmake, but it is not documented.
* | Replace foo.size() pattern with !foo.empty().Stephen Kelly2015-01-181-8/+8
| |
* | Replace 'foo.size() == 0' pattern with foo.empty().Stephen Kelly2015-01-181-1/+1
|/
* strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-1/+1
| | | | | 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-13/+13
| | | | | | 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.
* Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.Clinton Stimpson2014-01-071-1/+2
| | | | | Also use SystemTools::Fopen() instead of fopen(). This is to eventually support utf-8 filenames.
* Generate modern-style cmake code.Stephen Kelly2013-08-221-2/+2
| | | | | | | | | | | The commits 9db31162 (Remove CMake-language block-end command arguments, 2012-08-13) and 77543bde (Convert CMake-language commands to lower case, 2012-08-13) changed most cmake code to use lowercase commands and no parameters in termination commands. However, those changes excluded cmake code generated in c++ by cmake. Make a similar style change to code generated by cmake.
* Use makefile->IssueMessage() for better error messagesAlex Neundorf2011-09-271-1/+1
| | | | Alex
* Improve behaviour of --find-package mode with try_run/try_compileAlex Neundorf2011-09-151-0/+8
| | | | | | | | Instead of failing with an error message which says things have not been setup correctly, it now says that try_compile/try_run() are not supported in find_package mode (#12426). Alex