浏览代码

Merge remote-tracking branch 'origin/master' into automoc_qt5

Stephen Kelly 14 年之前
父节点
当前提交
b8c8cab242

+ 1 - 0
Modules/AutomocInfo.cmake.in

@@ -3,6 +3,7 @@ set(AM_HEADERS "@_moc_headers@" )
 set(AM_MOC_COMPILE_DEFINITIONS "@_moc_compile_defs@")
 set(AM_MOC_DEFINITIONS "@_moc_defs@")
 set(AM_MOC_INCLUDES "@_moc_incs@")
+set(AM_MOC_OPTIONS "@_moc_options@")
 set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@")
 set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/")
 set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/")

+ 61 - 8
Modules/CPackRPM.cmake

@@ -4,7 +4,12 @@
 # used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration
 #
 # However CPackRPM has specific features which are controlled by
-# the specifics CPACK_RPM_XXX variables.
+# the specifics CPACK_RPM_XXX variables. CPackRPM is a component aware
+# generator so when CPACK_RPM_COMPONENT_INSTALL is ON some more
+# CPACK_RPM_<ComponentName>_XXXX variables may be used in order
+# to have component specific values. Note however that <componentName>
+# refers to the **grouping name**. This may be either a component name
+# or a component GROUP name.
 # Usually those vars correspond to RPM spec file entities, one may find
 # information about spec files here http://www.rpm.org/wiki/Docs.
 # You'll find a detailed usage of CPackRPM on the wiki:
@@ -98,9 +103,11 @@
 #     If CPACK_SET_DESTDIR is set then you will get a warning message
 #     but if there is file installed with absolute path you'll get
 #     unexpected behavior.
-#  CPACK_RPM_SPEC_INSTALL_POST
+#  CPACK_RPM_SPEC_INSTALL_POST [deprecated]
 #     Mandatory : NO
 #     Default   : -
+#     This way of specifying post-install script is deprecated use
+#     CPACK_RPM_POST_INSTALL_SCRIPT_FILE
 #     May be used to set an RPM post-install command inside the spec file.
 #     For example setting it to "/bin/true" may be used to prevent
 #     rpmbuild to strip binaries.
@@ -158,7 +165,7 @@
 #     Mandatory : NO
 #     Default   : -
 #     May be used to embed a changelog in the spec file.
-#     The refered file will be read and directly  put after the %changelog
+#     The refered file will be read and directly put after the %changelog
 #     section.
 
 #=============================================================================
@@ -388,9 +395,33 @@ if(CPACK_RPM_PACKAGE_RELOCATABLE)
   endif(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
 endif(CPACK_RPM_PACKAGE_RELOCATABLE)
 
-# check if additional fields for RPM spec header are given
+# Check if additional fields for RPM spec header are given
+# There may be some COMPONENT specific variables as well
 FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
-  IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER})
+    IF(CPACK_RPM_PACKAGE_DEBUG)
+      message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
+    ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+    if(CPACK_RPM_PACKAGE_COMPONENT)
+        if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER})
+            IF(CPACK_RPM_PACKAGE_DEBUG)
+              message("CPackRPM:Debug: using CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}")
+            ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+            set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}})
+        else()
+            IF(CPACK_RPM_PACKAGE_DEBUG)
+              message("CPackRPM:Debug: CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER} not defined")
+              message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
+            ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+            set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
+        endif()
+    else()
+        IF(CPACK_RPM_PACKAGE_DEBUG)
+          message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
+        ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+        set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
+    endif()
+
+  IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
     STRING(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH)
     MATH(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1")
     STRING(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL)
@@ -398,10 +429,10 @@ FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLIC
     STRING(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
     SET(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
     IF(CPACK_RPM_PACKAGE_DEBUG)
-      MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}")
+      MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
     ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-    SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}")
-  ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER})
+    SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
+ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
 ENDFOREACH(_RPM_SPEC_HEADER)
 
 # CPACK_RPM_SPEC_INSTALL_POST
@@ -435,20 +466,31 @@ else(CPACK_RPM_PACKAGE_COMPONENT)
   set(CPACK_RPM_POST_INSTALL_READ_FILE ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE})
   set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
 endif(CPACK_RPM_PACKAGE_COMPONENT)
+
+# Handle post-install file if it has been specified
 if(CPACK_RPM_POST_INSTALL_READ_FILE)
   if(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
     file(READ ${CPACK_RPM_POST_INSTALL_READ_FILE} CPACK_RPM_SPEC_POSTINSTALL)
   else(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
     message("CPackRPM:Warning: CPACK_RPM_POST_INSTALL_SCRIPT_FILE <${CPACK_RPM_POST_INSTALL_READ_FILE}> does not exists - ignoring")
   endif(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
+else(CPACK_RPM_POST_INSTALL_READ_FILE)
+  # reset SPEC var value if no post install file has been specified
+  # (either globally or component-wise)
+  set(CPACK_RPM_SPEC_POSTINSTALL "")
 endif(CPACK_RPM_POST_INSTALL_READ_FILE)
 
+# Handle post-uninstall file if it has been specified
 if(CPACK_RPM_POST_UNINSTALL_READ_FILE)
   if(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
     file(READ ${CPACK_RPM_POST_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_POSTUNINSTALL)
   else(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
     message("CPackRPM:Warning: CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_POST_UNINSTALL_READ_FILE}> does not exists - ignoring")
   endif(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
+else(CPACK_RPM_POST_UNINSTALL_READ_FILE)
+  # reset SPEC var value if no post uninstall file has been specified
+  # (either globally or component-wise)
+  set(CPACK_RPM_SPEC_POSTUNINSTALL "")
 endif(CPACK_RPM_POST_UNINSTALL_READ_FILE)
 
 # CPACK_RPM_PRE_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE)
@@ -471,20 +513,31 @@ else(CPACK_RPM_PACKAGE_COMPONENT)
   set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
   set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
 endif(CPACK_RPM_PACKAGE_COMPONENT)
+
+# Handle pre-install file if it has been specified
 if(CPACK_RPM_PRE_INSTALL_READ_FILE)
   if(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
     file(READ ${CPACK_RPM_PRE_INSTALL_READ_FILE} CPACK_RPM_SPEC_PREINSTALL)
   else(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
     message("CPackRPM:Warning: CPACK_RPM_PRE_INSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_INSTALL_READ_FILE}> does not exists - ignoring")
   endif(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
+else(CPACK_RPM_PRE_INSTALL_READ_FILE)
+  # reset SPEC var value if no pre-install file has been specified
+  # (either globally or component-wise)
+  set(CPACK_RPM_SPEC_PREINSTALL "")
 endif(CPACK_RPM_PRE_INSTALL_READ_FILE)
 
+# Handle pre-uninstall file if it has been specified
 if(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
   if(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
     file(READ ${CPACK_RPM_PRE_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_PREUNINSTALL)
   else(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
     message("CPackRPM:Warning: CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_UNINSTALL_READ_FILE}> does not exists - ignoring")
   endif(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
+else(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
+  # reset SPEC var value if no pre-uninstall file has been specified
+  # (either globally or component-wise)
+  set(CPACK_RPM_SPEC_PREUNINSTALL "")
 endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
 
 # CPACK_RPM_CHANGELOG_FILE

+ 8 - 7
Modules/DeployQt4.cmake

@@ -56,7 +56,7 @@
 # (or <plugins_dir>) relative to <executable> and store the result in
 # <installed_plugin_path_var>. See documentation of INSTALL_QT4_PLUGIN_PATH.
 #
-#  INSTALL_QT4_EXECUTABLE(<executable> <qtplugins> [<libs> <dirs> <plugins_dir> <request_qt_conf>])
+#  INSTALL_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>])
 # Installs Qt plugins, writes a Qt configuration file (if needed) and fixes up
 # a Qt4 executable using BundleUtilities so it is standalone and can be
 # drag-and-drop copied to another machine as long as all of the system
@@ -106,7 +106,8 @@ function(resolve_qt4_paths paths_var)
         set(${paths_var} ${paths_resolved} PARENT_SCOPE)
 endfunction()
 
-function(fixup_qt4_executable executable qtplugins)
+function(fixup_qt4_executable executable)
+        set(qtplugins ${ARGV1})
         set(libs ${ARGV2})
         set(dirs ${ARGV3})
         set(plugins_dir ${ARGV4})
@@ -150,7 +151,6 @@ function(fixup_qt4_executable executable qtplugins)
         endforeach()
 
         resolve_qt4_paths(libs "${executable_path}")
-        resolve_qt4_paths(dirs "${executable_path}")
 
         if(write_qt_conf)
                 set(qt_conf_contents "[Paths]\nPlugins = ${plugins_dir}")
@@ -225,9 +225,11 @@ function(install_qt4_plugin plugin executable copy installed_plugin_path_var)
                 else()
                         string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var)
                 endif()
-                set(plugin_release "${${plugin_var}_RELEASE}")
-                set(plugin_debug "${${plugin_var}_DEBUG}")
-                if(NOT EXISTS "${plugin_release}" AND NOT EXISTS "${plugin_debug}")
+                set(plugin_release_var "${plugin_var}_RELEASE")
+                set(plugin_debug_var "${plugin_var}_DEBUG")
+                set(plugin_release "${${plugin_release_var}}")
+                set(plugin_debug "${${plugin_debug_var}}")
+                if(DEFINED "${plugin_release_var}" AND DEFINED "${plugin_debug_var}" AND NOT EXISTS "${plugin_release}" AND NOT EXISTS "${plugin_debug}")
                         message(WARNING "Qt plugin \"${plugin}\" not recognized or found.")
                 endif()
                 install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel")
@@ -264,7 +266,6 @@ function(install_qt4_executable executable)
         endforeach()
 
         resolve_qt4_paths(libs)
-        resolve_qt4_paths(dirs)
 
         install(CODE
                 " INCLUDE( \"${DeployQt4_cmake_dir}/DeployQt4.cmake\" )

+ 19 - 4
Modules/FindLibXslt.cmake

@@ -5,6 +5,9 @@
 #  LIBXSLT_INCLUDE_DIR - the LibXslt include directory
 #  LIBXSLT_LIBRARIES - Link these to LibXslt
 #  LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
+# Additionally, the following two variables are set (but not required for using xslt):
+#  LIBXSLT_EXSLT_LIBRARIES - Link to these if you need to link against the exslt library
+#  LIBXSLT_XSLTPROC_EXECUTABLE - Contains the full path to the xsltproc executable if found
 
 #=============================================================================
 # Copyright 2006-2009 Kitware, Inc.
@@ -23,7 +26,7 @@
 # use pkg-config to get the directories and then use these values
 # in the FIND_PATH() and FIND_LIBRARY() calls
 FIND_PACKAGE(PkgConfig)
-PKG_CHECK_MODULES(PC_LIBXSLT libxslt)
+PKG_CHECK_MODULES(PC_LIBXSLT QUIET libxslt)
 SET(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER})
 
 FIND_PATH(LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h
@@ -38,10 +41,22 @@ FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt
    ${PC_LIBXSLT_LIBRARY_DIRS}
   )
 
-# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if 
+FIND_LIBRARY(LIBXSLT_EXSLT_LIBRARY NAMES exslt libexslt
+    HINTS
+    ${PC_LIBXSLT_LIBDIR}
+    ${PC_LIBXSLT_LIBRARY_DIRS}
+  )
+
+SET(LIBXSLT_EXSLT_LIBRARIES ${LIBXSLT_EXSLT_LIBRARY} )
+
+FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc)
+
+# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt DEFAULT_MSG LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR)
 
-MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR LIBXSLT_LIBRARIES)
-
+MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR
+                 LIBXSLT_LIBRARIES
+                 LIBXSLT_EXSLT_LIBRARY
+                 LIBXSLT_XSLTPROC_EXECUTABLE)

+ 29 - 7
Source/cmCTest.cxx

@@ -655,10 +655,26 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
     }
 
   cmMakefile* mf = command->GetMakefile();
-  std::string fname = src_dir;
-  fname += "/CTestConfig.cmake";
-  cmSystemTools::ConvertToUnixSlashes(fname);
-  if ( cmSystemTools::FileExists(fname.c_str()) )
+  std::string fname;
+
+  std::string src_dir_fname = src_dir;
+  src_dir_fname += "/CTestConfig.cmake";
+  cmSystemTools::ConvertToUnixSlashes(src_dir_fname);
+
+  std::string bld_dir_fname = bld_dir;
+  bld_dir_fname += "/CTestConfig.cmake";
+  cmSystemTools::ConvertToUnixSlashes(bld_dir_fname);
+
+  if ( cmSystemTools::FileExists(bld_dir_fname.c_str()) )
+    {
+    fname = bld_dir_fname;
+    }
+  else if ( cmSystemTools::FileExists(src_dir_fname.c_str()) )
+    {
+    fname = src_dir_fname;
+    }
+
+  if ( !fname.empty() )
     {
     cmCTestLog(this, OUTPUT, "   Reading ctest configuration file: "
       << fname.c_str() << std::endl);
@@ -674,8 +690,12 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
     }
   else
     {
-    cmCTestLog(this, WARNING, "Cannot locate CTest configuration: "
-      << fname.c_str() << std::endl);
+    cmCTestLog(this, WARNING,
+      "Cannot locate CTest configuration: in BuildDirectory: "
+      << bld_dir_fname.c_str() << std::endl);
+    cmCTestLog(this, WARNING,
+      "Cannot locate CTest configuration: in SourceDirectory: "
+      << src_dir_fname.c_str() << std::endl);
     }
 
   this->SetCTestConfigurationFromCMakeVariable(mf, "NightlyStartTime",
@@ -2526,6 +2546,8 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const char* def,
   cmSystemTools::ExpandListArgument(dval, slist);
   std::vector<std::string>::iterator it;
 
+  vec.clear();
+
   for ( it = slist.begin(); it != slist.end(); ++it )
     {
     cmCTestLog(this, DEBUG, "  -- " << it->c_str() << std::endl);
@@ -2801,7 +2823,7 @@ bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf,
     }
   cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
              "SetCTestConfigurationFromCMakeVariable:"
-             << dconfig << ":" << cmake_var);
+             << dconfig << ":" << cmake_var << std::endl);
   this->SetCTestConfiguration(dconfig, ctvar);
   return true;
 }

+ 3 - 2
Source/cmComputeLinkInformation.cxx

@@ -1318,8 +1318,9 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item)
   this->AddFrameworkPath(this->SplitFramework.match(1));
 
   // Add the item using the -framework option.
-  std::string fw = "-framework ";
-  fw += this->SplitFramework.match(2);
+  this->Items.push_back(Item("-framework", false));
+  std::string fw = this->SplitFramework.match(2);
+  fw = this->LocalGenerator->EscapeForShell(fw.c_str());
   this->Items.push_back(Item(fw, false));
 }
 

+ 10 - 1
Source/cmDocumentVariables.cxx

@@ -126,7 +126,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      "This variable is set to the program that will be"
      " needed to build the output of CMake.   If the "
      "generator selected was Visual Studio 6, the "
-     "CMAKE_MAKE_PROGRAM will be set to msdev, for "
+     "CMAKE_BUILD_TOOL will be set to msdev, for "
      "Unix makefiles it will be set to make or gmake, "
      "and for Visual Studio 7 it set to devenv.  For "
      "Nmake Makefiles the value is nmake. This can be "
@@ -1102,6 +1102,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      false,
      "Variables that Control the Build");
 
+  cm->DefineProperty
+    ("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. "
+     "See that target property for additional information.",
+     false,
+     "Variables that Control the Build");
+
   cm->DefineProperty
     ("CMAKE_DEBUG_POSTFIX", cmProperty::VARIABLE,
      "See variable CMAKE_<CONFIG>_POSTFIX.",

+ 15 - 1
Source/cmExtraEclipseCDT4Generator.cxx

@@ -87,6 +87,16 @@ void cmExtraEclipseCDT4Generator::Generate()
   this->GenerateSourceProject = (this->IsOutOfSourceBuild &&
                             mf->IsOn("ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT"));
 
+  if (cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
+                                    this->HomeDirectory.c_str()))
+    {
+    mf->IssueMessage(cmake::WARNING, "The build directory is a subdirectory "
+                     "of the source directory.\n"
+                     "This is not supported well by Eclipse. It is strongly "
+                     "recommended to use a build directory which is a "
+                     "sibling of the source directory.");
+    }
+
   // NOTE: This is not good, since it pollutes the source tree. However,
   //       Eclipse doesn't allow CVS/SVN to work when the .project is not in
   //       the cvs/svn root directory. Hence, this is provided as an option.
@@ -998,7 +1008,11 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
           std::string virtDir = "[Targets]/";
           virtDir += prefix;
           virtDir += ti->first;
-          this->AppendTarget(fout, "Build", make, makeArgs, virtDir, "",
+          std::string buildArgs = "-C \"";
+          buildArgs += makefile->GetHomeOutputDirectory();
+          buildArgs += "\" ";
+          buildArgs += makeArgs;
+          this->AppendTarget(fout, "Build", make, buildArgs, virtDir, "",
                              ti->first.c_str());
 
           std::string cleanArgs = "-E chdir \"";

+ 6 - 1
Source/cmLinkDirectoriesCommand.h

@@ -65,7 +65,12 @@ public:
       "For historical reasons, relative paths given to this command are "
       "passed to the linker unchanged "
       "(unlike many CMake commands which interpret them relative to the "
-      "current source directory)."
+      "current source directory).\n"
+      "Note that this command is rarely necessary.  Library locations "
+      "returned by find_package() and find_library() are absolute paths.  "
+      "Pass these absolute library file paths directly to the "
+      "target_link_libraries() command.  CMake will ensure the linker finds "
+      "them."
       ;
     }
   

+ 26 - 18
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -607,6 +607,27 @@ cmLocalUnixMakefileGenerator3
     }
 }
 
+//----------------------------------------------------------------------------
+std::string
+cmLocalUnixMakefileGenerator3
+::ConvertShellCommand(std::string const& cmd, RelativeRoot root)
+{
+  if(this->WatcomWMake &&
+     cmSystemTools::FileIsFullPath(cmd.c_str()) &&
+     cmd.find_first_of("( )") != cmd.npos)
+    {
+    // On Watcom WMake use the windows short path for the command
+    // name.  This is needed to avoid funny quoting problems on
+    // lines with shell redirection operators.
+    std::string scmd;
+    if(cmSystemTools::GetShortPath(cmd.c_str(), scmd))
+      {
+      return this->Convert(scmd.c_str(), NONE, SHELL);
+      }
+    }
+  return this->Convert(cmd.c_str(), root, SHELL);
+}
+
 //----------------------------------------------------------------------------
 void
 cmLocalUnixMakefileGenerator3
@@ -646,13 +667,13 @@ cmLocalUnixMakefileGenerator3
   makefileStream
     << "# The CMake executable.\n"
     << "CMAKE_COMMAND = "
-    << this->Convert(cmakecommand.c_str(), FULL, SHELL).c_str()
+    << this->ConvertShellCommand(cmakecommand, FULL)
     << "\n"
     << "\n";
   makefileStream
     << "# The command to remove a file.\n"
     << "RM = "
-    << this->Convert(cmakecommand.c_str(),FULL,SHELL).c_str()
+    << this->ConvertShellCommand(cmakecommand, FULL)
     << " -E remove -f\n"
     << "\n";
 
@@ -662,7 +683,7 @@ cmLocalUnixMakefileGenerator3
     makefileStream
       << "# The program to use to edit the cache.\n"
       << "CMAKE_EDIT_COMMAND = "
-      << this->Convert(edit_cmd,FULL,SHELL) << "\n"
+      << this->ConvertShellCommand(edit_cmd, FULL) << "\n"
       << "\n";
     }
 
@@ -697,7 +718,7 @@ cmLocalUnixMakefileGenerator3
   // This should be the first target except for the default_target in
   // the interface Makefile.
   this->WriteMakeRule(
-    makefileStream, "Disable implicit rules so canoncical targets will work.",
+    makefileStream, "Disable implicit rules so canonical targets will work.",
     ".SUFFIXES", no_depends, no_commands, false);
 
   if(!this->NMake && !this->WatcomWMake && !this->BorlandMakeCurlyHack)
@@ -1019,22 +1040,9 @@ cmLocalUnixMakefileGenerator3
         // without the current directory being in the search path.
         cmd = "./" + cmd;
         }
-      if(this->WatcomWMake &&
-         cmSystemTools::FileIsFullPath(cmd.c_str()) &&
-         cmd.find(" ") != cmd.npos)
-        {
-        // On Watcom WMake use the windows short path for the command
-        // name.  This is needed to avoid funny quoting problems on
-        // lines with shell redirection operators.
-        std::string scmd;
-        if(cmSystemTools::GetShortPath(cmd.c_str(), scmd))
-          {
-          cmd = scmd;
-          }
-        }
       std::string launcher =
         this->MakeLauncher(cc, target, workingDir? NONE : START_OUTPUT);
-      cmd = launcher + this->Convert(cmd.c_str(),NONE,SHELL);
+      cmd = launcher + this->ConvertShellCommand(cmd, NONE);
 
       ccg.AppendArguments(c, cmd);
       if(content)

+ 1 - 0
Source/cmLocalUnixMakefileGenerator3.h

@@ -340,6 +340,7 @@ protected:
   void CheckMultipleOutputs(bool verbose);
 
 private:
+  std::string ConvertShellCommand(std::string const& cmd, RelativeRoot root);
   std::string MakeLauncher(const cmCustomCommand& cc, cmTarget* target,
                            RelativeRoot relative);
 

+ 7 - 0
Source/cmLocalVisualStudio7Generator.cxx

@@ -1811,11 +1811,18 @@ void cmLocalVisualStudio7Generator::WriteProjectSCC(std::ostream& fout,
   const char* vsProjectname = target.GetProperty("VS_SCC_PROJECTNAME");
   const char* vsLocalpath = target.GetProperty("VS_SCC_LOCALPATH");
   const char* vsProvider = target.GetProperty("VS_SCC_PROVIDER");
+
   if(vsProvider && vsLocalpath && vsProjectname)
     {
     fout << "\tSccProjectName=\"" << vsProjectname << "\"\n"
          << "\tSccLocalPath=\"" << vsLocalpath << "\"\n"
          << "\tSccProvider=\"" << vsProvider << "\"\n";
+
+    const char* vsAuxPath = target.GetProperty("VS_SCC_AUXPATH");
+    if(vsAuxPath)
+      {
+      fout << "\tSccAuxPath=\"" << vsAuxPath << "\"\n";
+      }
     }
 }
 

+ 21 - 5
Source/cmQtAutomoc.cxx

@@ -71,7 +71,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
   targetDir += ".dir/";
 
   cmCustomCommandLine currentLine;
-  currentLine.push_back(makefile->GetCMakeInstance()->GetCMakeCommand());
+  currentLine.push_back(makefile->GetSafeDefinition("CMAKE_COMMAND"));
   currentLine.push_back("-E");
   currentLine.push_back("cmake_automoc");
   currentLine.push_back(targetDir);
@@ -128,9 +128,15 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
       }
     }
 
-  std::string _moc_incs = makefile->GetProperty("INCLUDE_DIRECTORIES");
-  std::string _moc_defs = makefile->GetProperty("DEFINITIONS");
-  std::string _moc_compile_defs = makefile->GetProperty("COMPILE_DEFINITIONS");
+  const char* tmp = makefile->GetProperty("INCLUDE_DIRECTORIES");
+  std::string _moc_incs = (tmp!=0 ? tmp : "");
+  tmp = makefile->GetProperty("DEFINITIONS");
+  std::string _moc_defs = (tmp!=0 ? tmp : "");
+  tmp = makefile->GetProperty("COMPILE_DEFINITIONS");
+  std::string _moc_compile_defs = (tmp!=0 ? tmp : "");
+  tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS");
+  std::string _moc_options = (tmp!=0 ? tmp : "");
+
   // forget the variables added here afterwards again:
   cmMakefile::ScopePushPop varScope(makefile);
   static_cast<void>(varScope);
@@ -139,10 +145,11 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
   makefile->AddDefinition("_moc_incs", _moc_incs.c_str());
   makefile->AddDefinition("_moc_defs", _moc_defs.c_str());
   makefile->AddDefinition("_moc_compile_defs", _moc_compile_defs.c_str());
+  makefile->AddDefinition("_moc_options", _moc_options.c_str());
   makefile->AddDefinition("_moc_files", _moc_files.c_str());
   makefile->AddDefinition("_moc_headers", _moc_headers.c_str());
 
-  const char* cmakeRoot = makefile->GetDefinition("CMAKE_ROOT");
+  const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
   std::string inputFile = cmakeRoot;
   inputFile += "/Modules/AutomocInfo.cmake.in";
   std::string outputFile = targetDir;
@@ -235,6 +242,7 @@ bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile,
                                                  "AM_MOC_COMPILE_DEFINITIONS");
   this->MocDefinitionsStr = makefile->GetSafeDefinition("AM_MOC_DEFINITIONS");
   this->MocIncludesStr = makefile->GetSafeDefinition("AM_MOC_INCLUDES");
+  this->MocOptionsStr = makefile->GetSafeDefinition("AM_MOC_OPTIONS");
   this->ProjectBinaryDir = makefile->GetSafeDefinition("AM_CMAKE_BINARY_DIR");
   this->ProjectSourceDir = makefile->GetSafeDefinition("AM_CMAKE_SOURCE_DIR");
   this->TargetName = makefile->GetSafeDefinition("AM_TARGET_NAME");
@@ -311,6 +319,8 @@ void cmQtAutomoc::Init()
       }
     }
 
+  cmSystemTools::ExpandListArgument(this->MocOptionsStr, this->MocOptions);
+
   std::vector<std::string> incPaths;
   cmSystemTools::ExpandListArgument(this->MocIncludesStr, incPaths);
 
@@ -720,6 +730,12 @@ bool cmQtAutomoc::GenerateMoc(const std::string& sourceFile,
       {
       command.push_back(*it);
       }
+    for(std::vector<std::string>::const_iterator it=this->MocOptions.begin();
+        it != this->MocOptions.end();
+        ++it)
+      {
+      command.push_back(*it);
+      }
 #ifdef _WIN32
     command.push_back("-DWIN32");
 #endif

+ 2 - 0
Source/cmQtAutomoc.h

@@ -62,6 +62,7 @@ private:
   std::string MocCompileDefinitionsStr;
   std::string MocDefinitionsStr;
   std::string MocIncludesStr;
+  std::string MocOptionsStr;
   std::string ProjectBinaryDir;
   std::string ProjectSourceDir;
   std::string TargetName;
@@ -71,6 +72,7 @@ private:
   std::string OutMocCppFilename;
   std::list<std::string> MocIncludes;
   std::list<std::string> MocDefinitions;
+  std::vector<std::string> MocOptions;
 
   bool Verbose;
   bool ColorOutput;

+ 2 - 1
Source/cmSetTargetPropertiesCommand.h

@@ -140,7 +140,8 @@ public:
         "the target in an IDE like visual studio.  VS_KEYWORD can be set "
         "to change the visual studio keyword, for example QT integration "
         "works better if this is set to Qt4VSv1.0.\n"
-        "VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER can be set "
+        "VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER and "
+        "VS_SCC_AUXPATH can be set "
         "to add support for source control bindings in a  Visual Studio "
         "project file.\n"
         "VS_GLOBAL_<variable> can be set to add a Visual Studio "

+ 21 - 2
Source/cmTarget.cxx

@@ -157,7 +157,20 @@ void cmTarget::DefineProperties(cmake *cm)
      "files are included in a generated <targetname>_automoc.cpp file, "
      "which is compiled as part of the target."
      "This property is initialized by the value of the variable "
-     "CMAKE_AUTOMOC if it is set when a target is created.");
+     "CMAKE_AUTOMOC if it is set when a target is created.\n"
+     "Additional command line options for moc can be set via the "
+     "AUTOMOC_MOC_OPTIONS property."
+    );
+
+  cm->DefineProperty
+    ("AUTOMOC_MOC_OPTIONS", cmProperty::TARGET,
+    "Additional options for moc when using automoc (see the AUTOMOC property)",
+     "This property is only used if the AUTOMOC property is set to TRUE for "
+     "this target. In this case, it holds additional command line options "
+     "which will be used when moc is executed during the build, i.e. it is "
+     "equivalent to the optional OPTIONS argument of the qt4_wrap_cpp() "
+     "macro.\n"
+     "By default it is empty.");
 
   cm->DefineProperty
     ("BUILD_WITH_INSTALL_RPATH", cmProperty::TARGET,
@@ -1011,7 +1024,7 @@ void cmTarget::DefineProperties(cmake *cm)
      "provider property.");
   cm->DefineProperty
     ("VS_SCC_LOCALPATH", cmProperty::TARGET,
-     "Visual Studio Source Code Control Provider.",
+     "Visual Studio Source Code Control Local Path.",
      "Can be set to change the visual studio source code control "
      "local path property.");
   cm->DefineProperty
@@ -1019,6 +1032,11 @@ void cmTarget::DefineProperties(cmake *cm)
      "Visual Studio Source Code Control Project.",
      "Can be set to change the visual studio source code control "
      "project name property.");
+  cm->DefineProperty
+    ("VS_SCC_AUXPATH", cmProperty::TARGET,
+     "Visual Studio Source Code Control Aux Path.",
+     "Can be set to change the visual studio source code control "
+     "auxpath property.");
   cm->DefineProperty
     ("VS_GLOBAL_<variable>", cmProperty::TARGET,
      "Visual Studio project-specific global variable.",
@@ -1179,6 +1197,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
   this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", 0);
   this->SetPropertyDefault("OSX_ARCHITECTURES", 0);
   this->SetPropertyDefault("AUTOMOC", 0);
+  this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", 0);
   this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", 0);
 
   // Collect the set of configuration types.

+ 9 - 1
Source/cmVisualStudio10TargetGenerator.cxx

@@ -182,7 +182,7 @@ void cmVisualStudio10TargetGenerator::Generate()
   const char* vsLocalPath = this->Target->GetProperty("VS_SCC_LOCALPATH");
   const char* vsProvider = this->Target->GetProperty("VS_SCC_PROVIDER");
 
-  if ( vsProjectName && vsLocalPath && vsProvider)
+  if( vsProjectName && vsLocalPath && vsProvider )
     {
     this->WriteString("<SccProjectName>", 2);
     (*this->BuildFileStream) << cmVS10EscapeXML(vsProjectName) <<
@@ -193,6 +193,14 @@ void cmVisualStudio10TargetGenerator::Generate()
     this->WriteString("<SccProvider>", 2);
     (*this->BuildFileStream) << cmVS10EscapeXML(vsProvider) <<
       "</SccProvider>\n";
+
+    const char* vsAuxPath = this->Target->GetProperty("VS_SCC_AUXPATH");
+    if( vsAuxPath )
+      {
+      this->WriteString("<SccAuxPath>", 2);
+       (*this->BuildFileStream) << cmVS10EscapeXML(vsAuxPath) <<
+         "</SccAuxPath>\n";
+      }
     }
 
   this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2);

+ 1 - 1
Source/kwsys/CommandLineArguments.cxx

@@ -592,7 +592,7 @@ void CommandLineArguments::GenerateHelp()
 
   // Create format for that string
   char format[80];
-  sprintf(format, "  %%-%ds  ", static_cast<unsigned int>(maxlen));
+  sprintf(format, "  %%-%us  ", static_cast<unsigned int>(maxlen));
 
   maxlen += 4; // For the space before and after the option
 

+ 20 - 25
Source/kwsys/SystemInformation.cxx

@@ -72,7 +72,7 @@
 # include <ctype.h> // int isdigit(int c);
 # include <errno.h> // extern int errno;
 # include <sys/time.h>
-#elif __hpux
+#elif defined( __hpux )
 # include <sys/param.h>
 # include <sys/pstat.h>
 #endif
@@ -1454,7 +1454,7 @@ bool SystemInformationImplementation::RetrieveCPUClockSpeed()
 {
   bool retrieved = false;
 
-#if _WIN32
+#if defined(_WIN32)
   // First of all we check to see if the RDTSC (0x0F, 0x31) instruction is
   // supported. If not, we fallback to trying to read this value from the
   // registry:
@@ -2389,7 +2389,7 @@ int SystemInformationImplementation::QueryMemory()
   this->AvailablePhysicalMemory = 0;
 #ifdef __CYGWIN__
   return 0;
-#elif _WIN32
+#elif defined(_WIN32)
 #if  _MSC_VER < 1300
   MEMORYSTATUS ms;
   unsigned long tv, tp, av, ap;
@@ -2415,7 +2415,7 @@ int SystemInformationImplementation::QueryMemory()
   this->AvailableVirtualMemory = av>>10>>10;
   this->AvailablePhysicalMemory = ap>>10>>10;
   return 1;
-#elif __linux
+#elif defined(__linux)
   unsigned long tv=0;
   unsigned long tp=0;
   unsigned long av=0;
@@ -2532,7 +2532,7 @@ int SystemInformationImplementation::QueryMemory()
     }
   fclose( fd );
   return 1;
-#elif __hpux
+#elif defined(__hpux)
   unsigned long tv=0;
   unsigned long tp=0;
   unsigned long av=0;
@@ -2639,7 +2639,7 @@ LongLong SystemInformationImplementation::GetCyclesDifference (DELAY_FUNC DelayF
 /** Compute the delay overhead */
 void SystemInformationImplementation::DelayOverhead(unsigned int uiMS)
 {
-#if _WIN32
+#if defined(_WIN32)
   LARGE_INTEGER Frequency, StartCounter, EndCounter;
   __int64 x;
 
@@ -2664,10 +2664,19 @@ void SystemInformationImplementation::DelayOverhead(unsigned int uiMS)
 /** Return the number of logical CPU per physical CPUs Works only for windows */
 unsigned char SystemInformationImplementation::LogicalCPUPerPhysicalCPU(void)
 {
+#ifdef __APPLE__
+  size_t len = 4;
+  int cores_per_package = 0;
+  int err = sysctlbyname("machdep.cpu.cores_per_package", &cores_per_package, &len, NULL, 0);
+  if (err != 0)
+    {
+      return 1; // That name was not found, default to 1
+    }
+  return static_cast<unsigned char>(cores_per_package);
+#else
   unsigned int Regebx = 0;
-
 #if USE_ASM_INSTRUCTIONS
-  if (!this->IsHyperThreadingSupported()) 
+  if (!this->IsHyperThreadingSupported())
     {
     return static_cast<unsigned char>(1);  // HT not supported
     }
@@ -2678,22 +2687,8 @@ unsigned char SystemInformationImplementation::LogicalCPUPerPhysicalCPU(void)
     mov Regebx, ebx
     }
 #endif
-
-#ifdef __APPLE__
-    size_t len = 4;
-    int cores_per_package = 0;
-    int err = sysctlbyname("machdep.cpu.cores_per_package", &cores_per_package, &len, NULL, 0);
-    if (err != 0)
-    {
-      return 1; // That name was not found, default to 1
-    }
-    else
-    {
-      return static_cast<unsigned char>(cores_per_package);
-    }
-#endif
-
   return static_cast<unsigned char> ((Regebx & NUM_LOGICAL_BITS) >> 16);
+#endif
 }
 
 
@@ -2769,7 +2764,7 @@ unsigned char SystemInformationImplementation::GetAPICId()
 /** Count the number of CPUs. Works only on windows. */
 int SystemInformationImplementation::CPUCount()
 {
-#if _WIN32
+#if defined(_WIN32)
   unsigned char StatusFlag  = 0;
   SYSTEM_INFO info;
 
@@ -3359,7 +3354,7 @@ bool SystemInformationImplementation::QueryQNXProcessor()
 /** Query the operating system information */
 bool SystemInformationImplementation::QueryOSInformation()
 {
-#if _WIN32
+#if defined(_WIN32)
 
   this->OSName = "Windows";
 

+ 8 - 0
Source/kwsys/SystemTools.cxx

@@ -371,6 +371,10 @@ bool SystemTools::GetEnv(const char* key, kwsys_stl::string& result)
     }
 }
 
+#ifdef INTEL_COMPILER
+#pragma warning disable 444
+#endif
+
 class kwsysDeletingCharVector : public kwsys_stl::vector<char*>
 {
 public:
@@ -399,6 +403,10 @@ bool SystemTools::PutEnv(const char* value)
   return ret == 0;
 }
 
+#ifdef INTEL_COMPILER
+#pragma warning restore 444
+#endif
+
 
 const char* SystemTools::GetExecutableExtension()
 {

+ 2 - 2
Source/kwsys/kwsysDateStamp.cmake

@@ -15,7 +15,7 @@
 SET(KWSYS_DATE_STAMP_YEAR  2011)
 
 # KWSys version date month component.  Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 10)
+SET(KWSYS_DATE_STAMP_MONTH 11)
 
 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   25)
+SET(KWSYS_DATE_STAMP_DAY   09)

+ 29 - 0
Tests/CMakeLists.txt

@@ -1531,6 +1531,35 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
   SET_TESTS_PROPERTIES(CTestTestUpload PROPERTIES
     PASS_REGULAR_EXPRESSION "Upload\\.xml")
 
+  CONFIGURE_FILE(
+    "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in"
+    "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake"
+    @ONLY ESCAPE_QUOTES)
+  ADD_TEST(CTestTestConfigFileInBuildDir1 ${CMAKE_CTEST_COMMAND}
+    -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake" -V
+    --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/testOut1.log"
+    )
+  SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir1 PROPERTIES DEPENDS CTestTestNoBuild
+    PASS_REGULAR_EXPRESSION
+      "Reading ctest configuration file: ${CMake_SOURCE_DIR}.Tests.CTestTestConfigFileInBuildDir.CTestConfig.cmake")
+
+  CONFIGURE_FILE(
+    "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in"
+    "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake"
+    @ONLY ESCAPE_QUOTES)
+  CONFIGURE_FILE(
+    "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake"
+    "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake"
+    @ONLY ESCAPE_QUOTES COPYONLY)
+  ADD_TEST(CTestTestConfigFileInBuildDir2 ${CMAKE_CTEST_COMMAND}
+    -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake" -V
+    --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/testOut2.log"
+    )
+  SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir2 PROPERTIES DEPENDS CTestTestNoBuild
+    REQUIRED_FILES ${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake
+    PASS_REGULAR_EXPRESSION
+      "Reading ctest configuration file: ${CMake_BINARY_DIR}.Tests.CTestTestConfigFileInBuildDir2.CTestConfig.cmake")
+
   # Use macro, not function so that build can still be driven by CMake 2.4.
   # After 2.6 is required, this could be a function without the extra 'set'
   # calls.

+ 1 - 0
Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in

@@ -7,6 +7,7 @@ endif(CPACK_GENERATOR MATCHES "ZIP")
 
 if(CPACK_GENERATOR MATCHES "RPM")
    set(CPACK_RPM_COMPONENT_INSTALL "ON")
+   set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries")
 endif(CPACK_GENERATOR MATCHES "RPM")
 
 if(CPACK_GENERATOR MATCHES "DEB")

+ 1 - 0
Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in

@@ -7,6 +7,7 @@ endif(CPACK_GENERATOR MATCHES "ZIP")
 
 if(CPACK_GENERATOR MATCHES "RPM")
    set(CPACK_RPM_COMPONENT_INSTALL "ON")
+   set(CPACK_RPM_Development_PACKAGE_REQUIRES "mylib-Runtime")
 endif(CPACK_GENERATOR MATCHES "RPM")
 
 if(CPACK_GENERATOR MATCHES "DEB")

+ 3 - 0
Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt

@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(CTestTestConfigFileInBuildDir)
+include(CTest)

+ 7 - 0
Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake

@@ -0,0 +1,7 @@
+set(CTEST_PROJECT_NAME "CTestTestConfigFileInBuildDir")
+set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
+set(CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)

+ 17 - 0
Tests/CTestTestConfigFileInBuildDir/test1.cmake.in

@@ -0,0 +1,17 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+
+# Settings:
+SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+SET(CTEST_SITE                          "@SITE@")
+SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-ConfigFileInBuildDir1")
+
+SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir")
+SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir1")
+SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)

+ 17 - 0
Tests/CTestTestConfigFileInBuildDir/test2.cmake.in

@@ -0,0 +1,17 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+
+# Settings:
+SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+SET(CTEST_SITE                          "@SITE@")
+SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-ConfigFileInBuildDir2")
+
+SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir")
+SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir2")
+SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)