Document try_compile behavior more clearly (#11688)

Explicitly state up front that the source-file form of the command links
an executable and expects a 'main' to be defined.  While at it, update
the command signature documentation to use a syntax more consistent with
other commands.  Also tweak some wording.
This commit is contained in:
Brad King 2011-01-12 08:13:15 -05:00
parent 90e9b65f10
commit 4da2a5687b
1 changed files with 23 additions and 18 deletions

View File

@ -47,7 +47,7 @@ public:
*/ */
virtual const char* GetTerseDocumentation() virtual const char* GetTerseDocumentation()
{ {
return "Try compiling some code."; return "Try building some code.";
} }
/** /**
@ -55,23 +55,28 @@ public:
virtual const char* GetFullDocumentation() virtual const char* GetFullDocumentation()
{ {
return return
" try_compile(RESULT_VAR bindir srcdir\n" " try_compile(RESULT_VAR <bindir> <srcdir>\n"
" projectName <targetname> [CMAKE_FLAGS <Flags>]\n" " <projectName> [targetName] [CMAKE_FLAGS flags...]\n"
" [OUTPUT_VARIABLE var])\n" " [OUTPUT_VARIABLE <var>])\n"
"Try compiling a program. In this form, srcdir should contain a " "Try building a project. In this form, srcdir should contain a "
"complete CMake project with a CMakeLists.txt file and all sources. The " "complete CMake project with a CMakeLists.txt file and all sources. "
"bindir and srcdir will not be deleted after this command is run. " "The bindir and srcdir will not be deleted after this command is run. "
"If <target name> is specified then build just that target " "Specify targetName to build a specific target instead of the 'all' or "
"otherwise the all or ALL_BUILD target is built.\n" "'ALL_BUILD' target."
" try_compile(RESULT_VAR bindir srcfile\n" "\n"
" [CMAKE_FLAGS <Flags>]\n" " try_compile(RESULT_VAR <bindir> <srcfile>\n"
" [COMPILE_DEFINITIONS <flags> ...]\n" " [CMAKE_FLAGS flags...]\n"
" [OUTPUT_VARIABLE var]\n" " [COMPILE_DEFINITIONS flags...]\n"
" [COPY_FILE <filename> )\n" " [OUTPUT_VARIABLE <var>]\n"
"Try compiling a srcfile. In this case, the user need only supply a " " [COPY_FILE <fileName>])\n"
"source file. CMake will create the appropriate CMakeLists.txt file " "Try building a source file into an executable. "
"to build the source. If COPY_FILE is used, the compiled file will be " "In this form the user need only supply a source file that defines "
"copied to the given file.\n" "a 'main'. "
"CMake will create a CMakeLists.txt file to build the source "
"as an executable. "
"Specify COPY_FILE to get a copy of the linked executable at the "
"given fileName."
"\n"
"In this version all files in bindir/CMakeFiles/CMakeTmp, " "In this version all files in bindir/CMakeFiles/CMakeTmp, "
"will be cleaned automatically, for debugging a --debug-trycompile can " "will be cleaned automatically, for debugging a --debug-trycompile can "
"be passed to cmake to avoid the clean. Some extra flags that " "be passed to cmake to avoid the clean. Some extra flags that "