summaryrefslogtreecommitdiffstats
path: root/Source/cmTryRunCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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-151-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
* Remove trailing whitespaceAlex Neundorf2011-09-151-13/+13
| | | | Alex
* RunSingleCommand: Replace verbose boolean with enumJohan Björk2011-07-281-1/+1
| | | | | No behaviour change, this prepares for adding a flag to skip the merging of output streams.
* Fix spelling errors reported by Lintian.Kai Wasserbäch2010-07-131-1/+1
| | | | | During a Lintian run on the binary packages of CMake in Debian I was notified of many spelling mistakes.
* 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.
* ENH: add return and break support to cmake, also change basic command ↵Ken Martin2008-01-231-2/+3
| | | | invocation signature to be able to return extra informaiton via the cmExecutionStatus class
* STYLE: copy the executables from TRY_RUN() toAlexander Neundorf2007-09-171-0/+1
| | | | | | ${CMAKE_BINARY_DIR}/CMakeFiles/ instead to ${CMAKE_BINARY_DIR} Alex
* ENH: if no COMPONENT is specified, make this install item part of theAlexander Neundorf2007-08-011-2/+2
| | | | | | | | | | | | | "Unspecified" component -> if no components are used at all, no change in behaviour, if components are used completely, no change in behaviour, since this default will be overridden everywhere, if components where used partly, it is now possible to install only the unspecified items (e.g. everything which wasn't marked as "Development") Alex Alex
* STYLE: some more tuning for the comment textAlexander Neundorf2007-08-011-11/+10
| | | | Alex
* ENH: add tests for check_c_source_runs(), check_cxx_source_runs(),Alexander Neundorf2007-07-311-53/+50
| | | | | | | | check_c_source_compiles() and check_cxx_source_compiles() -TRY_RUN in crosscompiling mode: copy the created executables to CMAKE_BINARY_DIR so the user can run them manually on the target Alex
* ENH: FORCE the values in the cache, otherwise the file is uselessAlexander Neundorf2007-07-301-2/+2
| | | | Alex
* STYLE: fix line lengthsAlexander Neundorf2007-07-261-1/+2
| | | | Alex
* STYLE: put a lot of comments into the generated cmake-cache preloading file ↵Alexander Neundorf2007-07-231-15/+48
| | | | | | to aid the user with using it Alex
* ENH: try to create a file which can be used for presetting the cache valuesAlexander Neundorf2007-07-231-0/+20
| | | | | | of the TRY_RUN() results when crosscompiling Alex
* ENH: improve TRY_RUN() for crosscompiling: instead of just failing, it nowAlexander Neundorf2007-06-011-41/+242
| | | | | | | | | | | | | | | creates two cache variables, one for the RUN_RESULT, one for the RUN_OUTPUT (if required), which can be set or preset by the user. It has now also two new arguments: RUN_OUTPUT_VARIABLE and COMPILE_OUTPUT_VARIABLE (the old OUTPUT_VARIABLE merges both), so if only COMPILE_OUTPUT_VARIABLE is used the run time output of the TRY_RUN is unused and the user doesn't have to care about the output when crosscompiling. This is now used in FindThreads.cmake, CheckC/CXXSourceRuns.cmake and TestBigEndian.cmake, which used the output only for the logfile (compile output is still there). Test/TryCompile/ now also tests the behaviour of OUTPUT_VARIABLE, RUN_OUTPUT_VARIABLE and COMPILE_OUTPUT_VARIABLE. Alex