ENH: Enforce global target name uniqueness.

- Error if imported target is involved in conflict
  - Error for non-imported target conflict unless
    CMAKE_BACKWARDS_COMPATIBILITY <= 2.4
  - Include OUTPUT_NAME property in error message
  - Update add_executable and add_library command documentation
This commit is contained in:
Brad King
2008-02-11 13:35:39 -05:00
parent 739a463539
commit ac0e58dcfb
8 changed files with 146 additions and 73 deletions

View File

@@ -63,33 +63,36 @@ public:
virtual const char* GetFullDocumentation()
{
return
" add_executable(exename [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL]\n"
" add_executable(<name> [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL]\n"
" source1 source2 ... sourceN)\n"
"This command adds an executable target to the current directory. "
"The executable will be built from the list of source files "
"specified.\n"
"After specifying the executable name, WIN32 and/or MACOSX_BUNDLE can "
"be specified. WIN32 indicates that the executable (when compiled on "
"windows) is a windows app (using WinMain) not a console app "
"(using main). The variable CMAKE_MFC_FLAG be used if the windows app "
"uses MFC. This variable can be set to the following values:\n"
" 0: Use Standard Windows Libraries\n"
" 1: Use MFC in a Static Library\n"
" 2: Use MFC in a Shared DLL\n"
"MACOSX_BUNDLE indicates that when build on Mac OSX, executable should "
"be in the bundle form. The MACOSX_BUNDLE also allows several "
"variables to be specified:\n"
" MACOSX_BUNDLE_INFO_STRING\n"
" MACOSX_BUNDLE_ICON_FILE\n"
" MACOSX_BUNDLE_GUI_IDENTIFIER\n"
" MACOSX_BUNDLE_LONG_VERSION_STRING\n"
" MACOSX_BUNDLE_BUNDLE_NAME\n"
" MACOSX_BUNDLE_SHORT_VERSION_STRING\n"
" MACOSX_BUNDLE_BUNDLE_VERSION\n"
" MACOSX_BUNDLE_COPYRIGHT\n"
"If EXCLUDE_FROM_ALL is given the target will not be built by default. "
"It will be built only if the user explicitly builds the target or "
"another target that requires the target depends on it."
"Adds an executable target called <name> to be built from the "
"source files listed in the command invocation. "
"The <name> corresponds to the logical target name and must be "
"globally unique within a project. "
"The actual file name of the executable built is constructed based on "
"conventions of the native platform "
"(such as <name>.exe or just <name>). "
"\n"
"By default the executable file will be created in the build tree "
"directory corresponding to the source tree directory in which "
"the command was invoked. "
"See documentation of the RUNTIME_OUTPUT_DIRECTORY "
"target property to change this location. "
"See documentation of the OUTPUT_NAME target property to change "
"the <name> part of the final file name. "
"\n"
"If WIN32 is given the property WIN32_EXECUTABLE will be set on the "
"target created. "
"See documentation of that target property for details."
"\n"
"If MACOSX_BUNDLE is given the corresponding property will be "
"set on the created target. "
"See documentation of the MACOSX_BUNDLE target property for details."
"\n"
"If EXCLUDE_FROM_ALL is given the corresponding property will be "
"set on the created target. "
"See documentation of the EXCLUDE_FROM_ALL target property for "
"details."
"\n"
"The add_executable command can also create IMPORTED executable "
"targets using this signature:\n"