diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeVersion.cmake | 4 | ||||
-rw-r--r-- | Source/CTest/cmParseGTMCoverage.cxx | 4 | ||||
-rw-r--r-- | Source/cmDocumentGeneratorExpressions.h | 3 | ||||
-rw-r--r-- | Source/cmDocumentVariables.cxx | 114 | ||||
-rw-r--r-- | Source/cmDocumentation.cxx | 4 | ||||
-rw-r--r-- | Source/cmExportInstallFileGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 19 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 35 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 6 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 12 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 23 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 88 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 18 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 58 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 10 | ||||
-rw-r--r-- | Source/cmPolicies.cxx | 64 | ||||
-rw-r--r-- | Source/cmQtAutomoc.cxx | 46 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 14 |
19 files changed, 359 insertions, 167 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index be882a5..e7d0bb7 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,6 +1,6 @@ # CMake version number components. set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) -set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130828) +set(CMake_VERSION_PATCH 12) +set(CMake_VERSION_TWEAK 20131007) #set(CMake_VERSION_RC 1) diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx index 5dfcfe5..6b4adb4 100644 --- a/Source/CTest/cmParseGTMCoverage.cxx +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -98,7 +98,7 @@ bool cmParseGTMCoverage::ReadMCovFile(const char* file) bool found = this->FindMumpsFile(routine, filepath); if(found) { - int lineoffset; + int lineoffset = 0; if(this->FindFunctionInMumpsFile(filepath, function, lineoffset)) @@ -106,8 +106,8 @@ bool cmParseGTMCoverage::ReadMCovFile(const char* file) cmCTestCoverageHandlerContainer::SingleFileCoverageVector& coverageVector = this->Coverage.TotalCoverage[filepath]; coverageVector[lineoffset + linenumber] += count; + lastoffset = lineoffset; } - lastoffset = lineoffset; } else { diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h index 46cd77e..7bab741 100644 --- a/Source/cmDocumentGeneratorExpressions.h +++ b/Source/cmDocumentGeneratorExpressions.h @@ -40,6 +40,9 @@ "is exported using export(), or when the target is used by another " \ "target in the same buildsystem. Expands to the empty string " \ "otherwise.\n" \ + " $<PLATFORM_ID> = The CMake-id of the platform " \ + " $<PLATFORM_ID:comp> = '1' if the The CMake-id of the " \ + "platform matches comp, otherwise '0'.\n" \ " $<C_COMPILER_ID> = The CMake-id of the C compiler " \ "used.\n" \ " $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C " \ diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 2c2d377..54f41af 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -19,7 +19,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "The full path to the cmake executable.", "This is the full path to the CMake executable cmake which is " "useful from custom commands that want to use the cmake -E " - "option for portable system commands. " + "option for portable system commands. " "(e.g. /usr/local/bin/cmake", false, "Variables that Provide Information"); cm->DefineProperty @@ -27,14 +27,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "The path to the top level of the build tree.", "This is the full path to the top level of the current CMake " "build tree. For an in-source build, this would be the same " - "as CMAKE_SOURCE_DIR. ", false, + "as CMAKE_SOURCE_DIR.", false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_SOURCE_DIR", cmProperty::VARIABLE, "The path to the top level of the source tree.", "This is the full path to the top level of the current CMake " "source tree. For an in-source build, this would be the same " - "as CMAKE_BINARY_DIR. ", false, + "as CMAKE_BINARY_DIR.", false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_CURRENT_BINARY_DIR", cmProperty::VARIABLE, @@ -42,7 +42,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "This the full path to the build directory that is currently " "being processed by cmake. Each directory added by " "add_subdirectory will create a binary directory in the build " - "tree, and as it is being processed this variable will be set. " + "tree, and as it is being processed this variable will be set. " "For in-source builds this is the current source directory " "being processed.", false, "Variables that Provide Information"); @@ -100,7 +100,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_SCRIPT_MODE_FILE", cmProperty::VARIABLE, - "Full path to the -P script file currently being processed. ", + "Full path to the -P script file currently being processed.", "When run in -P script mode, CMake sets this variable to the full " "path of the script file. When run to configure a CMakeLists.txt " "file, this variable is not set.", false, @@ -108,14 +108,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_ARGC", cmProperty::VARIABLE, - "Number of command line arguments passed to CMake in script mode. ", + "Number of command line arguments passed to CMake in script mode.", "When run in -P script mode, CMake sets this variable to the number " - "of command line arguments. See also CMAKE_ARGV0, 1, 2 ... ", false, + "of command line arguments. See also CMAKE_ARGV0, 1, 2 ...", false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_ARGV0", cmProperty::VARIABLE, - "Command line argument passed to CMake in script mode. ", + "Command line argument passed to CMake in script mode.", "When run in -P script mode, CMake sets this variable to " "the first command line argument. It then also sets CMAKE_ARGV1, " "CMAKE_ARGV2, ... and so on, up to the number of command line arguments " @@ -133,7 +133,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "and for Visual Studio 7 it set to devenv. For " "NMake Makefiles the value is nmake. This can be " "useful for adding special flags and commands based" - " on the final build environment. ", false, + " on the final build environment.", false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_CROSSCOMPILING", cmProperty::VARIABLE, @@ -393,7 +393,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_SOURCE_DIR", cmProperty::VARIABLE, "Source directory for project.", - "This is the top level source directory for the project. " + "This is the top level source directory for the project. " "It corresponds to the source directory given to " "cmake-gui or ccmake.",false, "Variables that Provide Information"); @@ -419,7 +419,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("PROJECT_NAME", cmProperty::VARIABLE, "Name of the project given to the project command.", "This is the name given to the most " - "recent PROJECT command. ",false, + "recent PROJECT command.",false, "Variables that Provide Information"); cm->DefineProperty ("PROJECT_SOURCE_DIR", cmProperty::VARIABLE, @@ -550,7 +550,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "By default, automoc behaves exactly as described in the documentation " "of the AUTOMOC target property. " "When set to TRUE, it accepts more input and tries to find the correct " - "input file for moc even if it differs from the documented behaviour. " + "input file for moc even if it differs from the documented behaviour. " "In this mode it e.g. also checks whether a header file is intended to " "be processed by moc when a \"foo.moc\" file has been included.\n" "Relaxed mode has to be enabled for KDE4 compatibility.", @@ -563,7 +563,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "If an install() command is used without the COMPONENT argument, " "these files will be grouped into a default component. The name of this " "default install component will be taken from this variable. " - "It defaults to \"Unspecified\". ", + "It defaults to \"Unspecified\".", false, "Variables That Change Behavior"); @@ -591,9 +591,9 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_CONFIGURATION_TYPES", cmProperty::VARIABLE, "Specifies the available build types on multi-config generators.", "This specifies what build types (configurations) will be available " - "such as Debug, Release, RelWithDebInfo etc. " + "such as Debug, Release, RelWithDebInfo etc. " "This has reasonable defaults on most platforms, " - "but can be extended to provide other build types. " + "but can be extended to provide other build types. " "See also CMAKE_BUILD_TYPE for details of managing configuration data, " "and CMAKE_CFG_INTDIR." ,false, @@ -604,20 +604,20 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Specifies the build type on single-configuration generators.", "This statically specifies what build type (configuration) " "will be built in this build tree. Possible values are " - "empty, Debug, Release, RelWithDebInfo and MinSizeRel. " + "empty, Debug, Release, RelWithDebInfo and MinSizeRel. " "This variable is only meaningful to single-configuration generators " "(such as make and Ninja) i.e. " "those which choose a single configuration " "when CMake runs to generate a build tree as opposed to " "multi-configuration generators which offer selection of the build " - "configuration within the generated build environment. " + "configuration within the generated build environment. " "There are many per-config properties and variables " "(usually following clean SOME_VAR_<CONFIG> order conventions), " "such as CMAKE_C_FLAGS_<CONFIG>, specified as uppercase: " - "CMAKE_C_FLAGS_[DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL]. " + "CMAKE_C_FLAGS_[DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL]. " "For example, in a build tree configured " "to build type Debug, CMake will see to having " - "CMAKE_C_FLAGS_DEBUG settings get added to the CMAKE_C_FLAGS settings. " + "CMAKE_C_FLAGS_DEBUG settings get added to the CMAKE_C_FLAGS settings. " "See also CMAKE_CONFIGURATION_TYPES." ,false, "Variables That Change Behavior"); @@ -643,10 +643,10 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "directories. This variable defaults to /usr/local" " on UNIX and c:/Program Files on Windows.\n" "On UNIX one can use the DESTDIR mechanism in order" - " to relocate the whole installation. " + " to relocate the whole installation. " "DESTDIR means DESTination DIRectory. It is " "commonly used by makefile users " - "in order to install software at non-default location. " + "in order to install software at non-default location. " "It is usually invoked like this:\n" " make DESTDIR=/home/john install\n" "which will install the concerned software using the" @@ -665,10 +665,10 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY", cmProperty::VARIABLE, "Don't make the install target depend on the all target.", - "By default, the \"install\" target depends on the \"all\" target. " + "By default, the \"install\" target depends on the \"all\" target. " "This has the effect, that when \"make install\" is invoked or INSTALL " "is built, first the \"all\" target is built, then the installation " - "starts. " + "starts. " "If CMAKE_SKIP_INSTALL_ALL_DEPENDENCY is set to TRUE, this dependency " "is not created, so the installation process will start immediately, " "independent from whether the project has been completely built or not." @@ -769,9 +769,9 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "directories contain incompatible but possibly linkable libraries. For " "example, on cross-compiled cluster environments, this allows a user to " "ignore directories containing libraries meant for the front-end " - "machine that modules like FindX11 (and others) would normally search. " + "machine that modules like FindX11 (and others) would normally search. " "By default this contains a list of directories containing incompatible " - "binaries for the host system. " + "binaries for the host system. " "See also CMAKE_SYSTEM_PREFIX_PATH, CMAKE_SYSTEM_LIBRARY_PATH, " "CMAKE_SYSTEM_INCLUDE_PATH, and CMAKE_SYSTEM_PROGRAM_PATH.", false, "Variables That Change Behavior"); @@ -785,11 +785,11 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "directories contain incompatible but possibly linkable libraries. For " "example, on cross-compiled cluster environments, this allows a user to " "ignore directories containing libraries meant for the front-end " - "machine that modules like FindX11 (and others) would normally search. " - "By default this is empty; it is intended to be set by the project. " + "machine that modules like FindX11 (and others) would normally search. " + "By default this is empty; it is intended to be set by the project. " "Note that CMAKE_IGNORE_PATH takes a list of directory names, NOT a " "list of prefixes. If you want to ignore paths under prefixes (bin, " - "include, lib, etc.), you'll need to specify them explicitly. " + "include, lib, etc.), you'll need to specify them explicitly. " "See also CMAKE_PREFIX_PATH, CMAKE_LIBRARY_PATH, CMAKE_INCLUDE_PATH, " "CMAKE_PROGRAM_PATH.", false, "Variables That Change Behavior"); @@ -836,7 +836,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "although that package is installed.\n" "This switch should be used during the initial CMake run. Otherwise if " "the package has already been found in a previous CMake run, the " - "variables which have been stored in the cache will still be there. " + "variables which have been stored in the cache will still be there. " "In that case it is recommended to remove the cache variables for " "this package from the cache using the cache editor or cmake -U", false, "Variables That Change Behavior"); @@ -923,7 +923,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_COLOR_MAKEFILE", cmProperty::VARIABLE, "Enables color output when using the Makefile generator.", - "When enabled, the generated Makefiles will produce colored output. " + "When enabled, the generated Makefiles will produce colored output. " "Default is ON.",false, "Variables That Change Behavior"); @@ -975,7 +975,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Name of system cmake is compiling for.", "This variable is the composite of CMAKE_SYSTEM_NAME " "and CMAKE_SYSTEM_VERSION, like this " - "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_VERSION}. " + "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_VERSION}. " "If CMAKE_SYSTEM_VERSION is not set, then " "CMAKE_SYSTEM is the same as CMAKE_SYSTEM_NAME.",false, "Variables That Describe the System"); @@ -1237,7 +1237,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_INSTALL_RPATH", cmProperty::VARIABLE, "The rpath to use for installed targets.", "A semicolon-separated list specifying the rpath " - "to use in installed targets (for platforms that support it). " + "to use in installed targets (for platforms that support it). " "This is used to initialize the target property " "INSTALL_RPATH for all targets.", false, @@ -1248,7 +1248,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Add paths to linker search and installed rpath.", "CMAKE_INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to true " "will append directories in the linker search path and outside the " - "project to the INSTALL_RPATH. " + "project to the INSTALL_RPATH. " "This is used to initialize the target property " "INSTALL_RPATH_USE_LINK_PATH for all targets.", false, @@ -1267,7 +1267,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_Fortran_FORMAT", cmProperty::VARIABLE, "Set to FIXED or FREE to indicate the Fortran source layout.", "This variable is used to initialize the Fortran_FORMAT " - "property on all the targets. " + "property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1276,7 +1276,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_Fortran_MODULE_DIRECTORY", cmProperty::VARIABLE, "Fortran module output directory.", "This variable is used to initialize the " - "Fortran_MODULE_DIRECTORY property on all the targets. " + "Fortran_MODULE_DIRECTORY property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1285,7 +1285,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_LIBRARY_OUTPUT_DIRECTORY", cmProperty::VARIABLE, "Where to put all the LIBRARY targets when built.", "This variable is used to initialize the " - "LIBRARY_OUTPUT_DIRECTORY property on all the targets. " + "LIBRARY_OUTPUT_DIRECTORY property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1294,7 +1294,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_ARCHIVE_OUTPUT_DIRECTORY", cmProperty::VARIABLE, "Where to put all the ARCHIVE targets when built.", "This variable is used to initialize the " - "ARCHIVE_OUTPUT_DIRECTORY property on all the targets. " + "ARCHIVE_OUTPUT_DIRECTORY property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1303,7 +1303,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_RUNTIME_OUTPUT_DIRECTORY", cmProperty::VARIABLE, "Where to put all the RUNTIME targets when built.", "This variable is used to initialize the " - "RUNTIME_OUTPUT_DIRECTORY property on all the targets. " + "RUNTIME_OUTPUT_DIRECTORY property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1312,7 +1312,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_PDB_OUTPUT_DIRECTORY", cmProperty::VARIABLE, "Where to put all the MS debug symbol files from linker.", "This variable is used to initialize the " - "PDB_OUTPUT_DIRECTORY property on all the targets. " + "PDB_OUTPUT_DIRECTORY property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1330,7 +1330,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_AUTOMOC", cmProperty::VARIABLE, "Whether to handle moc automatically for Qt targets.", "This variable is used to initialize the " - "AUTOMOC property on all the targets. " + "AUTOMOC property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1339,7 +1339,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_AUTOMOC_MOC_OPTIONS", cmProperty::VARIABLE, "Additional options for moc when using automoc (see CMAKE_AUTOMOC).", "This variable is used to initialize the " - "AUTOMOC_MOC_OPTIONS property on all the targets. " + "AUTOMOC_MOC_OPTIONS property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1473,7 +1473,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_LIBRARY_PATH_FLAG", cmProperty::VARIABLE, "The flag to be used to add a library search path to a compiler.", - "The flag will be used to specify a library directory to the compiler. " + "The flag will be used to specify a library directory to the compiler. " "On most compilers this is \"-L\".",false, "Variables that Control the Build"); cm->DefineProperty @@ -1500,7 +1500,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_USE_RELATIVE_PATHS", cmProperty::VARIABLE, "Use relative paths (May not work!).", "If this is set to TRUE, then CMake will use " - "relative paths between the source and binary tree. " + "relative paths between the source and binary tree. " "This option does not work for more complicated " "projects, and relative paths are used when possible. " "In general, it is not possible to move CMake generated" @@ -1534,7 +1534,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_LINK_INTERFACE_LIBRARIES", cmProperty::VARIABLE, "Default value for LINK_INTERFACE_LIBRARIES of targets.", "This variable is used to initialize the " - "LINK_INTERFACE_LIBRARIES property on all the targets. " + "LINK_INTERFACE_LIBRARIES property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1542,7 +1542,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_WIN32_EXECUTABLE", cmProperty::VARIABLE, "Default value for WIN32_EXECUTABLE of targets.", "This variable is used to initialize the " - "WIN32_EXECUTABLE property on all the targets. " + "WIN32_EXECUTABLE property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1550,7 +1550,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_MACOSX_BUNDLE", cmProperty::VARIABLE, "Default value for MACOSX_BUNDLE of targets.", "This variable is used to initialize the " - "MACOSX_BUNDLE property on all the targets. " + "MACOSX_BUNDLE property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1558,7 +1558,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_POSITION_INDEPENDENT_CODE", cmProperty::VARIABLE, "Default value for POSITION_INDEPENDENT_CODE of targets.", "This variable is used to initialize the " - "POSITION_INDEPENDENT_CODE property on all the targets. " + "POSITION_INDEPENDENT_CODE property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1566,7 +1566,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_<LANG>_VISIBILITY_PRESET", cmProperty::VARIABLE, "Default value for <LANG>_VISIBILITY_PRESET of targets.", "This variable is used to initialize the " - "<LANG>_VISIBILITY_PRESET property on all the targets. " + "<LANG>_VISIBILITY_PRESET property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1574,7 +1574,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_VISIBILITY_INLINES_HIDDEN", cmProperty::VARIABLE, "Default value for VISIBILITY_INLINES_HIDDEN of targets.", "This variable is used to initialize the " - "VISIBILITY_INLINES_HIDDEN property on all the targets. " + "VISIBILITY_INLINES_HIDDEN property on all the targets. " + "See that target property for additional information.", + false, + "Variables that Control the Build"); + cm->DefineProperty + ("CMAKE_MAP_IMPORTED_CONFIG_<CONFIG>", cmProperty::VARIABLE, + "Default value for MAP_IMPORTED_CONFIG_<CONFIG> of targets.", + "This variable is used to initialize the " + "MAP_IMPORTED_CONFIG_<CONFIG> property on all the targets. " "See that target property for additional information.", false, "Variables that Control the Build"); @@ -1595,7 +1603,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_<LANG>_COMPILER", cmProperty::VARIABLE, "The full path to the compiler for LANG.", - "This is the command that will be used as the <LANG> compiler. " + "This is the command that will be used as the <LANG> compiler. " "Once set, you can not change this variable.",false, "Variables for Languages"); @@ -1671,7 +1679,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_COMPILER_IS_GNU<LANG>", cmProperty::VARIABLE, "True if the compiler is GNU.", "If the selected <LANG> compiler is the GNU " - "compiler then this is TRUE, if not it is FALSE. " + "compiler then this is TRUE, if not it is FALSE. " "Unlike the other per-language variables, this uses the GNU syntax for " "identifying languages instead of the CMake syntax. Recognized values of " "the <LANG> suffix are:\n" @@ -1709,7 +1717,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_<LANG>_FLAGS_RELWITHDEBINFO", cmProperty::VARIABLE, "Flags for RelWithDebInfo type or configuration.", - "<LANG> flags used when CMAKE_BUILD_TYPE is RelWithDebInfo. " + "<LANG> flags used when CMAKE_BUILD_TYPE is RelWithDebInfo. " "Short for Release With Debug Information.",false, "Variables for Languages"); @@ -1773,7 +1781,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_<LANG>_IGNORE_EXTENSIONS", cmProperty::VARIABLE, "File extensions that should be ignored by the build.", "This is a list of file extensions that may be " - "part of a project for a given language but are not compiled. ",false, + "part of a project for a given language but are not compiled.",false, "Variables for Languages"); cm->DefineProperty diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 4edacbb..b19d847 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -829,10 +829,10 @@ int cmDocumentation::GetStructuredDocFromFile( std::vector<cmDocumentationEntry>& commands, cmake* cm) { - typedef enum sdoce { + enum sdoce { SDOC_NONE, SDOC_MODULE, SDOC_MACRO, SDOC_FUNCTION, SDOC_VARIABLE, SDOC_SECTION, - SDOC_UNKNOWN} sdoc_t; + SDOC_UNKNOWN}; int nbDocItemFound = 0; int docCtxIdx = 0; std::vector<int> docContextStack(60); diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index c97d4ff..c8b4a79 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -162,7 +162,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) if (require2_8_12) { - this->GenerateRequiredCMakeVersion(os, "2.8.11.20130626"); + this->GenerateRequiredCMakeVersion(os, "2.8.12"); } // Now load per-configuration properties for them. diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index e962313..d73c72c 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -192,11 +192,12 @@ static std::string stripAllGeneratorExpressions(const std::string &input) std::string result; std::string::size_type pos = 0; std::string::size_type lastPos = pos; + int nestingLevel = 0; while((pos = input.find("$<", lastPos)) != input.npos) { result += input.substr(lastPos, pos - lastPos); pos += 2; - int nestingLevel = 1; + nestingLevel = 1; const char *c = input.c_str() + pos; const char * const cStart = c; for ( ; *c; ++c) @@ -224,7 +225,10 @@ static std::string stripAllGeneratorExpressions(const std::string &input) pos += traversed; lastPos = pos; } - result += input.substr(lastPos); + if (nestingLevel == 0) + { + result += input.substr(lastPos); + } return cmGeneratorExpression::StripEmptyListElements(result); } @@ -234,9 +238,12 @@ static void prefixItems(const std::string &content, std::string &result, { std::vector<std::string> entries; cmGeneratorExpression::Split(content, entries); + const char *sep = ""; for(std::vector<std::string>::const_iterator ei = entries.begin(); ei != entries.end(); ++ei) { + result += sep; + sep = ";"; if (!cmSystemTools::FileIsFullPath(ei->c_str()) && cmGeneratorExpression::Find(*ei) == std::string::npos) { @@ -253,6 +260,7 @@ static std::string stripExportInterface(const std::string &input, { std::string result; + int nestingLevel = 0; std::string::size_type pos = 0; std::string::size_type lastPos = pos; while (true) @@ -282,7 +290,7 @@ static std::string stripExportInterface(const std::string &input, const bool gotInstallInterface = input[pos + 2] == 'I'; pos += gotInstallInterface ? sizeof("$<INSTALL_INTERFACE:") - 1 : sizeof("$<BUILD_INTERFACE:") - 1; - int nestingLevel = 1; + nestingLevel = 1; const char *c = input.c_str() + pos; const char * const cStart = c; for ( ; *c; ++c) @@ -331,7 +339,10 @@ static std::string stripExportInterface(const std::string &input, pos += traversed; lastPos = pos; } - result += input.substr(lastPos); + if (nestingLevel == 0) + { + result += input.substr(lastPos); + } return cmGeneratorExpression::StripEmptyListElements(result); } diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index abe4e70..7fd0fdc 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -438,6 +438,39 @@ static const struct CxxCompilerVersionNode : public CompilerVersionNode //---------------------------------------------------------------------------- +struct PlatformIdNode : public cmGeneratorExpressionNode +{ + PlatformIdNode() {} + + virtual int NumExpectedParameters() const { return ZeroOrMoreParameters; } + + std::string Evaluate(const std::vector<std::string> ¶meters, + cmGeneratorExpressionContext *context, + const GeneratorExpressionContent *, + cmGeneratorExpressionDAGChecker *) const + { + const char *platformId = context->Makefile ? + context->Makefile->GetSafeDefinition( + "CMAKE_SYSTEM_NAME") : ""; + if (parameters.size() == 0) + { + return platformId ? platformId : ""; + } + + if (!platformId) + { + return parameters.front().empty() ? "1" : "0"; + } + + if (cmsysString_strcasecmp(parameters.begin()->c_str(), platformId) == 0) + { + return "1"; + } + return "0"; + } +} platformIdNode; + +//---------------------------------------------------------------------------- static const struct VersionGreaterNode : public cmGeneratorExpressionNode { VersionGreaterNode() {} @@ -1356,6 +1389,8 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier) return &cCompilerVersionNode; else if (identifier == "CXX_COMPILER_VERSION") return &cxxCompilerVersionNode; + else if (identifier == "PLATFORM_ID") + return &platformIdNode; else if (identifier == "CONFIGURATION") return &configurationNode; else if (identifier == "CONFIG") diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 5ce0e6b..62ac263 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -80,6 +80,12 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir, config, false, this->Target, &dagChecker), result); } + for(std::vector<std::string>::iterator li = result.begin(); + li != result.end(); ++li) + { + cmSystemTools::ConvertToUnixSlashes(*li); + } + IncludeCacheType::value_type entry(config_upper, result); iter = this->SystemIncludesCache.insert(entry).first; } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 7f2b592..799bbdb 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -146,9 +146,17 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, const char* cname = this->GetCMakeInstance()-> GetCacheManager()->GetCacheValue(langComp.c_str()); std::string changeVars; - if(cname && (path != cname) && (optional==false)) + if(cname && !optional) { - std::string cnameString = cname; + std::string cnameString; + if(!cmSystemTools::FileIsFullPath(cname)) + { + cnameString = cmSystemTools::FindProgram(cname); + } + else + { + cnameString = cname; + } std::string pathString = path; // get rid of potentially multiple slashes: cmSystemTools::ConvertToUnixSlashes(cnameString); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index e4244e0..1a4c7ff 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -202,7 +202,7 @@ std::string cmGlobalVisualStudio8Generator::GetUserMacrosRegKeyBase() } //---------------------------------------------------------------------------- -void cmGlobalVisualStudio8Generator::AddCheckTarget() +bool cmGlobalVisualStudio8Generator::AddCheckTarget() { // Add a special target on which all other targets depend that // checks the build system and optionally re-runs CMake. @@ -216,7 +216,7 @@ void cmGlobalVisualStudio8Generator::AddCheckTarget() // Skip the target if no regeneration is to be done. if(mf->IsOn("CMAKE_SUPPRESS_REGENERATION")) { - return; + return false; } std::string cmake_command = mf->GetRequiredDefinition("CMAKE_COMMAND"); @@ -315,21 +315,24 @@ void cmGlobalVisualStudio8Generator::AddCheckTarget() cmSystemTools::Error("Error adding rule for ", stamps[0].c_str()); } } + + return true; } //---------------------------------------------------------------------------- void cmGlobalVisualStudio8Generator::Generate() { - this->AddCheckTarget(); - - // All targets depend on the build-system check target. - for(std::map<cmStdString,cmTarget *>::const_iterator - ti = this->TotalTargets.begin(); - ti != this->TotalTargets.end(); ++ti) + if(this->AddCheckTarget()) { - if(ti->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET) + // All targets depend on the build-system check target. + for(std::map<cmStdString,cmTarget *>::const_iterator + ti = this->TotalTargets.begin(); + ti != this->TotalTargets.end(); ++ti) { - ti->second->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET); + if(ti->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET) + { + ti->second->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET); + } } } diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index d181742..2376f8a 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -71,7 +71,7 @@ protected: virtual bool VSLinksDependencies() const { return false; } - void AddCheckTarget(); + bool AddCheckTarget(); static cmIDEFlagTable const* GetExtraFlagTableVS8(); virtual void WriteSLNHeader(std::ostream& fout); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 7cb2d1f..0a2b32b 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -431,13 +431,16 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, // Add XCODE depend helper std::string dir = mf->GetCurrentOutputDirectory(); - cmCustomCommandLine makecommand; - makecommand.push_back("make"); - makecommand.push_back("-C"); - makecommand.push_back(dir.c_str()); - makecommand.push_back("-f"); - makecommand.push_back(this->CurrentXCodeHackMakefile.c_str()); - makecommand.push_back(""); // placeholder, see below + cmCustomCommandLine makeHelper; + if(this->XcodeVersion < 50) + { + makeHelper.push_back("make"); + makeHelper.push_back("-C"); + makeHelper.push_back(dir.c_str()); + makeHelper.push_back("-f"); + makeHelper.push_back(this->CurrentXCodeHackMakefile.c_str()); + makeHelper.push_back(""); // placeholder, see below + } // Add ZERO_CHECK bool regenerate = !mf->IsOn("CMAKE_SUPPRESS_REGENERATION"); @@ -477,17 +480,18 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, // run the depend check makefile as a post build rule // this will make sure that when the next target is built // things are up-to-date - if((target.GetType() == cmTarget::EXECUTABLE || + if(!makeHelper.empty() && + (target.GetType() == cmTarget::EXECUTABLE || // Nope - no post-build for OBJECT_LIRBRARY // target.GetType() == cmTarget::OBJECT_LIBRARY || target.GetType() == cmTarget::STATIC_LIBRARY || target.GetType() == cmTarget::SHARED_LIBRARY || target.GetType() == cmTarget::MODULE_LIBRARY)) { - makecommand[makecommand.size()-1] = + makeHelper[makeHelper.size()-1] = // fill placeholder this->PostBuildMakeTarget(target.GetName(), "$(CONFIGURATION)"); cmCustomCommandLines commandLines; - commandLines.push_back(makecommand); + commandLines.push_back(makeHelper); lg->GetMakefile()->AddCustomCommandToTarget(target.GetName(), no_depends, commandLines, @@ -1027,18 +1031,21 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, } } - // Add object library contents as external objects. (Equivalent to - // the externalObjFiles above, except each one is not a cmSourceFile - // within the target.) - std::vector<std::string> objs; - this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs); - for(std::vector<std::string>::const_iterator - oi = objs.begin(); oi != objs.end(); ++oi) + if(this->XcodeVersion < 50) { - std::string obj = *oi; - cmXCodeObject* xsf = - this->CreateXCodeSourceFileFromPath(obj, cmtarget, ""); - externalObjFiles.push_back(xsf); + // Add object library contents as external objects. (Equivalent to + // the externalObjFiles above, except each one is not a cmSourceFile + // within the target.) + std::vector<std::string> objs; + this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs); + for(std::vector<std::string>::const_iterator + oi = objs.begin(); oi != objs.end(); ++oi) + { + std::string obj = *oi; + cmXCodeObject* xsf = + this->CreateXCodeSourceFileFromPath(obj, cmtarget, ""); + externalObjFiles.push_back(xsf); + } } // some build phases only apply to bundles and/or frameworks @@ -2765,13 +2772,6 @@ void cmGlobalXCodeGenerator } } - // Skip link information for static libraries. - if(cmtarget->GetType() == cmTarget::OBJECT_LIBRARY || - cmtarget->GetType() == cmTarget::STATIC_LIBRARY) - { - return; - } - // Loop over configuration types and set per-configuration info. for(std::vector<std::string>::iterator i = this->CurrentConfigurationTypes.begin(); @@ -2784,6 +2784,31 @@ void cmGlobalXCodeGenerator configName = 0; } + if(this->XcodeVersion >= 50) + { + // Add object library contents as link flags. + std::string linkObjs; + const char* sep = ""; + std::vector<std::string> objs; + this->GetGeneratorTarget(cmtarget)->UseObjectLibraries(objs); + for(std::vector<std::string>::const_iterator + oi = objs.begin(); oi != objs.end(); ++oi) + { + linkObjs += sep; + sep = " "; + linkObjs += this->XCodeEscapePath(oi->c_str()); + } + this->AppendBuildSettingAttribute(target, "OTHER_LDFLAGS", + linkObjs.c_str(), configName); + } + + // Skip link information for object libraries. + if(cmtarget->GetType() == cmTarget::OBJECT_LIBRARY || + cmtarget->GetType() == cmTarget::STATIC_LIBRARY) + { + continue; + } + // Compute the link library and directory information. cmComputeLinkInformation* pcli = cmtarget->GetLinkInformation(configName); if(!pcli) @@ -3338,8 +3363,11 @@ void cmGlobalXCodeGenerator cmXCodeObject* t = *i; this->AddDependAndLinkInformation(t); } - // now create xcode depend hack makefile - this->CreateXCodeDependHackTarget(targets); + if(this->XcodeVersion < 50) + { + // now create xcode depend hack makefile + this->CreateXCodeDependHackTarget(targets); + } // now add all targets to the root object cmXCodeObject* allTargets = this->CreateObject(cmXCodeObject::OBJECT_LIST); for(std::vector<cmXCodeObject*>::iterator i = targets.begin(); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 58cc6f4..bd6c860 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1954,23 +1954,27 @@ cmLocalVisualStudio7Generator // Compute the version of the Intel plugin to the VS IDE. // If the key does not exist then use a default guess. - std::string intelVersion = "9.10"; + std::string intelVersion; std::string vskey = gg->GetRegistryBase(); vskey += "\\Packages\\" CM_INTEL_PLUGIN_GUID ";ProductVersion"; cmSystemTools::ReadRegistryValue(vskey.c_str(), intelVersion, cmSystemTools::KeyWOW64_32); - if (intelVersion.find("13") == 0 || - intelVersion.find("12") == 0 || - intelVersion.find("11") == 0) + unsigned int intelVersionNumber = ~0u; + sscanf(intelVersion.c_str(), "%u", &intelVersionNumber); + if(intelVersionNumber >= 11) { - // Version 11.x, 12.x, and 13.x actually use 11.0 in project files! - intelVersion = "11.0" ; + // Default to latest known project file version. + intelVersion = "11.0"; } - else if(intelVersion.find("10") == 0) + else if(intelVersionNumber == 10) { // Version 10.x actually uses 9.10 in project files! intelVersion = "9.10"; } + else + { + // Version <= 9: use ProductVersion from registry. + } fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n" << "<VisualStudioProject\n" diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 57b86fd..34541e9 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -816,6 +816,19 @@ bool cmMakefile::NeedBackwardsCompatibility(unsigned int major, } } + +namespace +{ + struct file_not_persistent + { + bool operator()(const std::string& path) const + { + return !(path.find("CMakeTmp") == path.npos && + cmSystemTools::FileExists(path.c_str())); + } + }; +} + void cmMakefile::FinalPass() { // do all the variable expansions here @@ -829,6 +842,29 @@ void cmMakefile::FinalPass() (*i)->FinalPass(); } + //go through all configured files and see which ones still exist. + //we don't want cmake to re-run if a configured file is created and deleted + //during processing as that would make it a transient file that can't + //influence the build process + + //remove_if will move all items that don't have a valid file name to the + //back of the vector + std::vector<std::string>::iterator new_output_files_end = std::remove_if( + this->OutputFiles.begin(), + this->OutputFiles.end(), + file_not_persistent() ); + //we just have to erase all items at the back + this->OutputFiles.erase(new_output_files_end, this->OutputFiles.end() ); + + //if a configured file is used as input for another configured file, + //and then deleted it will show up in the input list files so we + //need to scan those too + std::vector<std::string>::iterator new_list_files_end = std::remove_if( + this->ListFiles.begin(), + this->ListFiles.end(), + file_not_persistent() ); + + this->ListFiles.erase(new_list_files_end, this->ListFiles.end() ); } // Generate the output file @@ -1033,6 +1069,19 @@ void cmMakefile::UpdateOutputToSourceMap(std::string const& output, cmSourceFile* source) { + OutputToSourceMap::iterator i = this->OutputToSource.find(output); + if(i != this->OutputToSource.end()) + { + // Multiple custom commands produce the same output but may + // be attached to a different source file (MAIN_DEPENDENCY). + // LinearGetSourceFileWithOutput would return the first one, + // so keep the mapping for the first one. + // + // TODO: Warn the user about this case. However, the VS 8 generator + // triggers it for separate generate.stamp rules in ZERO_CHECK and + // individual targets. + return; + } this->OutputToSource[output] = source; } @@ -3419,11 +3468,12 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile, std::string sinfile = infile; this->AddCMakeDependFile(sinfile); cmSystemTools::ConvertToUnixSlashes(soutfile); + // Re-generate if non-temporary outputs are missing. - if(soutfile.find("CMakeTmp") == soutfile.npos) - { - this->AddCMakeOutputFile(soutfile); - } + //when we finalize the configuration we will remove all + //output files that now don't exist. + this->AddCMakeOutputFile(soutfile); + mode_t perm = 0; cmSystemTools::GetPermissions(sinfile.c_str(), perm); std::string::size_type pos = soutfile.rfind('/'); diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 0829cab..4e40f6c 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -21,6 +21,7 @@ #include "cmTarget.h" #include "cmake.h" #include "cmComputeLinkInformation.h" +#include "cmGeneratorExpression.h" #include "cmMakefileExecutableTargetGenerator.h" #include "cmMakefileLibraryTargetGenerator.h" @@ -131,7 +132,14 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules() this->Makefile->GetProperty ("ADDITIONAL_MAKE_CLEAN_FILES")) { - cmSystemTools::ExpandListArgument(additional_clean_files, + const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); + cmListFileBacktrace lfbt; + cmGeneratorExpression ge(lfbt); + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = + ge.Parse(additional_clean_files); + + cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile, config, + false, this->Target, 0, 0), this->CleanFiles); } diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index a823f05..f9197e0 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -27,11 +27,11 @@ public: cmPolicies::PolicyStatus status) { if (!idString || !shortDescription || ! longDescription) - { + { cmSystemTools::Error("Attempt to define a policy without " "all parameters being specified!"); return; - } + } this->ID = iD; this->IDString = idString; this->ShortDescription = shortDescription; @@ -61,29 +61,29 @@ public: unsigned int tweakV) { if (majorV < this->MajorVersionIntroduced) - { + { return true; - } + } if (majorV > this->MajorVersionIntroduced) - { + { return false; - } + } if (minorV < this->MinorVersionIntroduced) - { + { return true; - } + } if (minorV > this->MinorVersionIntroduced) - { + { return false; - } + } if (patchV < this->PatchVersionIntroduced) - { + { return true; - } + } if (patchV > this->PatchVersionIntroduced) - { + { return false; - } + } return (tweakV < this->TweakVersionIntroduced); } @@ -609,9 +609,9 @@ cmPolicies::~cmPolicies() std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i = this->Policies.begin(); for (;i != this->Policies.end(); ++i) - { + { delete i->second; - } + } } void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD, @@ -626,11 +626,11 @@ void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD, { // a policy must be unique and can only be defined once if (this->Policies.find(iD) != this->Policies.end()) - { + { cmSystemTools::Error("Attempt to redefine a CMake policy for policy " "ID ", this->GetPolicyIDString(iD).c_str()); return; - } + } this->Policies[iD] = new cmPolicy(iD, idString, shortDescription, @@ -784,15 +784,15 @@ bool cmPolicies::GetPolicyDefault(cmMakefile* mf, std::string const& policy, bool cmPolicies::GetPolicyID(const char *id, cmPolicies::PolicyID &pid) { if (!id || strlen(id) < 1) - { + { return false; - } + } std::map<std::string,cmPolicies::PolicyID>::iterator pos = this->PolicyStringMap.find(id); if (pos == this->PolicyStringMap.end()) - { + { return false; - } + } pid = pos->second; return true; } @@ -802,9 +802,9 @@ std::string cmPolicies::GetPolicyIDString(cmPolicies::PolicyID pid) std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos = this->Policies.find(pid); if (pos == this->Policies.end()) - { + { return ""; - } + } return pos->second->IDString; } @@ -815,11 +815,11 @@ std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id) std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos = this->Policies.find(id); if (pos == this->Policies.end()) - { + { cmSystemTools::Error( "Request for warning text for undefined policy!"); return "Request for warning text for undefined policy!"; - } + } cmOStringStream msg; msg << @@ -839,11 +839,11 @@ std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id) std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos = this->Policies.find(id); if (pos == this->Policies.end()) - { + { cmSystemTools::Error( "Request for error text for undefined policy!"); return "Request for error text for undefined policy!"; - } + } cmOStringStream error; error << @@ -869,10 +869,10 @@ cmPolicies::GetPolicyStatus(cmPolicies::PolicyID id) std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos = this->Policies.find(id); if (pos == this->Policies.end()) - { + { // TODO is this right? return cmPolicies::WARN; - } + } return pos->second->Status; } @@ -883,7 +883,7 @@ void cmPolicies::GetDocumentation(std::vector<cmDocumentationEntry>& v) std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i = this->Policies.begin(); for (;i != this->Policies.end(); ++i) - { + { cmOStringStream full; full << i->second->LongDescription; full << "\nThis policy was introduced in CMake version "; @@ -920,7 +920,7 @@ void cmPolicies::GetDocumentation(std::vector<cmDocumentationEntry>& v) i->second->ShortDescription.c_str(), full.str().c_str()); v.push_back(e); - } + } } //---------------------------------------------------------------------------- diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index 93e39ab..54df12c 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -32,16 +32,28 @@ #include "cmQtAutomoc.h" -static bool containsQ_OBJECT(const std::string& text) +static bool requiresMocing(const std::string& text, std::string ¯oName) { // this simple check is much much faster than the regexp - if (strstr(text.c_str(), "Q_OBJECT") == NULL) + if (strstr(text.c_str(), "Q_OBJECT") == NULL + && strstr(text.c_str(), "Q_GADGET") == NULL) { return false; } cmsys::RegularExpression qObjectRegExp("[\n][ \t]*Q_OBJECT[^a-zA-Z0-9_]"); - return qObjectRegExp.find(text); + if (qObjectRegExp.find(text)) + { + macroName = "Q_OBJECT"; + return true; + } + cmsys::RegularExpression qGadgetRegExp("[\n][ \t]*Q_GADGET[^a-zA-Z0-9_]"); + if (qGadgetRegExp.find(text)) + { + macroName = "Q_GADGET"; + return true; + } + return false; } @@ -837,7 +849,8 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/'; const std::string scannedFileBasename = cmsys::SystemTools:: GetFilenameWithoutLastExtension(absFilename); - const bool cppContainsQ_OBJECT = containsQ_OBJECT(contentsString); + std::string macroName; + const bool requiresMoc = requiresMocing(contentsString, macroName); bool dotMocIncluded = false; bool mocUnderscoreIncluded = false; std::string ownMocUnderscoreFile; @@ -908,7 +921,7 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, else { std::string fileToMoc = absFilename; - if ((basename != scannedFileBasename) || (cppContainsQ_OBJECT==false)) + if ((basename != scannedFileBasename) || (requiresMoc==false)) { std::string mocSubDir = extractSubDir(absPath, currentMoc); std::string headerToMoc = findMatchingHeader( @@ -917,12 +930,12 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, { // this is for KDE4 compatibility: fileToMoc = headerToMoc; - if ((cppContainsQ_OBJECT==false) &&(basename==scannedFileBasename)) + if ((requiresMoc==false) &&(basename==scannedFileBasename)) { std::cerr << "AUTOMOC: warning: " << absFilename << ": The file " "includes the moc file \"" << currentMoc << - "\", but does not contain a Q_OBJECT macro. " - "Running moc on " + "\", but does not contain a " << macroName + << " macro. Running moc on " << "\"" << headerToMoc << "\" ! Include \"moc_" << basename << ".cpp\" for a compatiblity with " "strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n" @@ -965,13 +978,14 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, // If this is the case, the moc_foo.cpp should probably be generated from // foo.cpp instead of foo.h, because otherwise it won't build. // But warn, since this is not how it is supposed to be used. - if ((dotMocIncluded == false) && (cppContainsQ_OBJECT == true)) + if ((dotMocIncluded == false) && (requiresMoc == true)) { if (mocUnderscoreIncluded == true) { // this is for KDE4 compatibility: std::cerr << "AUTOMOC: warning: " << absFilename << ": The file " - << "contains a Q_OBJECT macro, but does not include " + << "contains a " << macroName << " macro, but does not " + "include " << "\"" << scannedFileBasename << ".moc\", but instead " "includes " << "\"" << ownMocUnderscoreFile << "\". Running moc on " @@ -986,7 +1000,8 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, { // otherwise always error out since it will not compile: std::cerr << "AUTOMOC: error: " << absFilename << ": The file " - << "contains a Q_OBJECT macro, but does not include " + << "contains a " << macroName << " macro, but does not " + "include " << "\"" << scannedFileBasename << ".moc\" !\n" << std::endl; ::exit(EXIT_FAILURE); @@ -1094,11 +1109,13 @@ void cmQtAutomoc::StrictParseCppFile(const std::string& absFilename, // If this is the case, the moc_foo.cpp should probably be generated from // foo.cpp instead of foo.h, because otherwise it won't build. // But warn, since this is not how it is supposed to be used. - if ((dotMocIncluded == false) && (containsQ_OBJECT(contentsString))) + std::string macroName; + if ((dotMocIncluded == false) && (requiresMocing(contentsString, + macroName))) { // otherwise always error out since it will not compile: std::cerr << "AUTOMOC: error: " << absFilename << ": The file " - << "contains a Q_OBJECT macro, but does not include " + << "contains a " << macroName << " macro, but does not include " << "\"" << scannedFileBasename << ".moc\" !\n" << std::endl; ::exit(EXIT_FAILURE); @@ -1165,7 +1182,8 @@ void cmQtAutomoc::ParseHeaders(const std::set<std::string>& absHeaders, const std::string currentMoc = "moc_" + basename + ".cpp"; const std::string contents = this->ReadAll(headerName); - if (containsQ_OBJECT(contents)) + std::string macroName; + if (requiresMocing(contents, macroName)) { //std::cout << "header contains Q_OBJECT macro"; notIncludedMocs[headerName] = currentMoc; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 147c332..8ccd19c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -924,7 +924,10 @@ void cmTarget::DefineProperties(cmake *cm) "The first configuration in the list found to be provided by the " "imported target is selected. If this property is set and no matching " "configurations are available, then the imported target is considered " - "to be not found. This property is ignored for non-imported targets.", + "to be not found. This property is ignored for non-imported targets.\n" + "This property is initialized by the value of the variable " + "CMAKE_MAP_IMPORTED_CONFIG_<CONFIG> if it is set when a target is " + "created.", false /* TODO: make this chained */ ); cm->DefineProperty @@ -1649,6 +1652,7 @@ void cmTarget::SetMakefile(cmMakefile* mf) "LIBRARY_OUTPUT_DIRECTORY_", "RUNTIME_OUTPUT_DIRECTORY_", "PDB_OUTPUT_DIRECTORY_", + "MAP_IMPORTED_CONFIG_", 0}; for(std::vector<std::string>::iterator ci = configNames.begin(); ci != configNames.end(); ++ci) @@ -6443,7 +6447,13 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface, ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n" << "Target \"" << this->GetName() << "\" has a " "INTERFACE_LINK_LIBRARIES property which differs from its " - << linkIfaceProp << " properties."; + << linkIfaceProp << " properties." + "\n" + "INTERFACE_LINK_LIBRARIES:\n " + << newExplicitLibraries + << "\n" + << linkIfaceProp << ":\n " + << (explicitLibraries ? explicitLibraries : "(empty)") << "\n"; this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); } // Fall through |