[Cmake-commits] CMake branch, master, updated. v2.8.11-210-gfafa66c

2013-05-29 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  fafa66c7f0430992e5e3388a8a3c707014ee534d (commit)
  from  6927b25affcb9e2e01fb226970fd91db143b5101 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fafa66c7f0430992e5e3388a8a3c707014ee534d
commit fafa66c7f0430992e5e3388a8a3c707014ee534d
Author: Kitware Robot 
AuthorDate: Thu May 30 00:01:03 2013 -0400
Commit: Kitware Robot 
CommitDate: Thu May 30 00:01:03 2013 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 01e8512..6c27ab3 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
 set(CMake_VERSION_MAJOR 2)
 set(CMake_VERSION_MINOR 8)
 set(CMake_VERSION_PATCH 11)
-set(CMake_VERSION_TWEAK 20130529)
+set(CMake_VERSION_TWEAK 20130530)
 #set(CMake_VERSION_RC 1)

---

Summary of changes:
 Source/CMakeVersion.cmake |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, next, updated. v2.8.11-2312-g6b56f36

2013-05-29 Thread Stephen Kelly
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
   via  6b56f365ce9bf11ef40aca0f93e1eb5142ab56eb (commit)
   via  80602cc36b3473b60ee70044b15756f4f9a227c8 (commit)
   via  2f8565bc3a25828860cde6fb89c7d6c0d7572a19 (commit)
  from  98f34b36991a56789a953616917d01a9f8843f1e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6b56f365ce9bf11ef40aca0f93e1eb5142ab56eb
commit 6b56f365ce9bf11ef40aca0f93e1eb5142ab56eb
Merge: 98f34b3 80602cc
Author: Stephen Kelly 
AuthorDate: Wed May 29 09:31:10 2013 -0400
Commit: CMake Topic Stage 
CommitDate: Wed May 29 09:31:10 2013 -0400

Merge topic 'VISIBILITY_PRESET-property' into next

80602cc Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target 
property.
2f8565b Introduce target property _VISIBILITY_PRESET


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=80602cc36b3473b60ee70044b15756f4f9a227c8
commit 80602cc36b3473b60ee70044b15756f4f9a227c8
Author: Stephen Kelly 
AuthorDate: Thu May 23 15:32:17 2013 +0200
Commit: Stephen Kelly 
CommitDate: Wed May 29 15:30:25 2013 +0200

Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property.

This corresponds to the g++ and clang++
option -fvisibility-inlines-hidden on linux. On Windows with MinGW,
this corresponds to -fno-keep-inline-dllexport. That option is
not supported by clang currently.

diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index 486e2af..972d889 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -1,2 +1,4 @@
 include(Compiler/Clang)
 __compiler_clang(CXX)
+
+set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN 
"-fvisibility-inlines-hidden")
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index 879ab8f..9bee962 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -1,2 +1,8 @@
 include(Compiler/GNU)
 __compiler_gnu(CXX)
+
+if (WIN32)
+  set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN 
"-fno-keep-inline-dllexport")
+else()
+  set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN 
"-fvisibility-inlines-hidden")
+endif()
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 71dd3e9..dce1838 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1992,28 +1992,12 @@ void cmLocalGenerator::AddSharedFlags(std::string& 
flags,
 }
 }
 
-//
-void cmLocalGenerator
-::AddVisibilityPresetFlags(std::string &flags, cmTarget* target,
-const char *lang)
+static void AddVisibilityCompileOption(std::string &flags, cmTarget* target,
+   cmLocalGenerator *lg, const char *lang)
 {
-  int targetType = target->GetType();
-  bool suitableTarget = ((targetType == cmTarget::SHARED_LIBRARY)
-  || (targetType == cmTarget::MODULE_LIBRARY)
-  || (target->IsExecutableWithExports()));
-
-  if (!suitableTarget)
-{
-return;
-}
-
-  if (!lang)
-{
-return;
-}
   std::string l(lang);
   std::string compileOption = "CMAKE_" + l + "_COMPILE_OPTIONS_VISIBILITY";
-  const char *opt = this->Makefile->GetDefinition(compileOption.c_str());
+  const char *opt = lg->GetMakefile()->GetDefinition(compileOption.c_str());
   if (!opt)
 {
 return;
@@ -2037,7 +2021,50 @@ void cmLocalGenerator
 return;
 }
   std::string option = std::string(opt) + prop;
-  this->AppendFlags(flags, option.c_str());
+  lg->AppendFlags(flags, option.c_str());
+}
+
+static void AddInlineVisibilityCompileOption(std::string &flags,
+   cmTarget* target,
+   cmLocalGenerator *lg)
+{
+  std::string compileOption
+= "CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN";
+  const char *opt = lg->GetMakefile()->GetDefinition(compileOption.c_str());
+  if (!opt)
+{
+return;
+}
+
+  bool prop = target->GetPropertyAsBool("VISIBILITY_INLINES_HIDDEN");
+  if (!prop)
+{
+return;
+}
+  lg->AppendFlags(flags, opt);
+}
+
+//
+void cmLocalGenerator
+::AddVisibilityPresetFlags(std::string &flags, cmTarget* target,
+const char *lang)
+{
+  int targetType = target->GetType();
+  bool suitableTarget = ((targetType == cmTarget::SHARED_LIBRARY)
+  || (targetType == cmTarget::MODULE_LIBRARY)
+  

[Cmake-commits] CMake branch, next, updated. v2.8.11-2309-g98f34b3

2013-05-29 Thread Stephen Kelly
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
   via  98f34b36991a56789a953616917d01a9f8843f1e (commit)
   via  967b386d5e78dbb907268594517be924c80de4cf (commit)
  from  c6501c12359669a30d92776bc0ea7256c0848161 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98f34b36991a56789a953616917d01a9f8843f1e
commit 98f34b36991a56789a953616917d01a9f8843f1e
Merge: c6501c1 967b386
Author: Stephen Kelly 
AuthorDate: Wed May 29 09:13:08 2013 -0400
Commit: CMake Topic Stage 
CommitDate: Wed May 29 09:13:08 2013 -0400

Merge topic 'VISIBILITY_PRESET-property' into next

967b386 Add visibility flags when using xcode if needed.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=967b386d5e78dbb907268594517be924c80de4cf
commit 967b386d5e78dbb907268594517be924c80de4cf
Author: Stephen Kelly 
AuthorDate: Wed May 29 15:11:47 2013 +0200
Commit: Stephen Kelly 
CommitDate: Wed May 29 15:11:47 2013 +0200

Add visibility flags when using xcode if needed.

diff --git a/Source/cmGlobalXCodeGenerator.cxx 
b/Source/cmGlobalXCodeGenerator.cxx
index 870bfa1..13a14e1 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1684,6 +1684,9 @@ void 
cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 // Add shared-library flags if needed.
 this->CurrentLocalGenerator->AddCMP0018Flags(flags, &target,
  lang, configName);
+
+this->CurrentLocalGenerator->AddVisibilityPresetFlags(flags, &target,
+   lang);
 }
   else if(binary)
   {

---

Summary of changes:
 Source/cmGlobalXCodeGenerator.cxx |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, next, updated. v2.8.11-2307-gc6501c1

2013-05-29 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
   via  c6501c12359669a30d92776bc0ea7256c0848161 (commit)
   via  cbe3f2072bdd181660bc4f9174a73febd3ed5230 (commit)
  from  026e51ac00810d47a1639b4380e27edccfd5cf25 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c6501c12359669a30d92776bc0ea7256c0848161
commit c6501c12359669a30d92776bc0ea7256c0848161
Merge: 026e51a cbe3f20
Author: Brad King 
AuthorDate: Wed May 29 09:07:31 2013 -0400
Commit: CMake Topic Stage 
CommitDate: Wed May 29 09:07:31 2013 -0400

Merge topic 'xcode-shlib-versioning' into next

cbe3f20 Xcode: Add support for shared library versioning


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cbe3f2072bdd181660bc4f9174a73febd3ed5230
commit cbe3f2072bdd181660bc4f9174a73febd3ed5230
Author: Clinton Stimpson 
AuthorDate: Mon May 13 20:45:35 2013 -0600
Commit: Brad King 
CommitDate: Wed May 29 09:05:00 2013 -0400

Xcode: Add support for shared library versioning

Add a post-build command to shared library targets to create the
versioning symbolic links.

diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 2e6b71e..6e5d449 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -207,12 +207,8 @@ if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES 
"^1\\.[0-6]$")
 "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined 
suppress")
 endif()
 
-if(NOT XCODE)
-  # Enable shared library versioning.  This flag is not actually referenced
-  # but the fact that the setting exists will cause the generators to support
-  # soname computation.
-  set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
-endif()
+# Enable shared library versioning.
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
 
 # Xcode does not support -isystem yet.
 if(XCODE)
diff --git a/Source/cmGlobalXCodeGenerator.cxx 
b/Source/cmGlobalXCodeGenerator.cxx
index 240d60c..9bbf186 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1319,8 +1319,40 @@ void 
cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
 = cmtarget.GetPreBuildCommands();
   std::vector const & prelink
 = cmtarget.GetPreLinkCommands();
-  std::vector const & postbuild
+  std::vector postbuild
 = cmtarget.GetPostBuildCommands();
+
+  if(cmtarget.GetType() == cmTarget::SHARED_LIBRARY &&
+!cmtarget.IsFrameworkOnApple())
+{
+cmCustomCommandLines cmd;
+cmd.resize(1);
+cmd[0].push_back(this->CurrentMakefile->GetDefinition("CMAKE_COMMAND"));
+cmd[0].push_back("-E");
+cmd[0].push_back("cmake_symlink_library");
+std::string str_file = "$CurrentMakefile,
+  std::vector(),
+  std::vector(),
+  cmd,
+  "Creating symlinks",
+  "");
+
+postbuild.push_back(command);
+}
+
   std::vectorconst &classes = cmtarget.GetSourceFiles();
   // add all the sources
   std::vector commands;
@@ -1797,9 +1829,34 @@ void 
cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
   std::string pnprefix;
   std::string pnbase;
   std::string pnsuffix;
-
   target.GetFullNameComponents(pnprefix, pnbase, pnsuffix, configName);
 
+  const char* version = target.GetProperty("VERSION");
+  const char* soversion = target.GetProperty("SOVERSION");
+  if(!target.HasSOName(configName) || target.IsFrameworkOnApple())
+{
+version = 0;
+soversion = 0;
+}
+  if(version && !soversion)
+{
+soversion = version;
+}
+  if(!version && soversion)
+{
+version = soversion;
+}
+
+  std::string realName = pnbase;
+  std::string soName = pnbase;
+  if(version && soversion)
+{
+realName += ".";
+realName += version;
+soName += ".";
+soName += soversion;
+}
+
   // Set attributes to specify the proper name for the target.
   std::string pndir = this->CurrentMakefile->GetCurrentOutputDirectory();
   if(target.GetType() == cmTarget::STATIC_LIBRARY ||
@@ -1857,7 +1914,7 @@ void 
cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 
   // Store the product name for all target types.
   buildSettings->AddAttribute("PRODUCT_NAME",
-  this->CreateString(pnbase.c_str()));
+  this->CreateString(realName.c_str()));
   buildSettings->AddAttribute("SYMROOT",
   this->CreateString(pndir.c_str()));
 
@@ -1935,9 +1992,9 @@ void 
cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 {
 if(target.GetPropertyAsBool("FRAMEWORK"))
   {
-  std::string version = target.GetFra

[Cmake-commits] CMake branch, next, updated. v2.8.11-2301-g7f692b1

2013-05-29 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
   via  7f692b1ddb83ae7ab67d48a1718aeb3e033408b6 (commit)
   via  2c0c59a2e182e25844ded2a551a79e58ab3b3c49 (commit)
   via  927012979e54a69d9d49f188ce73f7b4ca2fb073 (commit)
   via  6927b25affcb9e2e01fb226970fd91db143b5101 (commit)
  from  f1977e36c024b42c8f408e9ef2e2756a5410b6de (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f692b1ddb83ae7ab67d48a1718aeb3e033408b6
commit 7f692b1ddb83ae7ab67d48a1718aeb3e033408b6
Merge: f1977e3 2c0c59a
Author: Brad King 
AuthorDate: Wed May 29 08:59:14 2013 -0400
Commit: CMake Topic Stage 
CommitDate: Wed May 29 08:59:14 2013 -0400

Merge topic 'update-kwsys' into next

2c0c59a Merge branch 'upstream-kwsys' into update-kwsys
9270129 KWSys 2013-05-29 (725e541e)
6927b25 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2c0c59a2e182e25844ded2a551a79e58ab3b3c49
commit 2c0c59a2e182e25844ded2a551a79e58ab3b3c49
Merge: 6927b25 9270129
Author: Brad King 
AuthorDate: Wed May 29 08:56:20 2013 -0400
Commit: Brad King 
CommitDate: Wed May 29 08:56:20 2013 -0400

Merge branch 'upstream-kwsys' into update-kwsys


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=927012979e54a69d9d49f188ce73f7b4ca2fb073
commit 927012979e54a69d9d49f188ce73f7b4ca2fb073
Author: KWSys Robot 
AuthorDate: Wed May 29 08:55:14 2013 -0400
Commit: Brad King 
CommitDate: Wed May 29 08:56:13 2013 -0400

KWSys 2013-05-29 (725e541e)

Extract upstream KWSys using the following shell commands.

$ git archive --prefix=upstream-kwsys/ 725e541e | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' f4928d44..725e541e
Brad King (1):
  9fd64779 SystemTools: Fix FileIsDirectory with long paths

Rolf Eike Beer (3):
  e8269442 Tests: fix a warning with acc
  87abd647 SystemInformation: fix truncation warnings
  039d9598 fix warnings about sizeof() return value truncation

Change-Id: I1c459346a622610eac62dfcd3abd0e73c5a83494

diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index 9e2a93d..9db1dee 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -1471,7 +1471,7 @@ int 
SystemInformationImplementation::GetFullyQualifiedDomainName(
   {
   char host[NI_MAXHOST]={'\0'};
 
-  int addrlen
+  socklen_t addrlen
 = (fam==AF_INET?sizeof(struct sockaddr_in):sizeof(struct 
sockaddr_in6));
 
   ierr=getnameinfo(
@@ -3487,7 +3487,7 @@ bool SystemInformationImplementation::QueryLinuxMemory()
 bool have[6] = { false, false, false, false, false, false };
 unsigned long value[6];
 int count = 0;
-while(fgets(buffer, sizeof(buffer), fd))
+while(fgets(buffer, static_cast(sizeof(buffer)), fd))
   {
   for(int i=0; i < 6; ++i)
 {
diff --git a/SystemTools.cxx b/SystemTools.cxx
index 394d65e..158217e 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -2742,14 +2742,23 @@ bool SystemTools::FileIsDirectory(const char* name)
 }
 
   // Remove any trailing slash from the name except in a root component.
-  char buffer[KWSYS_SYSTEMTOOLS_MAXPATH];
+  char local_buffer[KWSYS_SYSTEMTOOLS_MAXPATH];
+  std::string string_buffer;
   size_t last = length-1;
   if(last > 0 && (name[last] == '/' || name[last] == '\\')
 && strcmp(name, "/") !=0 && name[last-1] != ':')
 {
-memcpy(buffer, name, last);
-buffer[last] = 0;
-name = buffer;
+if(last < sizeof(local_buffer))
+  {
+  memcpy(local_buffer, name, last);
+  local_buffer[last] = 0;
+  name = local_buffer;
+  }
+else
+  {
+  string_buffer.append(name, last);
+  name = string_buffer.c_str();
+  }
 }
 
   // Now check the file node type.
diff --git a/testIOS.cxx b/testIOS.cxx
index 3b971e2..f0c7f1a 100644
--- a/testIOS.cxx
+++ b/testIOS.cxx
@@ -48,7 +48,7 @@ int testIOS(int, char*[])
 return 1;
 }
   static const unsigned char array[] = { 
0xff,0x4f,0xff,0x51,0x00,0x29,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,0x01,0x01,0xff,0x52,0x00,0x0c,0x00,0x00,0x00,0x01,0x00,0x05,0x04,0x04,0x00,0x01,0xff,0x5c,0x00,0x13,0x40,0x40,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0xff,0x64,0x00,0x2c,0x00,0x00,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x62,0x79,0x20,0x49,0x54,0x4b,0x2f,0x47,0x44,0x43,0x4d,0x2f,0x4f,0x70,0x65,0x6e,0x4a,0x50,0x45,0x47,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6

[Cmake-commits] CMake branch, next, updated. v2.8.11-2305-g026e51a

2013-05-29 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
   via  026e51ac00810d47a1639b4380e27edccfd5cf25 (commit)
   via  7378792b4938d32c5eefc5bb485ecae1a7ec95fb (commit)
   via  4ab10e063d8f640d9a3fa029fe9993e94f4096c3 (commit)
   via  045d6ae0b042d4e6e3c4540c32559c58cb4153b0 (commit)
  from  7f692b1ddb83ae7ab67d48a1718aeb3e033408b6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=026e51ac00810d47a1639b4380e27edccfd5cf25
commit 026e51ac00810d47a1639b4380e27edccfd5cf25
Merge: 7f692b1 7378792
Author: Brad King 
AuthorDate: Wed May 29 08:59:33 2013 -0400
Commit: CMake Topic Stage 
CommitDate: Wed May 29 08:59:33 2013 -0400

Merge topic 'fix-FileIsDirectory-SEGV' into next

7378792 if: Add test for IS_DIRECTORY
4ab10e0 Merge branch 'master' into fix-FileIsDirectory-SEGV
045d6ae KWSys: Fix SystemTools::FileIsDirectory with long paths (#14176)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7378792b4938d32c5eefc5bb485ecae1a7ec95fb
commit 7378792b4938d32c5eefc5bb485ecae1a7ec95fb
Author: Brad King 
AuthorDate: Tue May 28 11:13:24 2013 -0400
Commit: Brad King 
CommitDate: Tue May 28 11:35:32 2013 -0400

if: Add test for IS_DIRECTORY

Add a RunCMake.if test to cover if() command behavior.  Start with a
test for IS_DIRECTORY cases with an existing directory and a long path,
both with a trailing slash.

diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index f676107..a0168a6 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -72,6 +72,7 @@ add_RunCMake_test(add_dependencies)
 add_RunCMake_test(build_command)
 add_RunCMake_test(find_package)
 add_RunCMake_test(get_filename_component)
+add_RunCMake_test(if)
 add_RunCMake_test(include)
 add_RunCMake_test(include_directories)
 add_RunCMake_test(list)
diff --git a/Tests/RunCMake/if/CMakeLists.txt b/Tests/RunCMake/if/CMakeLists.txt
new file mode 100644
index 000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/if/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/if/IsDirectory-stdout.txt 
b/Tests/RunCMake/if/IsDirectory-stdout.txt
new file mode 100644
index 000..b89446a
--- /dev/null
+++ b/Tests/RunCMake/if/IsDirectory-stdout.txt
@@ -0,0 +1 @@
+CMAKE_CURRENT_SOURCE_DIR exists, tested with trailing slash
diff --git a/Tests/RunCMake/if/IsDirectory.cmake 
b/Tests/RunCMake/if/IsDirectory.cmake
new file mode 100644
index 000..23d126d
--- /dev/null
+++ b/Tests/RunCMake/if/IsDirectory.cmake
@@ -0,0 +1,5 @@
+if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/")
+  message(STATUS "CMAKE_CURRENT_SOURCE_DIR exists, tested with trailing slash")
+else()
+  message(FATAL_ERROR "CMAKE_CURRENT_SOURCE_DIR does not exist!")
+endif()
diff --git a/Tests/RunCMake/if/IsDirectoryLong-stdout.txt 
b/Tests/RunCMake/if/IsDirectoryLong-stdout.txt
new file mode 100644
index 000..5e62754
--- /dev/null
+++ b/Tests/RunCMake/if/IsDirectoryLong-stdout.txt
@@ -0,0 +1 @@
+Directory path with length 94208 correctly does not exist.
diff --git a/Tests/RunCMake/if/IsDirectoryLong.cmake 
b/Tests/RunCMake/if/IsDirectoryLong.cmake
new file mode 100644
index 000..0e93be7
--- /dev/null
+++ b/Tests/RunCMake/if/IsDirectoryLong.cmake
@@ -0,0 +1,10 @@
+set(d "/long/path/to/directory")
+foreach(i RANGE 11)
+  set(d "${d}${d}")
+endforeach()
+string(LENGTH "${d}" dl)
+if(IS_DIRECTORY "${d}/")
+  message(FATAL_ERROR "Directory should not exist!")
+else()
+  message(STATUS "Directory path with length ${dl} correctly does not exist.")
+endif()
diff --git a/Tests/RunCMake/if/RunCMakeTest.cmake 
b/Tests/RunCMake/if/RunCMakeTest.cmake
new file mode 100644
index 000..6b6b74b
--- /dev/null
+++ b/Tests/RunCMake/if/RunCMakeTest.cmake
@@ -0,0 +1,4 @@
+include(RunCMake)
+
+run_cmake(IsDirectory)
+run_cmake(IsDirectoryLong)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ab10e063d8f640d9a3fa029fe9993e94f4096c3
commit 4ab10e063d8f640d9a3fa029fe9993e94f4096c3
Merge: 045d6ae 07afd4f
Author: Brad King 
AuthorDate: Tue May 28 11:34:28 2013 -0400
Commit: Brad King 
CommitDate: Tue May 28 11:34:50 2013 -0400

Merge branch 'master' into fix-FileIsDirectory-SEGV

Resolve conflict in Source/kwsys/SystemTools.cxx by combining the two
changes.

diff --cc Source/kwsys/SystemTools.cxx
index 8b25d60,394d65e..158217e
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@@ -2741,24 -2741,15 +2741,24 @@@ bool SystemTools::FileIsDirectory(cons
  return false;
  }