summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmCoreTryCompile.cxx1
-rw-r--r--Source/cmGetFilenameComponentCommand.h19
-rw-r--r--Source/cmMakefile.cxx4
-rw-r--r--Tests/IncludeDirectories/CMakeLists.txt11
4 files changed, 26 insertions, 9 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 387f6ed..9f38b25 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -326,6 +326,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
{
this->Makefile->IssueMessage(cmake::FATAL_ERROR,
"could not write export file.");
+ fclose(fout);
return -1;
}
fprintf(fout,
diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h
index c461016..f294daa 100644
--- a/Source/cmGetFilenameComponentCommand.h
+++ b/Source/cmGetFilenameComponentCommand.h
@@ -62,15 +62,16 @@ public:
virtual const char* GetFullDocumentation() const
{
return
- " get_filename_component(<VAR> FileName\n"
- " PATH|ABSOLUTE|NAME|EXT|NAME_WE|REALPATH\n"
- " [CACHE])\n"
- "Set <VAR> to be the path (PATH), file name (NAME), file "
- "extension (EXT), file name without extension (NAME_WE) of FileName, "
- "the full path (ABSOLUTE), or the full path with all symlinks "
- "resolved (REALPATH). "
- "Note that the path is converted to Unix slashes format and has no "
- "trailing slashes. The longest file extension is always considered. "
+ " get_filename_component(<VAR> <FileName> <COMP> [CACHE])\n"
+ "Set <VAR> to a component of <FileName>, where <COMP> is one of:\n"
+ " PATH = Directory without file name\n"
+ " NAME = File name without directory\n"
+ " EXT = File name longest extension (.b.c from d/a.b.c)\n"
+ " NAME_WE = File name without directory or longest extension\n"
+ " ABSOLUTE = Full path to file\n"
+ " REALPATH = Full path to existing file with symlinks resolved\n"
+ "Paths are returned with forward slashes and have no trailing slahes. "
+ "The longest file extension is always considered. "
"If the optional CACHE argument is specified, the result variable is "
"added to the cache.\n"
" get_filename_component(<VAR> FileName\n"
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 25ccbc7..47a6d2e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3458,6 +3458,10 @@ void cmMakefile::SetProperty(const char* prop, const char* value)
if (propname == "INCLUDE_DIRECTORIES")
{
this->IncludeDirectoriesEntries.clear();
+ if (!value)
+ {
+ return;
+ }
cmListFileBacktrace lfbt;
this->GetBacktrace(lfbt);
this->IncludeDirectoriesEntries.push_back(
diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt
index 60f5e5e..8a60f17 100644
--- a/Tests/IncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/CMakeLists.txt
@@ -47,3 +47,14 @@ else()
endif()
add_subdirectory(TargetIncludeDirectories)
+
+set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}")
+get_property(propContent DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+if (NOT propContent STREQUAL "${CMAKE_BINARY_DIR}")
+ message(SEND_ERROR "Setting DIRECTORY property failed.")
+endif()
+set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+get_property(propContentAfter DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+if (NOT propContentAfter STREQUAL "")
+ message(SEND_ERROR "Clearing DIRECTORY property failed.")
+endif()