diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-06-30 16:10:36 -0400 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-06-30 16:10:36 -0400 |
commit | b7e5326056b923dae0b1cca629c9e1bceb358d94 (patch) | |
tree | 7d0b70d24460d962b074ef085b5142b20ad85e88 | |
parent | a318f1cddade9159af4833ebb3cce0e6610be532 (diff) | |
download | cmake-b7e5326056b923dae0b1cca629c9e1bceb358d94.tar.gz |
ENH: check in RC 6 merges from trunk
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | ChangeLog.manual | 4 | ||||
-rw-r--r-- | Modules/FindGettext.cmake | 2 | ||||
-rw-r--r-- | Modules/FindKDE4.cmake | 11 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 6 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 104 | ||||
-rw-r--r-- | Source/cmMakefile.h | 5 |
7 files changed, 114 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 244dc04e09..4a53560672 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -354,7 +354,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES) SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 6) SET(CMake_VERSION_PATCH 1) -SET(CMake_VERSION_RC 5) +SET(CMake_VERSION_RC 6) # CVS versions are odd, if this is an odd minor version # then set the CMake_VERSION_DATE variable IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$") diff --git a/ChangeLog.manual b/ChangeLog.manual index 6438dcdb73..2de0de739a 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,7 @@ +Changes in CMake 2.6.1 RC 6 +- Fix DEFINITIONS property to be compatible with 2.4 +- Fix escaping of $ for visual studio +- FindGettext.cmake fix bug #7230: don't ignore first parameter if it's not ALL Changes in CMake 2.6.1 RC 5 - Add support for component based packages in cpack. - Fix FindBLAS.cmake if no fortran compiler is found diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake index d1e3f9b93d..99a2705055 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -30,7 +30,7 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFile) SET(_firstPoFile) ENDIF(${_firstPoFile} STREQUAL "ALL") - FOREACH (_currentPoFile ${ARGN}) + FOREACH (_currentPoFile ${_firstPoFile} ${ARGN}) GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE) GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH) GET_FILENAME_COMPONENT(_lang ${_absFile} NAME_WE) diff --git a/Modules/FindKDE4.cmake b/Modules/FindKDE4.cmake index bd69296f60..89924680f8 100644 --- a/Modules/FindKDE4.cmake +++ b/Modules/FindKDE4.cmake @@ -42,10 +42,13 @@ IF(NOT KDE4_DATA_DIR) GET_FILENAME_COMPONENT(KDE4_DATA_DIR "${KDE4_DATA_DIR}" PATH) ELSE(CMAKE_CROSSCOMPILING) # then ask kde4-config for the kde data dirs - EXECUTE_PROCESS(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path data OUTPUT_VARIABLE _data_DIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - FILE(TO_CMAKE_PATH "${_data_DIR}" _data_DIR) - # then check the data dirs for FindKDE4Internal.cmake - FIND_PATH(KDE4_DATA_DIR cmake/modules/FindKDE4Internal.cmake ${_data_DIR}) + + IF(KDE4_KDECONFIG_EXECUTABLE) + EXECUTE_PROCESS(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path data OUTPUT_VARIABLE _data_DIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) + FILE(TO_CMAKE_PATH "${_data_DIR}" _data_DIR) + # then check the data dirs for FindKDE4Internal.cmake + FIND_PATH(KDE4_DATA_DIR cmake/modules/FindKDE4Internal.cmake ${_data_DIR}) + ENDIF(KDE4_KDECONFIG_EXECUTABLE) ENDIF(CMAKE_CROSSCOMPILING) ENDIF(NOT KDE4_DATA_DIR) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 9ba06e75c1..2580047ea3 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -2173,8 +2173,10 @@ void cmLocalVisualStudio7GeneratorOptions::HandleFlag(const char* flag) // This option is not known. Store it in the output flags. this->FlagString += " "; this->FlagString += - cmSystemTools::EscapeWindowsShellArgument(flag, - cmsysSystem_Shell_Flag_VSIDE); + cmSystemTools::EscapeWindowsShellArgument( + flag, + cmsysSystem_Shell_Flag_AllowMakeVariables | + cmsysSystem_Shell_Flag_VSIDE); } //---------------------------------------------------------------------------- diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 26ecab9125..fca2f7e32b 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1018,12 +1018,21 @@ void cmMakefile::AddDefineFlag(const char* flag) return; } + // Update the string used for the old DEFINITIONS property. + this->AddDefineFlag(flag, this->DefineFlagsOrig); + // If this is really a definition, update COMPILE_DEFINITIONS. if(this->ParseDefineFlag(flag, false)) { return; } + // Add this flag that does not look like a definition. + this->AddDefineFlag(flag, this->DefineFlags); +} + +void cmMakefile::AddDefineFlag(const char* flag, std::string& dflags) +{ // remove any \n\r std::string ret = flag; std::string::size_type pos = 0; @@ -1039,8 +1048,8 @@ void cmMakefile::AddDefineFlag(const char* flag) pos++; } - this->DefineFlags += " "; - this->DefineFlags += ret; + dflags += " "; + dflags += ret; } @@ -1053,22 +1062,33 @@ void cmMakefile::RemoveDefineFlag(const char* flag) return; } + // Update the string used for the old DEFINITIONS property. + this->RemoveDefineFlag(flag, len, this->DefineFlagsOrig); + // If this is really a definition, update COMPILE_DEFINITIONS. if(this->ParseDefineFlag(flag, true)) { return; } + // Remove this flag that does not look like a definition. + this->RemoveDefineFlag(flag, len, this->DefineFlags); +} + +void cmMakefile::RemoveDefineFlag(const char* flag, + std::string::size_type len, + std::string& dflags) +{ // Remove all instances of the flag that are surrounded by // whitespace or the beginning/end of the string. - for(std::string::size_type lpos = this->DefineFlags.find(flag, 0); - lpos != std::string::npos; lpos = this->DefineFlags.find(flag, lpos)) + for(std::string::size_type lpos = dflags.find(flag, 0); + lpos != std::string::npos; lpos = dflags.find(flag, lpos)) { std::string::size_type rpos = lpos + len; - if((lpos <= 0 || isspace(this->DefineFlags[lpos-1])) && - (rpos >= this->DefineFlags.size() || isspace(this->DefineFlags[rpos]))) + if((lpos <= 0 || isspace(dflags[lpos-1])) && + (rpos >= dflags.size() || isspace(dflags[rpos]))) { - this->DefineFlags.erase(lpos, len); + dflags.erase(lpos, len); } else { @@ -2908,8 +2928,10 @@ const char *cmMakefile::GetProperty(const char* prop, output = ""; if (!strcmp("PARENT_DIRECTORY",prop)) { - output = this->LocalGenerator->GetParent() - ->GetMakefile()->GetStartDirectory(); + if(cmLocalGenerator* plg = this->LocalGenerator->GetParent()) + { + output = plg->GetMakefile()->GetStartDirectory(); + } return output.c_str(); } else if (!strcmp("INCLUDE_REGULAR_EXPRESSION",prop) ) @@ -2954,8 +2976,8 @@ const char *cmMakefile::GetProperty(const char* prop, return output.c_str(); } else if (!strcmp("DEFINITIONS",prop)) - { - output = this->GetDefineFlags(); + { + output += this->DefineFlagsOrig; return output.c_str(); } else if (!strcmp("INCLUDE_DIRECTORIES",prop) ) @@ -3176,7 +3198,7 @@ void cmMakefile::DefineProperties(cmake *cm) "in your CMake scripts. It returns a list of what list files " "are currently being processed, in order. So if one listfile " "does an INCLUDE command then that is effectively pushing " - "the included listfile onto the stack."); + "the included listfile onto the stack.", false); cm->DefineProperty ("TEST_INCLUDE_FILE", cmProperty::DIRECTORY, @@ -3245,6 +3267,64 @@ void cmMakefile::DefineProperties(cmake *cm) "for example typing make will cause the targets to be built. " "The same concept applies to the default build of other generators.", false); + + cm->DefineProperty + ("PARENT_DIRECTORY", cmProperty::DIRECTORY, + "Source directory that added current subdirectory.", + "This read-only property specifies the source directory that " + "added the current source directory as a subdirectory of the build. " + "In the top-level directory the value is the empty-string.", false); + + cm->DefineProperty + ("INCLUDE_REGULAR_EXPRESSION", cmProperty::DIRECTORY, + "Include file scanning regular expression.", + "This read-only property specifies the regular expression used " + "during dependency scanning to match include files that should " + "be followed. See the include_regular_expression command.", false); + + cm->DefineProperty + ("VARIABLES", cmProperty::DIRECTORY, + "List of variables defined in the current directory.", + "This read-only property specifies the list of CMake variables " + "currently defined. " + "It is intended for debugging purposes.", false); + + cm->DefineProperty + ("CACHE_VARIABLES", cmProperty::DIRECTORY, + "List of cache variables available in the current directory.", + "This read-only property specifies the list of CMake cache " + "variables currently defined. " + "It is intended for debugging purposes.", false); + + cm->DefineProperty + ("MACROS", cmProperty::DIRECTORY, + "List of macro commands available in the current directory.", + "This read-only property specifies the list of CMake macros " + "currently defined. " + "It is intended for debugging purposes. " + "See the macro command.", false); + + cm->DefineProperty + ("DEFINITIONS", cmProperty::DIRECTORY, + "For CMake 2.4 compatibility only. Use COMPILE_DEFINITIONS instead.", + "This read-only property specifies the list of flags given so far " + "to the add_definitions command. " + "It is intended for debugging purposes. " + "Use the COMPILE_DEFINITIONS instead.", false); + + cm->DefineProperty + ("INCLUDE_DIRECTORIES", cmProperty::DIRECTORY, + "List of preprocessor include file search directories.", + "This read-only property specifies the list of directories given " + "so far to the include_directories command. " + "It is intended for debugging purposes.", false); + + cm->DefineProperty + ("LINK_DIRECTORIES", cmProperty::DIRECTORY, + "List of linker search directories.", + "This read-only property specifies the list of directories given " + "so far to the link_directories command. " + "It is intended for debugging purposes.", false); } //---------------------------------------------------------------------------- diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 4f54f7134e..780b2fe071 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -829,6 +829,11 @@ protected: std::vector<std::string> HeaderFileExtensions; std::string DefineFlags; + // Track the value of the computed DEFINITIONS property. + void AddDefineFlag(const char*, std::string&); + void RemoveDefineFlag(const char*, std::string::size_type, std::string&); + std::string DefineFlagsOrig; + #if defined(CMAKE_BUILD_WITH_CMAKE) std::vector<cmSourceGroup> SourceGroups; #endif |