summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitattributes1
-rw-r--r--.hooks-config.bash18
-rw-r--r--Modules/AutomocInfo.cmake.in1
-rw-r--r--Modules/CMakeFindEclipseCDT4.cmake14
-rw-r--r--Modules/CPackRPM.cmake69
-rw-r--r--Modules/CTest.cmake3
-rw-r--r--Modules/DartConfiguration.tcl.in5
-rw-r--r--Modules/DeployQt4.cmake275
-rw-r--r--Modules/FindLibXslt.cmake23
-rw-r--r--Modules/FindQt4.cmake8
-rw-r--r--Modules/FindX11.cmake9
-rw-r--r--Modules/GetPrerequisites.cmake2
-rw-r--r--Modules/UseQt4.cmake2
-rw-r--r--Source/CPack/cmCPackNSISGenerator.h12
-rw-r--r--Source/CPack/cpack.cxx12
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx9
-rw-r--r--Source/CTest/cmCTestLaunch.h2
-rw-r--r--Source/CTest/cmCTestSubmitHandler.h28
-rw-r--r--Source/CursesDialog/ccmake.cxx36
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx156
-rw-r--r--Source/cmCTest.cxx36
-rw-r--r--Source/cmCommandArgumentLexer.cxx108
-rw-r--r--Source/cmComputeLinkInformation.cxx5
-rw-r--r--Source/cmDependsFortranLexer.cxx8
-rw-r--r--Source/cmDependsJavaLexer.cxx62
-rw-r--r--Source/cmDocumentVariables.cxx20
-rw-r--r--Source/cmDocumentation.cxx157
-rw-r--r--Source/cmDocumentationFormatter.h12
-rw-r--r--Source/cmExprLexer.cxx67
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx222
-rw-r--r--Source/cmExtraEclipseCDT4Generator.h10
-rw-r--r--Source/cmGlobalGenerator.h2
-rw-r--r--Source/cmGlobalKdevelopGenerator.h24
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h4
-rw-r--r--Source/cmGlobalVisualStudio11Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h32
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx5
-rw-r--r--Source/cmLinkDirectoriesCommand.h7
-rw-r--r--Source/cmLocalGenerator.h53
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx44
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.h49
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx7
-rw-r--r--Source/cmMakefile.h146
-rw-r--r--Source/cmQtAutomoc.cxx208
-rw-r--r--Source/cmQtAutomoc.h18
-rw-r--r--Source/cmSetTargetPropertiesCommand.h3
-rw-r--r--Source/cmTarget.cxx27
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx10
-rw-r--r--Source/cmake.cxx4
-rw-r--r--Source/ctest.cxx12
-rw-r--r--Source/kwsys/CommandLineArguments.cxx2
-rw-r--r--Source/kwsys/SystemInformation.cxx45
-rw-r--r--Source/kwsys/SystemTools.cxx261
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake4
-rw-r--r--Tests/CMakeLists.txt29
-rw-r--r--Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in1
-rw-r--r--Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in1
-rw-r--r--Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt3
-rw-r--r--Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestConfigFileInBuildDir/test1.cmake.in17
-rw-r--r--Tests/CTestTestConfigFileInBuildDir/test2.cmake.in17
-rw-r--r--Tests/CTestUpdateSVN.cmake.in12
-rw-r--r--Tests/QtAutomoc/CMakeLists.txt2
-rw-r--r--Tests/QtAutomoc/foo.cpp39
-rw-r--r--Tests/QtAutomoc/foo.h28
-rw-r--r--Tests/QtAutomoc/main.cpp4
-rw-r--r--Utilities/Doxygen/CMakeLists.txt2
-rw-r--r--Utilities/Doxygen/doxyfile.in4
-rwxr-xr-xUtilities/Git/commit-msg23
-rwxr-xr-xUtilities/Git/pre-commit47
-rwxr-xr-xUtilities/Git/prepare-commit-msg15
71 files changed, 1782 insertions, 830 deletions
diff --git a/.gitattributes b/.gitattributes
index 43676a9..d9d64d6 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,4 +1,5 @@
.gitattributes export-ignore
+.hooks* export-ignore
bootstrap crlf=input
configure crlf=input
diff --git a/.hooks-config.bash b/.hooks-config.bash
new file mode 100644
index 0000000..97152f6
--- /dev/null
+++ b/.hooks-config.bash
@@ -0,0 +1,18 @@
+#=============================================================================
+# CMake - Cross Platform Makefile Generator
+# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+# Loaded by .git/hooks/(pre-commit|commit-msg|prepare-commit-msg)
+# during git commit after local hooks have been installed.
+
+hooks_chain_pre_commit="Utilities/Git/pre-commit"
+hooks_chain_commit_msg="Utilities/Git/commit-msg"
+hooks_chain_prepare_commit_msg="Utilities/Git/prepare-commit-msg"
diff --git a/Modules/AutomocInfo.cmake.in b/Modules/AutomocInfo.cmake.in
index 2dc3aa2..9c71952 100644
--- a/Modules/AutomocInfo.cmake.in
+++ b/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@/")
diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index cf0984e..f7a6e29 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -54,8 +54,20 @@ ENDFUNCTION()
_FIND_ECLIPSE_VERSION()
+# Try to find out how many CPUs we have and set the -j argument for make accordingly
+SET(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "")
+
+INCLUDE(ProcessorCount)
+PROCESSORCOUNT(_CMAKE_ECLIPSE_PROCESSOR_COUNT)
+
+# Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
+# (we may also get here in the future e.g. for ninja)
+IF("${_CMAKE_ECLIPSE_PROCESSOR_COUNT}" GREATER 1 AND UNIX AND "${CMAKE_MAKE_PROGRAM}" MATCHES make)
+ SET(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "-j${_CMAKE_ECLIPSE_PROCESSOR_COUNT}")
+ENDIF()
+
# This variable is used by the Eclipse generator and appended to the make invocation commands.
-SET(CMAKE_ECLIPSE_MAKE_ARGUMENTS "" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds")
+SET(CMAKE_ECLIPSE_MAKE_ARGUMENTS "${_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds")
# This variable is used by the Eclipse generator in out-of-source builds only.
SET(ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT FALSE CACHE BOOL "If enabled, CMake will generate a source project for Eclipse in CMAKE_SOURCE_DIR")
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 51c8eac..bb1021b 100644
--- a/Modules/CPackRPM.cmake
+++ b/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
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index c261eb3..ec9dbeb 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -189,6 +189,8 @@ IF(BUILD_TESTING)
FIND_PROGRAM(COVERAGE_COMMAND gcov DOC
"Path to the coverage program that CTest uses for performing coverage inspection"
)
+ SET(COVERAGE_EXTRA_FLAGS "-l" CACHE STRING
+ "Extra command line flags to pass to the coverage tool")
# set the site name
SITE_NAME(SITE)
@@ -257,6 +259,7 @@ IF(BUILD_TESTING)
BZRCOMMAND
BZR_UPDATE_OPTIONS
COVERAGE_COMMAND
+ COVERAGE_EXTRA_FLAGS
CTEST_SUBMIT_RETRY_DELAY
CTEST_SUBMIT_RETRY_COUNT
CVSCOMMAND
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index caf0afe..ad7f805 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -59,14 +59,17 @@ UpdateType: @UPDATE_TYPE@
# Compiler info
Compiler: @CMAKE_CXX_COMPILER@
-# Dynamic analysis and coverage
+# Dynamic analysis (MemCheck)
PurifyCommand: @PURIFYCOMMAND@
ValgrindCommand: @VALGRIND_COMMAND@
ValgrindCommandOptions: @VALGRIND_COMMAND_OPTIONS@
MemoryCheckCommand: @MEMORYCHECK_COMMAND@
MemoryCheckCommandOptions: @MEMORYCHECK_COMMAND_OPTIONS@
MemoryCheckSuppressionFile: @MEMORYCHECK_SUPPRESSIONS_FILE@
+
+# Coverage
CoverageCommand: @COVERAGE_COMMAND@
+CoverageExtraFlags: @COVERAGE_EXTRA_FLAGS@
# Cluster commands
SlurmBatchCommand: @SLURM_SBATCH_COMMAND@
diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake
new file mode 100644
index 0000000..4bf1b6c
--- /dev/null
+++ b/Modules/DeployQt4.cmake
@@ -0,0 +1,275 @@
+# - Functions to help assemble a standalone Qt4 executable.
+# A collection of CMake utility functions useful for deploying
+# Qt4 executables.
+#
+# The following functions are provided by this module:
+# write_qt4_conf
+# resolve_qt4_paths
+# fixup_qt4_executable
+# install_qt4_plugin_path
+# install_qt4_plugin
+# install_qt4_executable
+# Requires CMake 2.6 or greater because it uses function and
+# PARENT_SCOPE. Also depends on BundleUtilities.cmake.
+#
+# WRITE_QT4_CONF(<qt_conf_dir> <qt_conf_contents>)
+# Writes a qt.conf file with the <qt_conf_contents> into <qt_conf_dir>.
+#
+# RESOLVE_QT4_PATHS(<paths_var> [<executable_path>])
+# Loop through <paths_var> list and if any don't exist resolve them
+# relative to the <executable_path> (if supplied) or the CMAKE_INSTALL_PREFIX.
+#
+# FIXUP_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>])
+# Copies 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
+# libraries are compatible.
+#
+# <executable> should point to the executable to be fixed-up.
+#
+# <qtplugins> should contain a list of the names or paths of any Qt plugins
+# to be installed.
+#
+# <libs> will be passed to BundleUtilities and should be a list of any already
+# installed plugins, libraries or executables to also be fixed-up.
+#
+# <dirs> will be passed to BundleUtilities and should contain and directories
+# to be searched to find library dependencies.
+#
+# <plugins_dir> allows an custom plugins directory to be used.
+#
+# <request_qt_conf> will force a qt.conf file to be written even if not needed.
+#
+# INSTALL_QT4_PLUGIN_PATH(plugin executable copy installed_plugin_path_var <plugins_dir> <component> <configurations>)
+# Install (or copy) a resolved <plugin> to the default plugins directory
+# (or <plugins_dir>) relative to <executable> and store the result in
+# <installed_plugin_path_var>.
+#
+# If <copy> is set to TRUE then the plugins will be copied rather than
+# installed. This is to allow this module to be used at CMake time rather than
+# install time.
+#
+# If <component> is set then anything installed will use this COMPONENT.
+#
+# INSTALL_QT4_PLUGIN(plugin executable copy installed_plugin_path_var <plugins_dir> <component>)
+# Install (or copy) an unresolved <plugin> to the default plugins directory
+# (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>])
+# 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
+# libraries are compatible. The executable will be fixed-up at install time.
+# See documentation of FIXUP_QT4_BUNDLE.
+
+#=============================================================================
+# Copyright 2011 Mike McQuaid <mike@mikemcquaid.com>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# The functions defined in this file depend on the fixup_bundle function
+# (and others) found in BundleUtilities.cmake
+
+include(BundleUtilities)
+set(DeployQt4_cmake_dir "${CMAKE_CURRENT_LIST_DIR}")
+
+function(write_qt4_conf qt_conf_dir qt_conf_contents)
+ set(qt_conf_path "${qt_conf_dir}/qt.conf")
+ message(STATUS "Writing ${qt_conf_path}")
+ file(WRITE "${qt_conf_path}" "${qt_conf_contents}")
+endfunction()
+
+function(resolve_qt4_paths paths_var)
+ set(executable_path ${ARGV1})
+
+ set(paths_resolved)
+ foreach(path ${${paths_var}})
+ if(EXISTS "${path}")
+ list(APPEND paths_resolved "${path}")
+ else()
+ if(${executable_path})
+ list(APPEND paths_resolved "${executable_path}/${path}")
+ else()
+ list(APPEND paths_resolved "\${CMAKE_INSTALL_PREFIX}/${path}")
+ endif()
+ endif()
+ endforeach()
+ set(${paths_var} ${paths_resolved} PARENT_SCOPE)
+endfunction()
+
+function(fixup_qt4_executable executable)
+ set(qtplugins ${ARGV1})
+ set(libs ${ARGV2})
+ set(dirs ${ARGV3})
+ set(plugins_dir ${ARGV4})
+ set(request_qt_conf ${ARGV5})
+
+ message(STATUS "fixup_qt4_executable")
+ message(STATUS " executable='${executable}'")
+ message(STATUS " qtplugins='${qtplugins}'")
+ message(STATUS " libs='${libs}'")
+ message(STATUS " dirs='${dirs}'")
+ message(STATUS " plugins_dir='${plugins_dir}'")
+ message(STATUS " request_qt_conf='${request_qt_conf}'")
+
+ if(QT_LIBRARY_DIR)
+ list(APPEND dirs "${QT_LIBRARY_DIR}")
+ endif()
+
+ if(APPLE)
+ set(qt_conf_dir "${executable}/Contents/Resources")
+ set(executable_path "${executable}")
+ set(write_qt_conf TRUE)
+ else()
+ get_filename_component(executable_path "${executable}" PATH)
+ if(NOT executable_path)
+ set(executable_path ".")
+ endif()
+ set(qt_conf_dir "${executable_path}")
+ set(write_qt_conf ${request_qt_conf})
+ endif()
+
+ foreach(plugin ${qtplugins})
+ set(installed_plugin_path "")
+ install_qt4_plugin("${plugin}" "${plugins_dir}" "${executable}" 1 installed_plugin_path)
+ list(APPEND libs ${installed_plugin_path})
+ endforeach()
+
+ foreach(lib ${libs})
+ if(NOT EXISTS "${lib}")
+ message(FATAL_ERROR "Library does not exist: ${lib}")
+ endif()
+ endforeach()
+
+ resolve_qt4_paths(libs "${executable_path}")
+
+ if(write_qt_conf)
+ set(qt_conf_contents "[Paths]\nPlugins = ${plugins_dir}")
+ write_qt4_conf("${qt_conf_dir}" "${qt_conf_contents}")
+ endif()
+
+ fixup_bundle("${executable}" "${libs}" "${dirs}")
+endfunction()
+
+function(install_qt4_plugin_path plugin executable copy installed_plugin_path_var)
+ set(plugins_dir ${ARGV4})
+ set(component ${ARGV5})
+ set(configurations ${ARGV6})
+ if(EXISTS "${plugin}")
+ if(plugins_dir)
+ set(plugins_dir "${plugins_dir}")
+ else()
+ if(APPLE)
+ set(plugins_dir "PlugIns")
+ else()
+ set(plugins_dir "plugins")
+ endif()
+ endif()
+ if(APPLE)
+ set(plugins_path "${executable}/Contents/${plugins_dir}")
+ else()
+ get_filename_component(executable_path "${executable}" PATH)
+ if(NOT executable_path)
+ set(executable_path ".")
+ endif()
+ set(plugins_path "${executable_path}/${plugins_dir}")
+ endif()
+
+ set(plugin_group "")
+
+ get_filename_component(plugin_path "${plugin}" PATH)
+ get_filename_component(plugin_parent_path "${plugin_path}" PATH)
+ get_filename_component(plugin_parent_dir_name "${plugin_parent_path}" NAME)
+ get_filename_component(plugin_name "${plugin}" NAME)
+ string(TOLOWER "${plugin_parent_dir_name}" plugin_parent_dir_name)
+
+ if("${plugin_parent_dir_name}" STREQUAL "plugins")
+ get_filename_component(plugin_group "${plugin_path}" NAME)
+ set(${plugin_group_var} "${plugin_group}")
+ endif()
+ set(plugins_path "${plugins_path}/${plugin_group}")
+
+ if(${copy})
+ file(MAKE_DIRECTORY "${plugins_path}")
+ file(COPY "${plugin}" DESTINATION "${plugins_path}")
+ else()
+ if(configurations AND (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE))
+ set(configurations CONFIGURATIONS ${configurations})
+ endif()
+ if(component)
+ set(component COMPONENT ${component})
+ endif()
+ install(FILES "${plugin}" DESTINATION "${plugins_path}" ${configurations} ${component})
+ endif()
+ set(${installed_plugin_path_var} ${${installed_path_var}} "${plugins_path}/${plugin_name}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(install_qt4_plugin plugin executable copy installed_plugin_path_var)
+ set(plugins_dir ${ARGV4})
+ set(component ${ARGV5})
+ if(EXISTS "${plugin}")
+ install_qt4_plugin_path("${plugin}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}")
+ else()
+ if(QT_IS_STATIC)
+ string(TOUPPER "QT_${plugin}_LIBRARY" plugin_var)
+ else()
+ string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var)
+ endif()
+ 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")
+ install_qt4_plugin_path("${plugin_debug}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Debug")
+ endif()
+ set(installed_plugin_path_var "${installed_plugin_path_var}" PARENT_SCOPE)
+endfunction()
+
+function(install_qt4_executable executable)
+ set(qtplugins ${ARGV1})
+ set(libs ${ARGV2})
+ set(dirs ${ARGV3})
+ set(plugins_dir ${ARGV4})
+ set(request_qt_conf ${ARGV5})
+ set(plugin_component ${ARGV6})
+ if(QT_LIBRARY_DIR)
+ list(APPEND dirs "${QT_LIBRARY_DIR}")
+ endif()
+
+ get_filename_component(executable_absolute "${executable}" ABSOLUTE)
+ gp_file_type("${executable_absolute}" "${QT_QTCORE_LIBRARY}" qtcore_type)
+ if(qtcore_type STREQUAL "system")
+ set(qt_plugins_dir "")
+ endif()
+
+ if(NOT qtplugins AND QT_LIBRARIES_PLUGINS)
+ set(qtplugins "${QT_LIBRARIES_PLUGINS}")
+ endif()
+
+ foreach(plugin ${qtplugins})
+ set(installed_plugin_paths "")
+ install_qt4_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${plugin_component}")
+ list(APPEND libs ${installed_plugin_paths})
+ endforeach()
+
+ resolve_qt4_paths(libs)
+
+ install(CODE
+ " INCLUDE( \"${DeployQt4_cmake_dir}/DeployQt4.cmake\" )
+ SET( BU_CHMOD_BUNDLE_ITEMS TRUE )
+ FIXUP_QT4_EXECUTABLE( \"\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\" ) "
+ )
+endfunction()
diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake
index 462835a..1f49c3b 100644
--- a/Modules/FindLibXslt.cmake
+++ b/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)
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 3b05c2b..c56827e 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -1062,6 +1062,14 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
SET( QT_SCRIPT_PLUGINS qtscriptdbus )
SET( QT_SQLDRIVERS_PLUGINS qsqldb2 qsqlibase qsqlite qsqlite2 qsqlmysql qsqloci qsqlodbc qsqlpsql qsqltds )
+ SET( QT_PHONON_PLUGINS ${QT_PHONON_BACKEND_PLUGINS} )
+ SET( QT_QT3SUPPORT_PLUGINS qtaccessiblecompatwidgets )
+ SET( QT_QTCORE_PLUGINS ${QT_BEARER_PLUGINS} ${QT_CODECS_PLUGINS} )
+ SET( QT_QTGUI_PLUGINS qtaccessiblewidgets qgif qjpeg qmng qico qtiff ${QT_DECORATIONS_PLUGINS} ${QT_GRAPHICSDRIVERS_PLUGINS} ${QT_GRAPHICSSYSTEMS_PLUGINS} ${QT_INPUTMETHODS_PLUGINS} ${QT_MOUSEDRIVERS_PLUGINS} )
+ SET( QT_QTSCRIPT_PLUGINS ${QT_SCRIPT_PLUGINS} )
+ SET( QT_QTSQL_PLUGINS ${QT_SQLDRIVERS_PLUGINS} )
+ SET( QT_QTSVG_PLUGINS qsvg qsvgicon )
+
IF(QT_QMAKE_CHANGED)
FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type)
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index 9df3f01..04646c0 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -108,6 +108,7 @@ IF (UNIX)
FIND_PATH(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xrandr_INCLUDE_PATH X11/extensions/Xrandr.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xrender_INCLUDE_PATH X11/extensions/Xrender.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_XRes_INCLUDE_PATH X11/extensions/XRes.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xscreensaver_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xshape_INCLUDE_PATH X11/extensions/shape.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xutil_INCLUDE_PATH X11/Xutil.h ${X11_INC_SEARCH_PATH})
@@ -136,6 +137,7 @@ IF (UNIX)
FIND_LIBRARY(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_XRes_LIB XRes ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xscreensaver_LIB Xss ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xt_LIB Xt ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH})
@@ -250,6 +252,11 @@ IF (UNIX)
SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH})
ENDIF (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
+ IF (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
+ SET(X11_XRes_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XRes_INCLUDE_PATH})
+ ENDIF (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
+
IF (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
SET(X11_Xrandr_FOUND TRUE)
SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH})
@@ -424,6 +431,8 @@ IF (UNIX)
X11_Xdamage_INCLUDE_PATH
X11_Xrender_LIB
X11_Xrender_INCLUDE_PATH
+ X11_XRes_LIB
+ X11_XRes_INCLUDE_PATH
X11_Xxf86misc_LIB
X11_xf86misc_INCLUDE_PATH
X11_xf86vmode_INCLUDE_PATH
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 023b8b5..2efa079 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -24,7 +24,7 @@
# PARENT_SCOPE.
#
# GET_PREREQUISITES(<target> <prerequisites_var> <exclude_system> <recurse>
-# <dirs>)
+# <exepath> <dirs>)
# Get the list of shared library files required by <target>. The list in
# the variable named <prerequisites_var> should be empty on first entry to
# this function. On exit, <prerequisites_var> will contain the list of
diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake
index dbe28ac..b824392 100644
--- a/Modules/UseQt4.cmake
+++ b/Modules/UseQt4.cmake
@@ -28,6 +28,7 @@ ENDIF()
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
SET(QT_LIBRARIES "")
+SET(QT_LIBRARIES_PLUGINS "")
IF (QT_USE_QTMAIN)
IF (Q_WS_WIN)
@@ -91,6 +92,7 @@ FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
INCLUDE_DIRECTORIES(${QT_${module}_INCLUDE_DIR})
ENDIF(QT_USE_${module})
SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY})
+ SET(QT_LIBRARIES_PLUGINS ${QT_LIBRARIES_PLUGINS} ${QT_${module}_PLUGINS})
IF(QT_IS_STATIC)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES})
ENDIF(QT_IS_STATIC)
diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h
index 6ad103f..7bccb89 100644
--- a/Source/CPack/cmCPackNSISGenerator.h
+++ b/Source/CPack/cmCPackNSISGenerator.h
@@ -46,10 +46,10 @@ protected:
virtual bool SupportsComponentInstallation() const;
- /// Produce a string that contains the NSIS code to describe a
- /// particular component. Any added macros will be emitted via
+ /// Produce a string that contains the NSIS code to describe a
+ /// particular component. Any added macros will be emitted via
/// macrosOut.
- std::string
+ std::string
CreateComponentDescription(cmCPackComponent *component,
cmOStringStream& macrosOut);
@@ -65,14 +65,14 @@ protected:
(cmCPackComponent *component,
std::set<cmCPackComponent *>& visited);
- /// Produce a string that contains the NSIS code to describe a
+ /// Produce a string that contains the NSIS code to describe a
/// particular component group, including its components. Any
/// added macros will be emitted via macrosOut.
- std::string
+ std::string
CreateComponentGroupDescription(cmCPackComponentGroup *group,
cmOStringStream& macrosOut);
- /// Translations any newlines found in the string into \r\n, so that the
+ /// Translations any newlines found in the string into \\r\\n, so that the
/// resulting string can be used within NSIS.
static std::string TranslateNewlines(std::string str);
};
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 9163af81..b1706e3 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -244,7 +244,7 @@ int main (int argc, char *argv[])
// find out which system cpack is running on, so it can setup the search
// paths, so FIND_XXX() commands can be used in scripts
cminst.AddCMakePaths();
- std::string systemFile =
+ std::string systemFile =
globalMF->GetModulesFile("CMakeDetermineSystem.cmake");
if (!globalMF->ReadListFile(0, systemFile.c_str()))
{
@@ -253,7 +253,7 @@ int main (int argc, char *argv[])
return 1;
}
- systemFile =
+ systemFile =
globalMF->GetModulesFile("CMakeSystemSpecificInformation.cmake");
if (!globalMF->ReadListFile(0, systemFile.c_str()))
{
@@ -264,7 +264,7 @@ int main (int argc, char *argv[])
if ( cmSystemTools::FileExists(cpackConfigFile.c_str()) )
{
- cpackConfigFile =
+ cpackConfigFile =
cmSystemTools::CollapseFullPath(cpackConfigFile.c_str());
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Read CPack configuration file: " << cpackConfigFile.c_str()
@@ -410,7 +410,7 @@ int main (int argc, char *argv[])
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, "For project: "
<< projName << std::endl);
- const char* projVersion =
+ const char* projVersion =
mf->GetDefinition("CPACK_PACKAGE_VERSION");
if ( !projVersion )
{
@@ -423,7 +423,7 @@ int main (int argc, char *argv[])
cmOStringStream ostr;
ostr << projVersionMajor << "." << projVersionMinor << "."
<< projVersionPatch;
- mf->AddDefinition("CPACK_PACKAGE_VERSION",
+ mf->AddDefinition("CPACK_PACKAGE_VERSION",
ostr.str().c_str());
}
@@ -448,7 +448,7 @@ int main (int argc, char *argv[])
doc.SetSection("Name",cmDocumentationName);
doc.SetSection("Usage",cmDocumentationUsage);
doc.SetSection("Description",cmDocumentationDescription);
- doc.SetSection("Options",cmDocumentationOptions);
+ doc.PrependSection("Options",cmDocumentationOptions);
std::vector<cmDocumentationEntry> v;
cmCPackGeneratorFactory::DescriptionsMap::const_iterator generatorIt;
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 005651f..0b1c9fe 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -751,12 +751,15 @@ int cmCTestCoverageHandler::HandlePHPCoverage(
}
return static_cast<int>(cont->TotalCoverage.size());
}
+
//----------------------------------------------------------------------
int cmCTestCoverageHandler::HandleGCovCoverage(
cmCTestCoverageHandlerContainer* cont)
{
std::string gcovCommand
= this->CTest->GetCTestConfiguration("CoverageCommand");
+ std::string gcovExtraFlags
+ = this->CTest->GetCTestConfiguration("CoverageExtraFlags");
// Style 1
std::string st1gcovOutputRex1
@@ -825,8 +828,10 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
// Call gcov to get coverage data for this *.gcda file:
//
std::string fileDir = cmSystemTools::GetFilenamePath(it->c_str());
- std::string command = "\"" + gcovCommand + "\" -l -p -o \"" + fileDir
- + "\" \"" + *it + "\"";
+ std::string command = "\"" + gcovCommand + "\" " +
+ gcovExtraFlags + " " +
+ "-o \"" + fileDir + "\" " +
+ "\"" + *it + "\"";
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, command.c_str()
<< std::endl);
diff --git a/Source/CTest/cmCTestLaunch.h b/Source/CTest/cmCTestLaunch.h
index cd876d0..7457e83 100644
--- a/Source/CTest/cmCTestLaunch.h
+++ b/Source/CTest/cmCTestLaunch.h
@@ -24,7 +24,7 @@ class cmCTestLaunch
{
public:
/** Entry point from ctest executable main(). */
- static int Main(int argc, const char* const* argv);
+ static int Main(int argc, const char* const argv[]);
private:
// Initialize the launcher from its command line.
cmCTestLaunch(int argc, const char* const* argv);
diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h
index e7755b1..14eac80 100644
--- a/Source/CTest/cmCTestSubmitHandler.h
+++ b/Source/CTest/cmCTestSubmitHandler.h
@@ -18,7 +18,7 @@
* \brief Helper class for CTest
*
* Submit testing results
- *
+ *
*/
class cmCTestSubmitHandler : public cmCTestGenericHandler
{
@@ -47,35 +47,37 @@ private:
/**
* Submit file using various ways
*/
- bool SubmitUsingFTP(const cmStdString& localprefix,
+ bool SubmitUsingFTP(const cmStdString& localprefix,
const std::set<cmStdString>& files,
- const cmStdString& remoteprefix,
+ const cmStdString& remoteprefix,
const cmStdString& url);
- bool SubmitUsingHTTP(const cmStdString& localprefix,
+ bool SubmitUsingHTTP(const cmStdString& localprefix,
const std::set<cmStdString>& files,
- const cmStdString& remoteprefix,
+ const cmStdString& remoteprefix,
const cmStdString& url);
bool SubmitUsingSCP(const cmStdString& scp_command,
- const cmStdString& localprefix,
+ const cmStdString& localprefix,
const std::set<cmStdString>& files,
- const cmStdString& remoteprefix,
+ const cmStdString& remoteprefix,
const cmStdString& url);
- bool SubmitUsingCP( const cmStdString& localprefix,
+ bool SubmitUsingCP( const cmStdString& localprefix,
const std::set<cmStdString>& files,
- const cmStdString& remoteprefix,
+ const cmStdString& remoteprefix,
const cmStdString& url);
bool TriggerUsingHTTP(const std::set<cmStdString>& files,
- const cmStdString& remoteprefix,
+ const cmStdString& remoteprefix,
const cmStdString& url);
- bool SubmitUsingXMLRPC(const cmStdString& localprefix,
+ bool SubmitUsingXMLRPC(const cmStdString& localprefix,
const std::set<cmStdString>& files,
- const cmStdString& remoteprefix,
+ const cmStdString& remoteprefix,
const cmStdString& url);
- void ParseResponse(std::vector<char>);
+ typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
+
+ void ParseResponse(cmCTestSubmitHandlerVectorOfChar chunk);
std::string GetSubmitResultsPrefix();
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index 9ede7a6..b1a72af 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -76,11 +76,11 @@ void onsig(int)
if (cmCursesForm::CurrentForm)
{
endwin();
- initscr(); /* Initialization */
- noecho(); /* Echo off */
- cbreak(); /* nl- or cr not needed */
- keypad(stdscr,TRUE); /* Use key symbols as
- KEY_DOWN*/
+ initscr(); /* Initialization */
+ noecho(); /* Echo off */
+ cbreak(); /* nl- or cr not needed */
+ keypad(stdscr,TRUE); /* Use key symbols as
+ KEY_DOWN*/
refresh();
int x,y;
getmaxyx(stdscr, y, x);
@@ -89,7 +89,7 @@ void onsig(int)
}
signal(SIGWINCH, onsig);
}
-
+
}
void CMakeErrorHandler(const char* message, const char* title, bool&, void* clientData)
@@ -116,13 +116,13 @@ int main(int argc, char** argv)
doc.SetSection("Usage",cmDocumentationUsage);
doc.SetSection("Description",cmDocumentationDescription);
doc.SetSection("Generators",generators);
- doc.SetSection("Options",cmDocumentationOptions);
+ doc.PrependSection("Options",cmDocumentationOptions);
doc.SetSection("Command",commands);
doc.SetSection("Compatibility Commands",compatCommands);
doc.SetSeeAlsoList(cmDocumentationSeeAlso);
return doc.PrintRequestedDocumentation(std::cout)? 0:1;
- }
-
+ }
+
bool debug = false;
unsigned int i;
int j;
@@ -156,22 +156,22 @@ int main(int argc, char** argv)
cmCursesForm::DebugStart();
}
- initscr(); /* Initialization */
- noecho(); /* Echo off */
- cbreak(); /* nl- or cr not needed */
- keypad(stdscr,TRUE); /* Use key symbols as
- KEY_DOWN*/
+ initscr(); /* Initialization */
+ noecho(); /* Echo off */
+ cbreak(); /* nl- or cr not needed */
+ keypad(stdscr,TRUE); /* Use key symbols as
+ KEY_DOWN*/
signal(SIGWINCH, onsig);
int x,y;
getmaxyx(stdscr, y, x);
- if ( x < cmCursesMainForm::MIN_WIDTH ||
+ if ( x < cmCursesMainForm::MIN_WIDTH ||
y < cmCursesMainForm::MIN_HEIGHT )
{
endwin();
std::cerr << "Window is too small. A size of at least "
- << cmCursesMainForm::MIN_WIDTH << " x "
+ << cmCursesMainForm::MIN_WIDTH << " x "
<< cmCursesMainForm::MIN_HEIGHT
<< " is required to run ccmake." << std::endl;
return 1;
@@ -201,7 +201,7 @@ int main(int argc, char** argv)
myform->Render(1, 1, x, y);
myform->HandleInput();
}
-
+
// Need to clean-up better
curses_clear();
touchwin(stdscr);
@@ -210,7 +210,7 @@ int main(int argc, char** argv)
cmCursesForm::CurrentForm = 0;
std::cout << std::endl << std::endl;
-
+
return 0;
}
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index e1876b9..6c7627f 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -27,7 +27,7 @@
inline int ctrl(int z)
{
return (z&037);
-}
+}
cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args,
int initWidth) :
@@ -80,7 +80,7 @@ cmCursesMainForm::~cmCursesMainForm()
{
delete this->CMakeInstance;
this->CMakeInstance = 0;
- }
+ }
}
// See if a cache entry is in the list of entries in the ui.
@@ -99,7 +99,7 @@ bool cmCursesMainForm::LookForCacheEntry(const char* key)
return true;
}
}
-
+
return false;
}
@@ -114,7 +114,7 @@ void cmCursesMainForm::InitializeUI()
// Count non-internal and non-static entries
int count=0;
- for(cmCacheManager::CacheIterator i =
+ for(cmCacheManager::CacheIterator i =
this->CMakeInstance->GetCacheManager()->NewIterator();
!i.IsAtEnd(); i.Next())
{
@@ -142,12 +142,12 @@ void cmCursesMainForm::InitializeUI()
// Create the composites.
// First add entries which are new
- for(cmCacheManager::CacheIterator i =
+ for(cmCacheManager::CacheIterator i =
this->CMakeInstance->GetCacheManager()->NewIterator();
!i.IsAtEnd(); i.Next())
{
const char* key = i.GetName();
- if ( i.GetType() == cmCacheManager::INTERNAL ||
+ if ( i.GetType() == cmCacheManager::INTERNAL ||
i.GetType() == cmCacheManager::STATIC ||
i.GetType() == cmCacheManager::UNINITIALIZED )
{
@@ -164,12 +164,12 @@ void cmCursesMainForm::InitializeUI()
}
// then add entries which are old
- for(cmCacheManager::CacheIterator i =
+ for(cmCacheManager::CacheIterator i =
this->CMakeInstance->GetCacheManager()->NewIterator();
!i.IsAtEnd(); i.Next())
{
const char* key = i.GetName();
- if ( i.GetType() == cmCacheManager::INTERNAL ||
+ if ( i.GetType() == cmCacheManager::INTERNAL ||
i.GetType() == cmCacheManager::STATIC ||
i.GetType() == cmCacheManager::UNINITIALIZED )
{
@@ -184,7 +184,7 @@ void cmCursesMainForm::InitializeUI()
}
}
}
-
+
// Clean old entries
if (this->Entries)
{
@@ -197,7 +197,7 @@ void cmCursesMainForm::InitializeUI()
}
delete this->Entries;
this->Entries = newEntries;
-
+
// Compute fields from composites
this->RePost();
}
@@ -224,7 +224,7 @@ void cmCursesMainForm::RePost()
std::vector<cmCursesCacheEntryComposite*>::iterator it;
for (it = this->Entries->begin(); it != this->Entries->end(); ++it)
{
- cmCacheManager::CacheIterator mit =
+ cmCacheManager::CacheIterator mit =
this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue());
if (mit.IsAtEnd() ||
(!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED")))
@@ -253,7 +253,7 @@ void cmCursesMainForm::RePost()
std::vector<cmCursesCacheEntryComposite*>::iterator it;
for (it = this->Entries->begin(); it != this->Entries->end(); ++it)
{
- cmCacheManager::CacheIterator mit =
+ cmCacheManager::CacheIterator mit =
this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue());
if (mit.IsAtEnd() ||
(!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED")))
@@ -301,7 +301,7 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
}
// Wrong window size
- if ( width < cmCursesMainForm::MIN_WIDTH ||
+ if ( width < cmCursesMainForm::MIN_WIDTH ||
width < this->InitialWidth ||
height < cmCursesMainForm::MIN_HEIGHT )
{
@@ -322,7 +322,7 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
std::vector<cmCursesCacheEntryComposite*>::iterator it;
for (it = this->Entries->begin(); it != this->Entries->end(); ++it)
{
- cmCacheManager::CacheIterator mit =
+ cmCacheManager::CacheIterator mit =
this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue());
if (mit.IsAtEnd() ||
(!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED")))
@@ -372,7 +372,7 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
this->UpdateStatusBar();
this->PrintKeys();
- touchwin(stdscr);
+ touchwin(stdscr);
refresh();
}
@@ -380,7 +380,7 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
{
int x,y;
getmaxyx(stdscr, y, x);
- if ( x < cmCursesMainForm::MIN_WIDTH ||
+ if ( x < cmCursesMainForm::MIN_WIDTH ||
x < this->InitialWidth ||
y < cmCursesMainForm::MIN_HEIGHT )
{
@@ -399,7 +399,7 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
{
cw->PrintKeys();
}
-
+
// {
// }
// else
@@ -409,35 +409,34 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
char thirdLine[512]="";
if (process)
{
- sprintf(firstLine,
- " ");
- sprintf(secondLine,
- " ");
- sprintf(thirdLine,
- " ");
+ sprintf(firstLine,
+ " ");
+ sprintf(secondLine,
+ " ");
+ sprintf(thirdLine,
+ " ");
}
else
{
if (this->OkToGenerate)
{
- sprintf(firstLine,
- "Press [c] to configure Press [g] to generate and exit");
+ sprintf(firstLine,
+ "Press [c] to configure Press [g] to generate and exit");
}
else
{
sprintf(firstLine, "Press [c] to configure ");
}
- if (this->AdvancedMode)
- {
- sprintf(thirdLine, "Press [t] to toggle advanced mode (Currently On)");
- }
- else
- {
- sprintf(thirdLine, "Press [t] to toggle advanced mode (Currently Off)");
- }
-
- sprintf(secondLine,
- "Press [h] for help Press [q] to quit without generating");
+ {
+ const char* toggleKeyInstruction =
+ "Press [t] to toggle advanced mode (Currently %s)";
+ sprintf(thirdLine,
+ toggleKeyInstruction,
+ this->AdvancedMode ? "On" : "Off");
+ }
+ sprintf(secondLine,
+ "Press [h] for help "
+ "Press [q] to quit without generating");
}
curses_move(y-4,0);
@@ -463,7 +462,7 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
// }
pos_form_cursor(this->Form);
-
+
}
// Print the key of the current entry and the CMake version
@@ -473,7 +472,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
int x,y;
getmaxyx(stdscr, y, x);
// If window size is too small, display error and return
- if ( x < cmCursesMainForm::MIN_WIDTH ||
+ if ( x < cmCursesMainForm::MIN_WIDTH ||
x < this->InitialWidth ||
y < cmCursesMainForm::MIN_HEIGHT )
{
@@ -482,10 +481,10 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
char fmt[] = "Window is too small. A size of at least %dx%d is required.";
printw(fmt,
(cmCursesMainForm::MIN_WIDTH < this->InitialWidth ?
- this->InitialWidth : cmCursesMainForm::MIN_WIDTH),
+ this->InitialWidth : cmCursesMainForm::MIN_WIDTH),
cmCursesMainForm::MIN_HEIGHT);
- touchwin(stdscr);
- wrefresh(stdscr);
+ touchwin(stdscr);
+ wrefresh(stdscr);
return;
}
@@ -502,10 +501,10 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
if ( lbl )
{
curField = lbl->GetValue();
-
+
// Get the help string of the current entry
// and add it to the help string
- cmCacheManager::CacheIterator it =
+ cmCacheManager::CacheIterator it =
this->CMakeInstance->GetCacheManager()->GetCacheIterator(curField);
if (!it.IsAtEnd())
{
@@ -549,9 +548,9 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
if ( curFieldLen < width )
{
strcpy(bar, curField);
- for(i=curFieldLen; i < width; ++i)
- {
- bar[i] = ' ';
+ for(i=curFieldLen; i < width; ++i)
+ {
+ bar[i] = ' ';
}
}
else
@@ -578,14 +577,14 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
else
{
strcpy(bar+curFieldLen+2, help);
- for(i=curFieldLen+helpLen+2; i < width; ++i)
- {
- bar[i] = ' ';
+ for(i=curFieldLen+helpLen+2; i < width; ++i)
+ {
+ bar[i] = ' ';
}
}
}
}
-
+
bar[width] = '\0';
@@ -605,7 +604,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
attron(A_STANDOUT);
char format[] = "%s";
printw(format, bar);
- attroff(A_STANDOUT);
+ attroff(A_STANDOUT);
curses_move(y-4,0);
printw(version);
pos_form_cursor(this->Form);
@@ -631,7 +630,7 @@ void cmCursesMainForm::UpdateProgress(const char *msg, float prog, void* vp)
cm->UpdateStatusBar(cmsg);
cm->PrintKeys(1);
curses_move(1,1);
- touchwin(stdscr);
+ touchwin(stdscr);
refresh();
}
@@ -643,7 +642,7 @@ int cmCursesMainForm::Configure(int noconfigure)
curses_move(1,1);
this->UpdateStatusBar("Configuring, please wait...");
this->PrintKeys(1);
- touchwin(stdscr);
+ touchwin(stdscr);
refresh();
this->CMakeInstance->SetProgressCallback(cmCursesMainForm::UpdateProgress, this);
@@ -652,7 +651,7 @@ int cmCursesMainForm::Configure(int noconfigure)
this->CMakeInstance->GetCacheManager()->SaveCache(
this->CMakeInstance->GetHomeOutputDirectory());
this->LoadCache(0);
-
+
// Get rid of previous errors
this->Errors = std::vector<std::string>();
@@ -674,8 +673,8 @@ int cmCursesMainForm::Configure(int noconfigure)
}
this->CMakeInstance->SetProgressCallback(0, 0);
- keypad(stdscr,TRUE); /* Use key symbols as
- KEY_DOWN*/
+ keypad(stdscr,TRUE); /* Use key symbols as
+ KEY_DOWN*/
if( retVal != 0 || !this->Errors.empty())
{
@@ -705,10 +704,10 @@ int cmCursesMainForm::Configure(int noconfigure)
CurrentForm = this;
this->Render(1,1,xx,yy);
}
-
+
this->InitializeUI();
this->Render(1, 1, xi, yi);
-
+
return 0;
}
@@ -731,8 +730,8 @@ int cmCursesMainForm::Generate()
int retVal = this->CMakeInstance->Generate();
this->CMakeInstance->SetProgressCallback(0, 0);
- keypad(stdscr,TRUE); /* Use key symbols as
- KEY_DOWN*/
+ keypad(stdscr,TRUE); /* Use key symbols as
+ KEY_DOWN*/
if( retVal != 0 || !this->Errors.empty())
{
@@ -764,10 +763,10 @@ int cmCursesMainForm::Generate()
CurrentForm = this;
this->Render(1,1,xx,yy);
}
-
+
this->InitializeUI();
this->Render(1, 1, xi, yi);
-
+
return 0;
}
@@ -798,11 +797,11 @@ void cmCursesMainForm::RemoveEntry(const char* value)
// copy from the list box to the cache manager
void cmCursesMainForm::FillCacheManagerFromUI()
-{
+{
size_t size = this->Entries->size();
for(size_t i=0; i < size; i++)
{
- cmCacheManager::CacheIterator it =
+ cmCacheManager::CacheIterator it =
this->CMakeInstance->GetCacheManager()->GetCacheIterator(
(*this->Entries)[i]->Key.c_str());
if (!it.IsAtEnd())
@@ -872,14 +871,14 @@ void cmCursesMainForm::HandleInput()
this->PrintKeys(1);
curses_move(y-5,static_cast<unsigned int>(searchstr.size()));
//curses_move(1,1);
- touchwin(stdscr);
+ touchwin(stdscr);
refresh();
}
int key = getch();
getmaxyx(stdscr, y, x);
// If window too small, handle 'q' only
- if ( x < cmCursesMainForm::MIN_WIDTH ||
+ if ( x < cmCursesMainForm::MIN_WIDTH ||
y < cmCursesMainForm::MIN_HEIGHT )
{
// quit
@@ -948,7 +947,7 @@ void cmCursesMainForm::HandleInput()
}
if ((!currentWidget || !widgetHandled) && !this->SearchMode)
{
- // If the current widget does not want to handle input,
+ // If the current widget does not want to handle input,
// we handle it.
sprintf(debugMessage, "Main form handling input, key: %d", key);
cmCursesForm::LogMessage(debugMessage);
@@ -1028,7 +1027,7 @@ void cmCursesMainForm::HandleInput()
this->Fields[findex-2]));
const char* curField = lbl->GetValue();
const char* helpString=0;
- cmCacheManager::CacheIterator it =
+ cmCacheManager::CacheIterator it =
this->CMakeInstance->GetCacheManager()->GetCacheIterator(curField);
if (!it.IsAtEnd())
{
@@ -1052,7 +1051,7 @@ void cmCursesMainForm::HandleInput()
CurrentForm = msgs;
msgs->Render(1,1,x,y);
msgs->HandleInput();
- CurrentForm = this;
+ CurrentForm = this;
this->Render(1,1,x,y);
set_current_field(this->Form, cur);
}
@@ -1137,7 +1136,7 @@ void cmCursesMainForm::HandleInput()
// each entry consists of fields: label, isnew, value
// therefore, the label field for the is findex-2
// (findex always corresponds to the value field)
- cmCursesWidget* lbl
+ cmCursesWidget* lbl
= reinterpret_cast<cmCursesWidget*>(
field_userptr(this->Fields[findex-2]));
if ( lbl )
@@ -1177,15 +1176,15 @@ void cmCursesMainForm::HandleInput()
}
}
- touchwin(stdscr);
- wrefresh(stdscr);
+ touchwin(stdscr);
+ wrefresh(stdscr);
}
}
int cmCursesMainForm::LoadCache(const char *)
{
- int r = this->CMakeInstance->LoadCache();
+ int r = this->CMakeInstance->LoadCache();
if(r < 0)
{
return r;
@@ -1194,7 +1193,7 @@ int cmCursesMainForm::LoadCache(const char *)
this->CMakeInstance->PreLoadCMakeFiles();
return r;
}
-
+
void cmCursesMainForm::JumpToCacheEntry(const char* astr)
{
std::string str;
@@ -1247,7 +1246,7 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr)
/*
char buffer[1024];
sprintf(buffer, "Line: %d != %d / %d\n", findex, idx, this->NumberOfVisibleEntries);
- touchwin(stdscr);
+ touchwin(stdscr);
refresh();
this->UpdateStatusBar( buffer );
usleep(100000);
@@ -1262,7 +1261,7 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr)
}
-const char* cmCursesMainForm::s_ConstHelpMessage =
+const char* cmCursesMainForm::s_ConstHelpMessage =
"CMake is used to configure and generate build files for software projects. "
"The basic steps for configuring a project with ccmake are as follows:\n\n"
"1. Run ccmake in the directory where you want the object and executable files to be placed (build directory). If the source directory is not the same as this build directory, you have to specify it as an argument on the command line.\n\n"
@@ -1301,6 +1300,5 @@ const char* cmCursesMainForm::s_ConstHelpMessage =
" g : generate build files and exit, only available when there are no "
"new options and no errors have been detected during last configuration.\n"
" l : shows last errors\n"
-" t : toggles advanced mode. In normal mode, only the most important options are shown. In advanced mode, all options are shown. We recommend using normal mode unless you are an expert.\n";
-
-
+" t : toggles advanced mode. In normal mode, only the most important options are shown. In advanced mode, all options are shown. We recommend using normal mode unless you are an expert.\n"
+" / : search for a variable name.\n";
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 702ba10..7bb8b27 100644
--- a/Source/cmCTest.cxx
+++ b/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;
}
diff --git a/Source/cmCommandArgumentLexer.cxx b/Source/cmCommandArgumentLexer.cxx
index 1367945..1d7140b 100644
--- a/Source/cmCommandArgumentLexer.cxx
+++ b/Source/cmCommandArgumentLexer.cxx
@@ -47,7 +47,7 @@
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@@ -64,7 +64,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
@@ -189,7 +189,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
-
+
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
@@ -251,7 +251,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -832,25 +832,25 @@ YY_RULE_SETUP
case 2:
YY_RULE_SETUP
#line 72 "cmCommandArgumentLexer.in.l"
-{
+{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
- return cal_NCURLY;
-}
+ yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
+ return cal_NCURLY;
+}
case 3:
YY_RULE_SETUP
#line 78 "cmCommandArgumentLexer.in.l"
-{
+{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
- return cal_ATNAME;
-}
+ yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
+ return cal_ATNAME;
+}
case 4:
YY_RULE_SETUP
#line 84 "cmCommandArgumentLexer.in.l"
{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->DCURLYVariable;
return cal_DCURLY;
}
@@ -859,7 +859,7 @@ YY_RULE_SETUP
#line 91 "cmCommandArgumentLexer.in.l"
{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->RCURLYVariable;
return cal_RCURLY;
}
@@ -868,17 +868,17 @@ YY_RULE_SETUP
#line 98 "cmCommandArgumentLexer.in.l"
{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->ATVariable;
return cal_AT;
}
case 7:
YY_RULE_SETUP
#line 105 "cmCommandArgumentLexer.in.l"
-{
+{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
- return cal_NAME;
+ yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ return cal_NAME;
}
case 8:
YY_RULE_SETUP
@@ -888,40 +888,40 @@ YY_RULE_SETUP
{
return cal_ERROR;
}
- return cal_SYMBOL;
+ return cal_SYMBOL;
}
case 9:
/* rule 9 can match eol */
YY_RULE_SETUP
#line 119 "cmCommandArgumentLexer.in.l"
-{
+{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
- return cal_SYMBOL;
+ yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ return cal_SYMBOL;
}
case 10:
YY_RULE_SETUP
#line 125 "cmCommandArgumentLexer.in.l"
{
- //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->DOLLARVariable;
- return cal_DOLLAR;
+ return cal_DOLLAR;
}
case 11:
YY_RULE_SETUP
#line 131 "cmCommandArgumentLexer.in.l"
{
- //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->LCURLYVariable;
- return cal_LCURLY;
+ return cal_LCURLY;
}
case 12:
YY_RULE_SETUP
#line 137 "cmCommandArgumentLexer.in.l"
{
- //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->BSLASHVariable;
- return cal_BSLASH;
+ return cal_BSLASH;
}
case 13:
YY_RULE_SETUP
@@ -1419,7 +1419,7 @@ static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner)
YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
-
+
b = (YY_BUFFER_STATE) cmCommandArgument_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_create_buffer()" );
@@ -1463,7 +1463,7 @@ static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner)
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
-
+
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a cmCommandArgument_yyrestart() or at EOF.
@@ -1489,7 +1489,7 @@ extern int isatty (int );
}
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-
+
errno = oerrno;
}
@@ -1595,9 +1595,9 @@ static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yyensure_buffer_stack()" );
-
+
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
+
yyg->yy_buffer_stack_max = num_to_alloc;
yyg->yy_buffer_stack_top = 0;
return;
@@ -1626,12 +1626,12 @@ static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner)
* @param base the character buffer
* @param size the size in bytes of the character buffer
* @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
-
+
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -1667,14 +1667,14 @@ YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char * base, yy_size_t size
*/
YY_BUFFER_STATE cmCommandArgument_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
{
-
+
return cmCommandArgument_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
}
/** Setup the input buffer state to scan the given bytes. The next call to cmCommandArgument_yylex() will
- * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * scan from a @e copy of @a yybytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
@@ -1684,7 +1684,7 @@ YY_BUFFER_STATE cmCommandArgument_yy_scan_bytes (yyconst char * yybytes, int _
char *buf;
yy_size_t n;
int i;
-
+
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) cmCommandArgument_yyalloc(n ,yyscanner );
@@ -1752,10 +1752,10 @@ YY_EXTRA_TYPE cmCommandArgument_yyget_extra (yyscan_t yyscanner)
int cmCommandArgument_yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+
if (! YY_CURRENT_BUFFER)
return 0;
-
+
return yylineno;
}
@@ -1765,10 +1765,10 @@ int cmCommandArgument_yyget_lineno (yyscan_t yyscanner)
int cmCommandArgument_yyget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+
if (! YY_CURRENT_BUFFER)
return 0;
-
+
return yycolumn;
}
@@ -1829,13 +1829,13 @@ void cmCommandArgument_yyset_lineno (int line_number , yyscan_t yyscanner)
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- yy_fatal_error( "cmCommandArgument_yyset_lineno called with no buffer" , yyscanner);
-
+ yy_fatal_error( "cmCommandArgument_yyset_lineno called with no buffer" , yyscanner);
+
yylineno = line_number;
}
/** Set the current column.
- * @param line_number
+ * @param column_no
* @param yyscanner The scanner object.
*/
void cmCommandArgument_yyset_column (int column_no , yyscan_t yyscanner)
@@ -1844,8 +1844,8 @@ void cmCommandArgument_yyset_column (int column_no , yyscan_t yyscanner)
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- yy_fatal_error( "cmCommandArgument_yyset_column called with no buffer" , yyscanner);
-
+ yy_fatal_error( "cmCommandArgument_yyset_column called with no buffer" , yyscanner);
+
yycolumn = column_no;
}
@@ -1928,20 +1928,20 @@ int cmCommandArgument_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* p
errno = EINVAL;
return 1;
}
-
+
*ptr_yy_globals = (yyscan_t) cmCommandArgument_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
-
+
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
return 1;
}
-
+
/* By setting to 0xAA, we expose bugs in
yy_init_globals. Leave at 0x00 for releases. */
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-
+
cmCommandArgument_yyset_extra (yy_user_defined, *ptr_yy_globals);
-
+
return yy_init_globals ( *ptr_yy_globals );
}
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index c87b64d..f8ab686 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/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));
}
diff --git a/Source/cmDependsFortranLexer.cxx b/Source/cmDependsFortranLexer.cxx
index a488884..438af2d 100644
--- a/Source/cmDependsFortranLexer.cxx
+++ b/Source/cmDependsFortranLexer.cxx
@@ -1991,9 +1991,9 @@ YY_BUFFER_STATE cmDependsFortran_yy_scan_string (yyconst char * yystr , yyscan_t
}
/** Setup the input buffer state to scan the given bytes. The next call to cmDependsFortran_yylex() will
- * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * scan from a @e copy of @a yybytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
@@ -2154,7 +2154,7 @@ void cmDependsFortran_yyset_lineno (int line_number , yyscan_t yyscanner)
}
/** Set the current column.
- * @param line_number
+ * @param column_no
* @param yyscanner The scanner object.
*/
void cmDependsFortran_yyset_column (int column_no , yyscan_t yyscanner)
diff --git a/Source/cmDependsJavaLexer.cxx b/Source/cmDependsJavaLexer.cxx
index d7149c7..63cfebc 100644
--- a/Source/cmDependsJavaLexer.cxx
+++ b/Source/cmDependsJavaLexer.cxx
@@ -48,7 +48,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
@@ -169,7 +169,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
-
+
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
@@ -234,7 +234,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -1428,9 +1428,9 @@ YY_RULE_SETUP
case 107:
YY_RULE_SETUP
#line 200 "cmDependsJavaLexer.in.l"
-{
- yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
- return jp_NAME;
+{
+ yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ return jp_NAME;
}
case 108:
/* rule 108 can match eol */
@@ -1447,11 +1447,11 @@ YY_RULE_SETUP
case 110:
YY_RULE_SETUP
#line 207 "cmDependsJavaLexer.in.l"
-{
- std::cerr << "Unknown character: " << yytext[0]
- << " (" << (int)yytext[0] << ")" << std::endl;
- yyextra->Error("Unknown character");
- return jp_ERROR;
+{
+ std::cerr << "Unknown character: " << yytext[0]
+ << " (" << (int)yytext[0] << ")" << std::endl;
+ yyextra->Error("Unknown character");
+ return jp_ERROR;
}
case 111:
YY_RULE_SETUP
@@ -1933,7 +1933,7 @@ static void cmDependsJava_yy_load_buffer_state (yyscan_t yyscanner)
YY_BUFFER_STATE cmDependsJava_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
-
+
b = (YY_BUFFER_STATE) cmDependsJava_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in cmDependsJava_yy_create_buffer()" );
@@ -1977,7 +1977,7 @@ static void cmDependsJava_yy_load_buffer_state (yyscan_t yyscanner)
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
-
+
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a cmDependsJava_yyrestart() or at EOF.
@@ -2003,7 +2003,7 @@ extern int isatty (int );
}
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-
+
errno = oerrno;
}
@@ -2107,9 +2107,9 @@ static void cmDependsJava_yyensure_buffer_stack (yyscan_t yyscanner)
yyg->yy_buffer_stack = (struct yy_buffer_state**)cmDependsJava_yyalloc
(nuto_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
-
+
memset(yyg->yy_buffer_stack, 0, nuto_alloc * sizeof(struct yy_buffer_state*));
-
+
yyg->yy_buffer_stack_max = nuto_alloc;
yyg->yy_buffer_stack_top = 0;
return;
@@ -2136,12 +2136,12 @@ static void cmDependsJava_yyensure_buffer_stack (yyscan_t yyscanner)
* @param base the character buffer
* @param size the size in bytes of the character buffer
* @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE cmDependsJava_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
-
+
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -2168,8 +2168,8 @@ YY_BUFFER_STATE cmDependsJava_yy_scan_buffer (char * base, yy_size_t size , yy
}
/** Setup the input buffer state to scan a string. The next call to cmDependsJava_yylex() will
- * scan from a @e copy of @a str.
- * @param str a NUL-terminated string to scan
+ * scan from a @e copy of @a yy_str.
+ * @param yy_str a NUL-terminated string to scan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
@@ -2177,7 +2177,7 @@ YY_BUFFER_STATE cmDependsJava_yy_scan_buffer (char * base, yy_size_t size , yy
*/
YY_BUFFER_STATE cmDependsJava_yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner)
{
-
+
return cmDependsJava_yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner);
}
@@ -2194,7 +2194,7 @@ YY_BUFFER_STATE cmDependsJava_yy_scan_bytes (yyconst char * bytes, int len , y
char *buf;
yy_size_t n;
int i;
-
+
/* Get memory for full buffer, including space for trailing EOB's. */
n = len + 2;
buf = (char *) cmDependsJava_yyalloc(n ,yyscanner );
@@ -2262,10 +2262,10 @@ YY_EXTRA_TYPE cmDependsJava_yyget_extra (yyscan_t yyscanner)
int cmDependsJava_yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+
if (! YY_CURRENT_BUFFER)
return 0;
-
+
return yylineno;
}
@@ -2275,10 +2275,10 @@ int cmDependsJava_yyget_lineno (yyscan_t yyscanner)
int cmDependsJava_yyget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+
if (! YY_CURRENT_BUFFER)
return 0;
-
+
return yycolumn;
}
@@ -2339,13 +2339,13 @@ void cmDependsJava_yyset_lineno (int line_number , yyscan_t yyscanner)
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- yy_fatal_error( "cmDependsJava_yyset_lineno called with no buffer" , yyscanner);
-
+ yy_fatal_error( "cmDependsJava_yyset_lineno called with no buffer" , yyscanner);
+
yylineno = line_number;
}
/** Set the current column.
- * @param line_number
+ * @param column_no
* @param yyscanner The scanner object.
*/
void cmDependsJava_yyset_column (int column_no , yyscan_t yyscanner)
@@ -2354,8 +2354,8 @@ void cmDependsJava_yyset_column (int column_no , yyscan_t yyscanner)
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- yy_fatal_error( "cmDependsJava_yyset_column called with no buffer" , yyscanner);
-
+ yy_fatal_error( "cmDependsJava_yyset_column called with no buffer" , yyscanner);
+
yycolumn = column_no;
}
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index f2b01f1..ed303c9 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/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 "
@@ -1103,6 +1103,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"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.",
"This variable is a special case of the more-general "
@@ -1219,7 +1228,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Therefore a specific build configuration must be chosen even "
"if the generated build system supports multiple configurations.",false,
"Variables that Control the Build");
-
+ cm->DefineProperty
+ ("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. "
+ "See that target property for additional information.",
+ false,
+ "Variables that Control the Build");
// Variables defined when the a language is enabled These variables will
// also be defined whenever CMake has loaded its support for compiling (LANG)
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index bfe11c1..07683d0 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -21,7 +21,7 @@ static const char *cmDocumentationStandardOptions[][3] =
{
{"--copyright [file]", "Print the CMake copyright and exit.",
"If a file is specified, the copyright is written into it."},
- {"--help", "Print usage information and exit.",
+ {"--help,-help,-usage,-h,-H,/?", "Print usage information and exit.",
"Usage describes the basic command line interface and its options."},
{"--help-full [file]", "Print full help and exit.",
"Full help displays most of the documentation provided by the UNIX "
@@ -34,7 +34,8 @@ static const char *cmDocumentationStandardOptions[][3] =
{"--help-man [file]", "Print full help as a UNIX man page and exit.",
"This option is used by the cmake build to generate the UNIX man page. "
"If a file is specified, the help is written into it."},
- {"--version [file]", "Show program name/version banner and exit.",
+ {"--version,-version,/V [file]",
+ "Show program name/version banner and exit.",
"If a file is specified, the version is written into it."},
{0,0,0}
};
@@ -235,24 +236,24 @@ cmDocumentation::cmDocumentation()
sec = new cmDocumentationSection("See Also","SEE ALSO");
sec->Append(cmDocumentationStandardSeeAlso);
- this->AllSections["Standard See Also"] = sec;
+ this->AllSections["Standard See Also"] = sec;
sec = new cmDocumentationSection("Options","OPTIONS");
sec->Append(cmDocumentationStandardOptions);
- this->AllSections["Options"] = sec;
+ this->AllSections["Options"] = sec;
sec = new cmDocumentationSection("Properties","PROPERTIES");
sec->Append(cmPropertiesDocumentationDescription);
- this->AllSections["Properties Description"] = sec;
+ this->AllSections["Properties Description"] = sec;
sec = new cmDocumentationSection("Generators","GENERATORS");
sec->Append(cmDocumentationGeneratorsHeader);
- this->AllSections["Generators"] = sec;
+ this->AllSections["Generators"] = sec;
sec = new cmDocumentationSection("Compatibility Commands",
"COMPATIBILITY COMMANDS");
sec->Append(cmCompatCommandsDocumentationDescription);
- this->AllSections["Compatibility Commands"] = sec;
+ this->AllSections["Compatibility Commands"] = sec;
this->PropertySections.push_back("Properties of Global Scope");
@@ -279,7 +280,7 @@ cmDocumentation::~cmDocumentation()
{
delete [] *i;
}
- for(std::map<std::string,cmDocumentationSection *>::iterator i =
+ for(std::map<std::string,cmDocumentationSection *>::iterator i =
this->AllSections.begin();
i != this->AllSections.end(); ++i)
{
@@ -314,7 +315,7 @@ bool cmDocumentation::PrintCopyright(std::ostream& os)
//----------------------------------------------------------------------------
bool cmDocumentation::PrintVersion(std::ostream& os)
{
- os << this->GetNameString() << " version "
+ os << this->GetNameString() << " version "
<< cmVersion::GetCMakeVersion() << "\n";
return true;
}
@@ -331,7 +332,7 @@ void cmDocumentation::AddSectionToPrint(const char *section)
//----------------------------------------------------------------------------
void cmDocumentation::ClearSections()
{
- this->PrintSections.erase(this->PrintSections.begin(),
+ this->PrintSections.erase(this->PrintSections.begin(),
this->PrintSections.end());
this->ModulesFound.clear();
}
@@ -359,7 +360,7 @@ void cmDocumentation::AddDocumentIntroToPrint(const char* intro[2])
bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os,
const char* docname)
{
- if ((this->CurrentFormatter->GetForm() != HTMLForm)
+ if ((this->CurrentFormatter->GetForm() != HTMLForm)
&& (this->CurrentFormatter->GetForm() != DocbookForm)
&& (this->CurrentFormatter->GetForm() != ManForm))
{
@@ -394,8 +395,8 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os,
this->PrintDocumentationList(os,"Commands");
this->PrintDocumentationList(os,"Compatibility Commands");
return true;
- case cmDocumentation::ModuleList:
- // find the modules first, print the custom module docs only if
+ case cmDocumentation::ModuleList:
+ // find the modules first, print the custom module docs only if
// any custom modules have been found actually, Alex
this->CreateCustomModulesSection();
this->CreateModulesSection();
@@ -406,43 +407,43 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os,
}
this->PrintDocumentationList(os,"Modules");
return true;
- case cmDocumentation::PropertyList:
+ case cmDocumentation::PropertyList:
this->PrintDocumentationList(os,"Properties Description");
- for (std::vector<std::string>::iterator i =
+ for (std::vector<std::string>::iterator i =
this->PropertySections.begin();
i != this->PropertySections.end(); ++i)
{
this->PrintDocumentationList(os,i->c_str());
}
return true;
- case cmDocumentation::VariableList:
- for (std::vector<std::string>::iterator i =
+ case cmDocumentation::VariableList:
+ for (std::vector<std::string>::iterator i =
this->VariableSections.begin();
i != this->VariableSections.end(); ++i)
{
this->PrintDocumentationList(os,i->c_str());
}
return true;
- case cmDocumentation::Full:
+ case cmDocumentation::Full:
return this->PrintDocumentationFull(os);
- case cmDocumentation::Modules:
+ case cmDocumentation::Modules:
return this->PrintDocumentationModules(os);
- case cmDocumentation::CustomModules:
+ case cmDocumentation::CustomModules:
return this->PrintDocumentationCustomModules(os);
- case cmDocumentation::Policies:
+ case cmDocumentation::Policies:
return this->PrintDocumentationPolicies(os);
- case cmDocumentation::Properties:
+ case cmDocumentation::Properties:
return this->PrintDocumentationProperties(os);
- case cmDocumentation::Variables:
+ case cmDocumentation::Variables:
return this->PrintDocumentationVariables(os);
- case cmDocumentation::Commands:
+ case cmDocumentation::Commands:
return this->PrintDocumentationCurrentCommands(os);
- case cmDocumentation::CompatCommands:
+ case cmDocumentation::CompatCommands:
return this->PrintDocumentationCompatCommands(os);
- case cmDocumentation::Copyright:
+ case cmDocumentation::Copyright:
return this->PrintCopyright(os);
- case cmDocumentation::Version:
+ case cmDocumentation::Version:
return true;
default: return false;
}
@@ -451,7 +452,7 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os,
//----------------------------------------------------------------------------
bool cmDocumentation::CreateModulesSection()
{
- cmDocumentationSection *sec =
+ cmDocumentationSection *sec =
new cmDocumentationSection("Standard CMake Modules", "MODULES");
this->AllSections["Modules"] = sec;
std::string cmakeModules = this->CMakeRoot;
@@ -485,7 +486,7 @@ bool cmDocumentation::CreateCustomModulesSection()
{
if (!sectionHasHeader)
{
- cmDocumentationSection *sec =
+ cmDocumentationSection *sec =
new cmDocumentationSection("Custom CMake Modules","CUSTOM MODULES");
this->AllSections["Custom CMake Modules"] = sec;
sec->Append(cmDocumentationCustomModulesHeader[0]);
@@ -502,10 +503,10 @@ bool cmDocumentation::CreateCustomModulesSection()
//----------------------------------------------------------------------------
void cmDocumentation
-::CreateModuleDocsForDir(cmsys::Directory& dir,
+::CreateModuleDocsForDir(cmsys::Directory& dir,
cmDocumentationSection &moduleSection)
{
- // sort the files alphabetically, so the docs for one module are easier
+ // sort the files alphabetically, so the docs for one module are easier
// to find than if they are in random order
std::vector<std::string> sortedFiles;
for(unsigned int i = 0; i < dir.GetNumberOfFiles(); ++i)
@@ -530,7 +531,7 @@ void cmDocumentation
std::string path = dir.GetPath();
path += "/";
path += (*fname);
- this->CreateSingleModule(path.c_str(), moduleName.c_str(),
+ this->CreateSingleModule(path.c_str(), moduleName.c_str(),
moduleSection);
}
}
@@ -539,7 +540,7 @@ void cmDocumentation
}
//----------------------------------------------------------------------------
-bool cmDocumentation::CreateSingleModule(const char* fname,
+bool cmDocumentation::CreateSingleModule(const char* fname,
const char* moduleName,
cmDocumentationSection &moduleSection)
{
@@ -548,7 +549,7 @@ bool cmDocumentation::CreateSingleModule(const char* fname,
{
std::cerr << "Internal error: can not open module." << fname << std::endl;
return false;
- }
+ }
std::string line;
std::string text;
std::string brief;
@@ -561,14 +562,14 @@ bool cmDocumentation::CreateSingleModule(const char* fname,
// blank line
if(line.size() <= 2)
{
- text += "\n";
+ text += "\n";
newParagraph = true;
}
- else if(line[2] == '-')
+ else if(line[2] == '-')
{
brief = line.c_str()+4;
}
- else
+ else
{
// two spaces
if(line[1] == ' ' && line[2] == ' ')
@@ -630,11 +631,11 @@ bool cmDocumentation::CreateSingleModule(const char* fname,
bool cmDocumentation::PrintRequestedDocumentation(std::ostream& os)
{
bool result = true;
-
+
// Loop over requested documentation types.
- for(std::vector<RequestedHelpItem>::const_iterator
+ for(std::vector<RequestedHelpItem>::const_iterator
i = this->RequestedHelpItems.begin();
- i != this->RequestedHelpItems.end();
+ i != this->RequestedHelpItems.end();
++i)
{
this->SetForm(i->HelpForm);
@@ -660,13 +661,13 @@ bool cmDocumentation::PrintRequestedDocumentation(std::ostream& os)
docname = cmSystemTools::GetFilenameWithoutLastExtension(i->Filename);
}
}
-
+
// Print this documentation type to the stream.
if(!this->PrintDocumentation(i->HelpType, *s, docname.c_str()) || !*s)
{
result = false;
}
-
+
// Close the file if we wrote one.
if(fout)
{
@@ -876,8 +877,8 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv,
GET_OPT_ARGUMENT(help.Filename);
help.HelpForm = cmDocumentation::UsageForm;
}
- else if((strcmp(argv[i], "--version") == 0) ||
- (strcmp(argv[i], "-version") == 0) ||
+ else if((strcmp(argv[i], "--version") == 0) ||
+ (strcmp(argv[i], "-version") == 0) ||
(strcmp(argv[i], "/V") == 0))
{
help.HelpType = cmDocumentation::Version;
@@ -904,14 +905,14 @@ void cmDocumentation::Print(Form f, std::ostream& os)
//----------------------------------------------------------------------------
void cmDocumentation::Print(std::ostream& os)
{
- // if the formatter supports it, print a master index for
+ // if the formatter supports it, print a master index for
// all sections
this->CurrentFormatter->PrintIndex(os, this->PrintSections);
for(unsigned int i=0; i < this->PrintSections.size(); ++i)
{
std::string name = this->PrintSections[i]->
GetName((this->CurrentFormatter->GetForm()));
- this->CurrentFormatter->PrintSection(os,*this->PrintSections[i],
+ this->CurrentFormatter->PrintSection(os,*this->PrintSections[i],
name.c_str());
}
}
@@ -929,7 +930,7 @@ void cmDocumentation::SetDocName(const char *docname)
}
//----------------------------------------------------------------------------
-void cmDocumentation::SetSection(const char *name,
+void cmDocumentation::SetSection(const char *name,
cmDocumentationSection *section)
{
if (this->AllSections.find(name) != this->AllSections.end())
@@ -940,22 +941,22 @@ void cmDocumentation::SetSection(const char *name,
}
//----------------------------------------------------------------------------
-void cmDocumentation::SetSection(const char *name,
+void cmDocumentation::SetSection(const char *name,
std::vector<cmDocumentationEntry> &docs)
{
- cmDocumentationSection *sec =
- new cmDocumentationSection(name,
+ cmDocumentationSection *sec =
+ new cmDocumentationSection(name,
cmSystemTools::UpperCase(name).c_str());
sec->Append(docs);
this->SetSection(name,sec);
}
//----------------------------------------------------------------------------
-void cmDocumentation::SetSection(const char *name,
+void cmDocumentation::SetSection(const char *name,
const char *docs[][3])
{
- cmDocumentationSection *sec =
- new cmDocumentationSection(name,
+ cmDocumentationSection *sec =
+ new cmDocumentationSection(name,
cmSystemTools::UpperCase(name).c_str());
sec->Append(docs);
this->SetSection(name,sec);
@@ -965,15 +966,15 @@ void cmDocumentation::SetSection(const char *name,
void cmDocumentation
::SetSections(std::map<std::string,cmDocumentationSection *> &sections)
{
- for (std::map<std::string,cmDocumentationSection *>::const_iterator
+ for (std::map<std::string,cmDocumentationSection *>::const_iterator
it = sections.begin(); it != sections.end(); ++it)
{
this->SetSection(it->first.c_str(),it->second);
- }
+ }
}
//----------------------------------------------------------------------------
-void cmDocumentation::PrependSection(const char *name,
+void cmDocumentation::PrependSection(const char *name,
const char *docs[][3])
{
cmDocumentationSection *sec = 0;
@@ -991,7 +992,7 @@ void cmDocumentation::PrependSection(const char *name,
}
//----------------------------------------------------------------------------
-void cmDocumentation::PrependSection(const char *name,
+void cmDocumentation::PrependSection(const char *name,
std::vector<cmDocumentationEntry> &docs)
{
cmDocumentationSection *sec = 0;
@@ -1009,7 +1010,7 @@ void cmDocumentation::PrependSection(const char *name,
}
//----------------------------------------------------------------------------
-void cmDocumentation::AppendSection(const char *name,
+void cmDocumentation::AppendSection(const char *name,
const char *docs[][3])
{
cmDocumentationSection *sec = 0;
@@ -1027,7 +1028,7 @@ void cmDocumentation::AppendSection(const char *name,
}
//----------------------------------------------------------------------------
-void cmDocumentation::AppendSection(const char *name,
+void cmDocumentation::AppendSection(const char *name,
std::vector<cmDocumentationEntry> &docs)
{
cmDocumentationSection *sec = 0;
@@ -1045,7 +1046,7 @@ void cmDocumentation::AppendSection(const char *name,
}
//----------------------------------------------------------------------------
-void cmDocumentation::AppendSection(const char *name,
+void cmDocumentation::AppendSection(const char *name,
cmDocumentationEntry &docs)
{
@@ -1055,7 +1056,7 @@ void cmDocumentation::AppendSection(const char *name,
}
//----------------------------------------------------------------------------
-void cmDocumentation::PrependSection(const char *name,
+void cmDocumentation::PrependSection(const char *name,
cmDocumentationEntry &docs)
{
@@ -1067,7 +1068,7 @@ void cmDocumentation::PrependSection(const char *name,
//----------------------------------------------------------------------------
void cmDocumentation::SetSeeAlsoList(const char *data[][3])
{
- cmDocumentationSection *sec =
+ cmDocumentationSection *sec =
new cmDocumentationSection("See Also", "SEE ALSO");
this->AllSections["See Also"] = sec;
this->SeeAlsoString = ".B ";
@@ -1075,7 +1076,7 @@ void cmDocumentation::SetSeeAlsoList(const char *data[][3])
while(data[i][1])
{
this->SeeAlsoString += data[i][1];
- this->SeeAlsoString += data[i+1][1]? "(1), ":"(1)";
+ this->SeeAlsoString += data[i+1][1]? "(1), ":"(1)";
++i;
}
sec->Append(0,this->SeeAlsoString.c_str(),0);
@@ -1096,9 +1097,9 @@ bool cmDocumentation::PrintDocumentationGeneric(std::ostream& os,
os << "Required argument missing.\n";
return false;
}
- const std::vector<cmDocumentationEntry> &entries =
+ const std::vector<cmDocumentationEntry> &entries =
this->AllSections[section]->GetEntries();
- for(std::vector<cmDocumentationEntry>::const_iterator ei =
+ for(std::vector<cmDocumentationEntry>::const_iterator ei =
entries.begin();
ei != entries.end(); ++ei)
{
@@ -1138,7 +1139,7 @@ bool cmDocumentation::PrintDocumentationSingleModule(std::ostream& os)
os << "Argument --help-module needs a module name.\n";
return false;
}
-
+
std::string moduleName;
// find the module
std::vector<std::string> dirs;
@@ -1172,10 +1173,10 @@ bool cmDocumentation::PrintDocumentationSingleModule(std::ostream& os)
if(!moduleName.empty())
{
- cmDocumentationSection *sec =
+ cmDocumentationSection *sec =
new cmDocumentationSection("Standard CMake Modules", "MODULES");
this->AllSections["Modules"] = sec;
- if (this->CreateSingleModule(moduleName.c_str(),
+ if (this->CreateSingleModule(moduleName.c_str(),
this->CurrentArgument.c_str(),
*this->AllSections["Modules"]))
{
@@ -1204,7 +1205,7 @@ bool cmDocumentation::PrintDocumentationSingleModule(std::ostream& os)
bool cmDocumentation::PrintDocumentationSingleProperty(std::ostream& os)
{
bool done = false;
- for (std::vector<std::string>::iterator i =
+ for (std::vector<std::string>::iterator i =
this->PropertySections.begin();
!done && i != this->PropertySections.end(); ++i)
{
@@ -1241,7 +1242,7 @@ bool cmDocumentation::PrintDocumentationSinglePolicy(std::ostream& os)
bool cmDocumentation::PrintDocumentationSingleVariable(std::ostream& os)
{
bool done = false;
- for (std::vector<std::string>::iterator i =
+ for (std::vector<std::string>::iterator i =
this->VariableSections.begin();
!done && i != this->VariableSections.end(); ++i)
{
@@ -1270,9 +1271,9 @@ bool cmDocumentation::PrintDocumentationList(std::ostream& os,
return false;
}
- const std::vector<cmDocumentationEntry> &entries =
+ const std::vector<cmDocumentationEntry> &entries =
this->AllSections[section]->GetEntries();
- for(std::vector<cmDocumentationEntry>::const_iterator ei =
+ for(std::vector<cmDocumentationEntry>::const_iterator ei =
entries.begin();
ei != entries.end(); ++ei)
{
@@ -1364,7 +1365,7 @@ bool cmDocumentation::PrintDocumentationProperties(std::ostream& os)
this->ClearSections();
this->AddDocumentIntroToPrint(GET_DOCUMENT_INTRO(Properties));
this->AddSectionToPrint("Properties Description");
- for (std::vector<std::string>::iterator i =
+ for (std::vector<std::string>::iterator i =
this->PropertySections.begin();
i != this->PropertySections.end(); ++i)
{
@@ -1383,7 +1384,7 @@ bool cmDocumentation::PrintDocumentationVariables(std::ostream& os)
{
this->ClearSections();
this->AddDocumentIntroToPrint(GET_DOCUMENT_INTRO(Variables));
- for (std::vector<std::string>::iterator i =
+ for (std::vector<std::string>::iterator i =
this->VariableSections.begin();
i != this->VariableSections.end(); ++i)
{
@@ -1464,10 +1465,10 @@ void cmDocumentation::CreateFullDocumentation()
this->AddSectionToPrint("Commands");
emitted.insert("Commands");
-
+
this->AddSectionToPrint("Properties Description");
emitted.insert("Properties Description");
- for (std::vector<std::string>::iterator i =
+ for (std::vector<std::string>::iterator i =
this->PropertySections.begin();
i != this->PropertySections.end(); ++i)
{
@@ -1481,7 +1482,7 @@ void cmDocumentation::CreateFullDocumentation()
emitted.insert("Author");
// add any sections not yet written out, or to be written out
- for (std::map<std::string, cmDocumentationSection*>::iterator i =
+ for (std::map<std::string, cmDocumentationSection*>::iterator i =
this->AllSections.begin();
i != this->AllSections.end(); ++i)
{
@@ -1579,6 +1580,6 @@ const char* cmDocumentation::GetDefaultDocName(Type ht) const
//----------------------------------------------------------------------------
bool cmDocumentation::IsOption(const char* arg) const
{
- return ((arg[0] == '-') || (strcmp(arg, "/V") == 0) ||
+ return ((arg[0] == '-') || (strcmp(arg, "/V") == 0) ||
(strcmp(arg, "/?") == 0));
}
diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h
index f8cdc96..665b9b6 100644
--- a/Source/cmDocumentationFormatter.h
+++ b/Source/cmDocumentationFormatter.h
@@ -16,7 +16,7 @@
/** This is just a helper class to make it build with MSVC 6.0.
Actually the enums and internal classes could directly go into
-cmDocumentation, but then MSVC6 complains in RequestedHelpItem that
+cmDocumentation, but then MSVC6 complains in RequestedHelpItem that
cmDocumentation is an undefined type and so it doesn't know the enums.
Moving the enums to a class which is then already completely parsed helps
against this. */
@@ -24,10 +24,10 @@ class cmDocumentationEnums
{
public:
/** Types of help provided. */
- enum Type
+ enum Type
{ None, Usage, Single, SingleModule, SingleProperty, SingleVariable,
List, ModuleList, PropertyList, VariableList,
- Full, Properties, Variables, Modules, CustomModules, Commands,
+ Full, Properties, Variables, Modules, CustomModules, Commands,
CompatCommands, Copyright, Version, Policies, SinglePolicy };
/** Forms of documentation output. */
@@ -36,7 +36,7 @@ public:
class cmDocumentationSection;
-/** Base class for printing the documentation in the various supported
+/** Base class for printing the documentation in the various supported
formats. */
class cmDocumentationFormatter
{
@@ -46,7 +46,7 @@ public:
void PrintFormatted(std::ostream& os, const char* text);
virtual cmDocumentationEnums::Form GetForm() const = 0;
-
+
virtual void PrintHeader(const char* /*docname*/,
const char* /*appname*/,
std::ostream& /*os*/) {}
@@ -60,7 +60,7 @@ public:
std::vector<const cmDocumentationSection *>&)
{}
- /** Compute a prefix for links into a section (#<prefix>_SOMETHING). */
+ /** Compute a prefix for links into a section (#\<prefix\>_SOMETHING). */
std::string ComputeSectionLinkPrefix(std::string const& name);
};
diff --git a/Source/cmExprLexer.cxx b/Source/cmExprLexer.cxx
index a642f55..53dfca7 100644
--- a/Source/cmExprLexer.cxx
+++ b/Source/cmExprLexer.cxx
@@ -44,7 +44,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
@@ -165,7 +165,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
-
+
/* Return all but the first "n" matched characters back to the input
stream. */
#define yyless(n) \
@@ -231,7 +231,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -787,7 +787,7 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
#line 88 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
-{ yylvalp->Number = atoi(yytext); return exp_NUMBER; }
+{ yylvalp->Number = atoi(yytext); return exp_NUMBER; }
case 2:
YY_RULE_SETUP
#line 90 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
@@ -795,43 +795,43 @@ YY_RULE_SETUP
case 3:
YY_RULE_SETUP
#line 91 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
-{ return exp_MINUS; }
+{ return exp_MINUS; }
case 4:
YY_RULE_SETUP
#line 92 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
-{ return exp_TIMES; }
+{ return exp_TIMES; }
case 5:
YY_RULE_SETUP
#line 93 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
-{ return exp_DIVIDE; }
+{ return exp_DIVIDE; }
case 6:
YY_RULE_SETUP
#line 94 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
-{ return exp_MOD; }
+{ return exp_MOD; }
case 7:
YY_RULE_SETUP
#line 95 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
-{ return exp_OR; }
+{ return exp_OR; }
case 8:
YY_RULE_SETUP
#line 96 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
-{ return exp_AND; }
+{ return exp_AND; }
case 9:
YY_RULE_SETUP
#line 97 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
-{ return exp_XOR; }
+{ return exp_XOR; }
case 10:
YY_RULE_SETUP
#line 98 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
-{ return exp_NOT; }
+{ return exp_NOT; }
case 11:
YY_RULE_SETUP
#line 99 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
-{ return exp_SHIFTLEFT; }
+{ return exp_SHIFTLEFT; }
case 12:
YY_RULE_SETUP
#line 100 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
-{ return exp_SHIFTRIGHT; }
+{ return exp_SHIFTRIGHT; }
case 13:
YY_RULE_SETUP
#line 101 "/home/andy/vtk/CMake/Source/cmExprLexer.in.l"
@@ -1319,7 +1319,7 @@ static void cmExpr_yy_load_buffer_state (yyscan_t yyscanner)
YY_BUFFER_STATE cmExpr_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
-
+
b = (YY_BUFFER_STATE) cmExpr_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yy_create_buffer()" );
@@ -1363,7 +1363,7 @@ static void cmExpr_yy_load_buffer_state (yyscan_t yyscanner)
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
-
+
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a cmExpr_yyrestart() or at EOF.
@@ -1389,7 +1389,7 @@ extern int isatty (int );
}
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-
+
errno = oerrno;
}
@@ -1493,9 +1493,9 @@ static void cmExpr_yyensure_buffer_stack (yyscan_t yyscanner)
yyg->yy_buffer_stack = (struct yy_buffer_state**)cmExpr_yyalloc
(nuto_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
-
+
memset(yyg->yy_buffer_stack, 0, nuto_alloc * sizeof(struct yy_buffer_state*));
-
+
yyg->yy_buffer_stack_max = nuto_alloc;
yyg->yy_buffer_stack_top = 0;
return;
@@ -1522,12 +1522,12 @@ static void cmExpr_yyensure_buffer_stack (yyscan_t yyscanner)
* @param base the character buffer
* @param size the size in bytes of the character buffer
* @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE cmExpr_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
-
+
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -1554,8 +1554,7 @@ YY_BUFFER_STATE cmExpr_yy_scan_buffer (char * base, yy_size_t size , yyscan_t
}
/** Setup the input buffer state to scan a string. The next call to cmExpr_yylex() will
- * scan from a @e copy of @a str.
- * @param str a NUL-terminated string to scan
+ * scan from a @e copy of @a yy_str.
* @param yy_str a NUL-terminated string to scan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
@@ -1564,7 +1563,7 @@ YY_BUFFER_STATE cmExpr_yy_scan_buffer (char * base, yy_size_t size , yyscan_t
*/
YY_BUFFER_STATE cmExpr_yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner)
{
-
+
return cmExpr_yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner);
}
@@ -1581,7 +1580,7 @@ YY_BUFFER_STATE cmExpr_yy_scan_bytes (yyconst char * bytes, int len , yyscan_t
char *buf;
yy_size_t n;
int i;
-
+
/* Get memory for full buffer, including space for trailing EOB's. */
n = len + 2;
buf = (char *) cmExpr_yyalloc(n ,yyscanner );
@@ -1649,10 +1648,10 @@ YY_EXTRA_TYPE cmExpr_yyget_extra (yyscan_t yyscanner)
int cmExpr_yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+
if (! YY_CURRENT_BUFFER)
return 0;
-
+
return yylineno;
}
@@ -1662,10 +1661,10 @@ int cmExpr_yyget_lineno (yyscan_t yyscanner)
int cmExpr_yyget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+
if (! YY_CURRENT_BUFFER)
return 0;
-
+
return yycolumn;
}
@@ -1726,13 +1725,13 @@ void cmExpr_yyset_lineno (int line_number , yyscan_t yyscanner)
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- yy_fatal_error( "cmExpr_yyset_lineno called with no buffer" , yyscanner);
-
+ yy_fatal_error( "cmExpr_yyset_lineno called with no buffer" , yyscanner);
+
yylineno = line_number;
}
/** Set the current column.
- * @param line_number
+ * @param column_no
* @param yyscanner The scanner object.
*/
void cmExpr_yyset_column (int column_no , yyscan_t yyscanner)
@@ -1741,8 +1740,8 @@ void cmExpr_yyset_column (int column_no , yyscan_t yyscanner)
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- yy_fatal_error( "cmExpr_yyset_column called with no buffer" , yyscanner);
-
+ yy_fatal_error( "cmExpr_yyset_column called with no buffer" , yyscanner);
+
yycolumn = column_no;
}
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index f303f16..248a30a 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -17,6 +17,7 @@
#include "cmMakefile.h"
#include "cmGeneratedFileStream.h"
#include "cmTarget.h"
+#include "cmSourceFile.h"
#include "cmSystemTools.h"
#include <stdlib.h>
@@ -86,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.
@@ -414,7 +425,8 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
linkSourceDirectory.c_str()))
{
this->AppendLinkedResource(fout, sourceLinkedResourceName,
- this->GetEclipsePath(linkSourceDirectory));
+ this->GetEclipsePath(linkSourceDirectory),
+ LinkToFolder);
this->SrcLinkedResources.push_back(sourceLinkedResourceName);
}
@@ -422,31 +434,9 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
if (this->SupportsVirtualFolders)
{
- // for each sub project create a linked resource to the source dir
- // - only if it is an out-of-source build
- this->AppendLinkedResource(fout, "[Subprojects]",
- "virtual:/virtual", true);
-
- for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
- it = this->GlobalGenerator->GetProjectMap().begin();
- it != this->GlobalGenerator->GetProjectMap().end();
- ++it)
- {
- std::string linkSourceDirectory = this->GetEclipsePath(
- it->second[0]->GetMakefile()->GetStartDirectory());
- // a linked resource must not point to a parent directory of .project or
- // .project itself
- if ((this->HomeOutputDirectory != linkSourceDirectory) &&
- !cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
- linkSourceDirectory.c_str()))
- {
- std::string linkName = "[Subprojects]/";
- linkName += it->first;
- this->AppendLinkedResource(fout, linkName,
- this->GetEclipsePath(linkSourceDirectory));
- this->SrcLinkedResources.push_back(it->first);
- }
- }
+ this->CreateLinksToSubprojects(fout);
+
+ this->CreateLinksForTargets(fout);
}
// I'm not sure this makes too much sense. There can be different
@@ -466,6 +456,123 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
fout << "</projectDescription>\n";
}
+
+//----------------------------------------------------------------------------
+void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
+ cmGeneratedFileStream& fout)
+{
+ std::string linkName = "[Targets]";
+ this->AppendLinkedResource(fout, linkName, "virtual:/virtual",VirtualFolder);
+
+ for (std::vector<cmLocalGenerator*>::const_iterator
+ lgIt = this->GlobalGenerator->GetLocalGenerators().begin();
+ lgIt != this->GlobalGenerator->GetLocalGenerators().end();
+ ++lgIt)
+ {
+ cmMakefile* makefile = (*lgIt)->GetMakefile();
+ const cmTargets& targets = makefile->GetTargets();
+
+ for(cmTargets::const_iterator ti=targets.begin(); ti!=targets.end();++ti)
+ {
+ std::string linkName2 = linkName;
+ linkName2 += "/";
+ switch(ti->second.GetType())
+ {
+ case cmTarget::EXECUTABLE:
+ case cmTarget::STATIC_LIBRARY:
+ case cmTarget::SHARED_LIBRARY:
+ case cmTarget::MODULE_LIBRARY:
+ {
+ const char* prefix = (ti->second.GetType()==cmTarget::EXECUTABLE ?
+ "[exe] " : "[lib] ");
+ linkName2 += prefix;
+ linkName2 += ti->first;
+ this->AppendLinkedResource(fout, linkName2, "virtual:/virtual",
+ VirtualFolder);
+ std::vector<cmSourceGroup> sourceGroups=makefile->GetSourceGroups();
+ // get the files from the source lists then add them to the groups
+ cmTarget* tgt = const_cast<cmTarget*>(&ti->second);
+ std::vector<cmSourceFile*>const & files = tgt->GetSourceFiles();
+ for(std::vector<cmSourceFile*>::const_iterator sfIt = files.begin();
+ sfIt != files.end();
+ sfIt++)
+ {
+ // Add the file to the list of sources.
+ std::string source = (*sfIt)->GetFullPath();
+ cmSourceGroup& sourceGroup =
+ makefile->FindSourceGroup(source.c_str(), sourceGroups);
+ sourceGroup.AssignSource(*sfIt);
+ }
+
+ for(std::vector<cmSourceGroup>::iterator sgIt = sourceGroups.begin();
+ sgIt != sourceGroups.end();
+ ++sgIt)
+ {
+ std::string linkName3 = linkName2;
+ linkName3 += "/";
+ linkName3 += sgIt->GetFullName();
+ this->AppendLinkedResource(fout, linkName3, "virtual:/virtual",
+ VirtualFolder);
+
+ std::vector<const cmSourceFile*> sFiles = sgIt->GetSourceFiles();
+ for(std::vector<const cmSourceFile*>::const_iterator fileIt =
+ sFiles.begin();
+ fileIt != sFiles.end();
+ ++fileIt)
+ {
+ std::string linkName4 = linkName3;
+ linkName4 += "/";
+ linkName4 +=
+ cmSystemTools::GetFilenameName((*fileIt)->GetFullPath());
+ this->AppendLinkedResource(fout, linkName4,
+ (*fileIt)->GetFullPath(), LinkToFile);
+ }
+ }
+ }
+ break;
+ // ignore all others:
+ default:
+ break;
+ }
+ }
+ }
+}
+
+
+//----------------------------------------------------------------------------
+void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
+ cmGeneratedFileStream& fout)
+{
+ // for each sub project create a linked resource to the source dir
+ // - only if it is an out-of-source build
+ this->AppendLinkedResource(fout, "[Subprojects]",
+ "virtual:/virtual", VirtualFolder);
+
+ for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
+ it = this->GlobalGenerator->GetProjectMap().begin();
+ it != this->GlobalGenerator->GetProjectMap().end();
+ ++it)
+ {
+ std::string linkSourceDirectory = this->GetEclipsePath(
+ it->second[0]->GetMakefile()->GetStartDirectory());
+ // a linked resource must not point to a parent directory of .project or
+ // .project itself
+ if ((this->HomeOutputDirectory != linkSourceDirectory) &&
+ !cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
+ linkSourceDirectory.c_str()))
+ {
+ std::string linkName = "[Subprojects]/";
+ linkName += it->first;
+ this->AppendLinkedResource(fout, linkName,
+ this->GetEclipsePath(linkSourceDirectory),
+ LinkToFolder
+ );
+ this->SrcLinkedResources.push_back(it->first);
+ }
+ }
+}
+
+
//----------------------------------------------------------------------------
void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
cmGeneratedFileStream& fout,
@@ -598,6 +705,18 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// - make it type 'src'
// - and exclude it from type 'out'
std::string excludeFromOut;
+/* I don't know what the pathentry kind="src" are good for, e.g. autocompletion
+ * works also without them. Done wrong, the indexer complains, see #12417
+ * and #12213.
+ * The CDT documentation is very terse on that:
+ * "CDT_SOURCE: Entry kind constant describing a path entry identifying a
+ * folder containing source code to be compiled."
+ * Also on the cdt-dev list didn't bring any information:
+ * http://web.archiveorange.com/archive/v/B4NlJDNIpYoOS1SbxFNy
+ * So I'm disabling them for now, hoping that somebody will report if something
+ * is not workging anymore.
+ * Alex */
+#ifdef DO_CREATE_SRC_PATH_ENTRIES
for (std::vector<std::string>::const_iterator
it = this->SrcLinkedResources.begin();
it != this->SrcLinkedResources.end();
@@ -614,6 +733,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
excludeFromOut += this->EscapeForXML(*it) + "/|";
}
}
+#endif
excludeFromOut += "**/CMakeFiles/";
fout << "<pathentry excluding=\"" << excludeFromOut
<< "\" kind=\"out\" path=\"\"/>\n";
@@ -791,6 +911,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
const std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
const std::string makeArgs = mf->GetSafeDefinition(
"CMAKE_ECLIPSE_MAKE_ARGUMENTS");
+ const std::string cmake = mf->GetRequiredDefinition("CMAKE_COMMAND");
+
cmGlobalGenerator* generator
= const_cast<cmGlobalGenerator*>(this->GlobalGenerator);
@@ -879,6 +1001,29 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
std::string fastTarget = ti->first;
fastTarget += "/fast";
this->AppendTarget(fout, fastTarget, make, makeArgs, subdir, prefix);
+
+ // Add Build and Clean targets in the virtual folder of targets:
+ if (this->SupportsVirtualFolders)
+ {
+ std::string virtDir = "[Targets]/";
+ virtDir += prefix;
+ virtDir += ti->first;
+ 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 \"";
+ cleanArgs += makefile->GetCurrentOutputDirectory();
+ cleanArgs += "\" \"";
+ cleanArgs += cmake;
+ cleanArgs += "\" -P \"";
+ cleanArgs += (*it)->GetTargetDirectory(ti->second);
+ cleanArgs += "/cmake_clean.cmake\"";
+ this->AppendTarget(fout, "Clean", cmake, cleanArgs, virtDir, "", "");
+ }
}
break;
// ignore these:
@@ -1063,9 +1208,17 @@ void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout,
const std::string& make,
const std::string& makeArgs,
const std::string& path,
- const char* prefix)
+ const char* prefix,
+ const char* makeTarget
+ )
{
std::string targetXml = cmExtraEclipseCDT4Generator::EscapeForXML(target);
+ std::string makeTargetXml = targetXml;
+ if (makeTarget != NULL)
+ {
+ makeTargetXml = cmExtraEclipseCDT4Generator::EscapeForXML(makeTarget);
+ }
+ cmExtraEclipseCDT4Generator::EscapeForXML(target);
std::string pathXml = cmExtraEclipseCDT4Generator::EscapeForXML(path);
fout <<
"<target name=\"" << prefix << targetXml << "\""
@@ -1075,7 +1228,7 @@ void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout,
<< cmExtraEclipseCDT4Generator::GetEclipsePath(make)
<< "</buildCommand>\n"
"<buildArguments>" << makeArgs << "</buildArguments>\n"
- "<buildTarget>" << targetXml << "</buildTarget>\n"
+ "<buildTarget>" << makeTargetXml << "</buildTarget>\n"
"<stopOnError>true</stopOnError>\n"
"<useDefaultCommand>false</useDefaultCommand>\n"
"</target>\n"
@@ -1115,20 +1268,25 @@ void cmExtraEclipseCDT4Generator
::AppendLinkedResource (cmGeneratedFileStream& fout,
const std::string& name,
const std::string& path,
- bool isVirtualFolder)
+ LinkType linkType)
{
const char* locationTag = "location";
- if (isVirtualFolder) // ... and not a linked folder
+ const char* typeTag = "2";
+ if (linkType == VirtualFolder) // ... and not a linked folder
{
locationTag = "locationURI";
}
+ if (linkType == LinkToFile)
+ {
+ typeTag = "1";
+ }
fout <<
"\t\t<link>\n"
"\t\t\t<name>"
<< cmExtraEclipseCDT4Generator::EscapeForXML(name)
<< "</name>\n"
- "\t\t\t<type>2</type>\n"
+ "\t\t\t<type>" << typeTag << "</type>\n"
"\t\t\t<" << locationTag << ">"
<< cmExtraEclipseCDT4Generator::EscapeForXML(path)
<< "</" << locationTag << ">\n"
@@ -1177,7 +1335,7 @@ bool cmExtraEclipseCDT4Generator
else
{
this->AppendLinkedResource(fout, name,
- this->GetEclipsePath(outputPath));
+ this->GetEclipsePath(outputPath), LinkToFolder);
this->OutLinkedResources.push_back(name);
return true;
}
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index b866619..61302e7 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -25,6 +25,8 @@ class cmGeneratedFileStream;
class cmExtraEclipseCDT4Generator : public cmExternalMakefileProjectGenerator
{
public:
+ enum LinkType {VirtualFolder, LinkToFolder, LinkToFile };
+
cmExtraEclipseCDT4Generator();
static cmExternalMakefileProjectGenerator* New() {
@@ -73,7 +75,8 @@ private:
const std::string& make,
const std::string& makeArguments,
const std::string& path,
- const char* prefix = "");
+ const char* prefix = "",
+ const char* makeTarget = NULL);
static void AppendScannerProfile (cmGeneratedFileStream& fout,
const std::string& profileID,
bool openActionEnabled,
@@ -88,7 +91,7 @@ private:
static void AppendLinkedResource (cmGeneratedFileStream& fout,
const std::string& name,
const std::string& path,
- bool isVirtualFolder = false);
+ LinkType linkType);
bool AppendOutLinkedResource(cmGeneratedFileStream& fout,
const std::string& defname,
@@ -101,6 +104,9 @@ private:
static void AddEnvVar(cmGeneratedFileStream& fout, const char* envVar,
cmMakefile* mf);
+ void CreateLinksToSubprojects(cmGeneratedFileStream& fout);
+ void CreateLinksForTargets(cmGeneratedFileStream& fout);
+
std::vector<std::string> SrcLinkedResources;
std::vector<std::string> OutLinkedResources;
std::string HomeDirectory;
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 9f140a9..ded3345 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -90,7 +90,7 @@ public:
cmMakefile* mf);
/**
- * Try running cmake and building a file. This is used for dynalically
+ * Try running cmake and building a file. This is used for dynamically
* loaded commands, not as part of the usual build process.
*/
virtual int TryCompile(const char *srcdir, const char *bindir,
diff --git a/Source/cmGlobalKdevelopGenerator.h b/Source/cmGlobalKdevelopGenerator.h
index 63f7c1f..a1ad39d 100644
--- a/Source/cmGlobalKdevelopGenerator.h
+++ b/Source/cmGlobalKdevelopGenerator.h
@@ -23,8 +23,8 @@ class cmLocalGenerator;
* cmGlobalKdevelopGenerator produces a project file for KDevelop 3 (KDevelop
* > 3.1.1). The project is based on the "Custom Makefile based C/C++"
* project of KDevelop. Such a project consists of Unix Makefiles in the
- * build directory together with a <your_project>.kdevelop project file,
- * which contains the project settings and a <your_project>.kdevelop.filelist
+ * build directory together with a \<your_project\>.kdevelop project file,
+ * which contains the project settings and a \<your_project\>.kdevelop.filelist
* file, which lists the source files relative to the kdevelop project
* directory. The kdevelop project directory is the base source directory.
*/
@@ -36,19 +36,19 @@ public:
virtual const char* GetName() const
{ return cmGlobalKdevelopGenerator::GetActualName();}
static const char* GetActualName() { return "KDevelop3";}
- static cmExternalMakefileProjectGenerator* New()
+ static cmExternalMakefileProjectGenerator* New()
{ return new cmGlobalKdevelopGenerator; }
/** Get the documentation entry for this generator. */
- virtual void GetDocumentation(cmDocumentationEntry& entry,
+ virtual void GetDocumentation(cmDocumentationEntry& entry,
const char* fullName) const;
virtual void Generate();
private:
/*** Create the foo.kdevelop.filelist file, return false if it doesn't
- succeed. If the file already exists the contents will be merged.
+ succeed. If the file already exists the contents will be merged.
*/
bool CreateFilelistFile(const std::vector<cmLocalGenerator*>& lgs,
- const std::string& outputDir,
+ const std::string& outputDir,
const std::string& projectDirIn,
const std::string& projectname,
std::string& cmakeFilePattern,
@@ -62,13 +62,13 @@ private:
listfiles used by this CMakeLists.txt */
void CreateProjectFile(const std::string& outputDir,
const std::string& projectDir,
- const std::string& projectname,
- const std::string& executable,
+ const std::string& projectname,
+ const std::string& executable,
const std::string& cmakeFilePattern,
const std::string& fileToOpen);
/*** Reads the old foo.kdevelop line by line and only replaces the
- "important" lines
+ "important" lines
*/
void MergeProjectFiles(const std::string& outputDir,
const std::string& projectDir,
@@ -78,10 +78,10 @@ private:
const std::string& fileToOpen,
const std::string& sessionFilename);
///! Creates a new foo.kdevelop and a new foo.kdevses file
- void CreateNewProjectFile(const std::string& outputDir,
- const std::string& projectDir,
+ void CreateNewProjectFile(const std::string& outputDir,
+ const std::string& projectDir,
const std::string& filename,
- const std::string& executable,
+ const std::string& executable,
const std::string& cmakeFilePattern,
const std::string& fileToOpen,
const std::string& sessionFilename);
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 481640b..9663b55 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -36,7 +36,7 @@ class cmLocalUnixMakefileGenerator3;
targets that are required to make the process work.
Makefile2 in turn will recursively make targets in the correct order. Each
- target has its own directory <target>.dir and its own makefile build.make in
+ target has its own directory \<target\>.dir and its own makefile build.make in
that directory. Also in that directory is a couple makefiles per source file
used by the target. Typically these are named source.obj.build.make and
source.obj.build.depend.make. The source.obj.build.make contains the rules
@@ -90,7 +90,7 @@ public:
void WriteHelpRule(std::ostream& ruleFileStream,
cmLocalUnixMakefileGenerator3 *);
- // write the top lvel target rules
+ // write the top level target rules
void WriteConvenienceRules(std::ostream& ruleFileStream,
std::set<cmStdString> &emitted);
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index a70427a..97308bb 100644
--- a/Source/cmGlobalVisualStudio11Generator.cxx
+++ b/Source/cmGlobalVisualStudio11Generator.cxx
@@ -32,7 +32,7 @@ void cmGlobalVisualStudio11Generator::AddPlatformDefinitions(cmMakefile* mf)
void cmGlobalVisualStudio11Generator::WriteSLNHeader(std::ostream& fout)
{
fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
- fout << "# Visual Studio 2011\n";
+ fout << "# Visual Studio 11\n";
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 7f19d83..adfb757 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -26,9 +26,9 @@ class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
{
public:
cmGlobalVisualStudio7Generator();
- static cmGlobalGenerator* New() {
+ static cmGlobalGenerator* New() {
return new cmGlobalVisualStudio7Generator; }
-
+
///! Get the name for the generator.
virtual const char* GetName() const {
return cmGlobalVisualStudio7Generator::GetActualName();}
@@ -39,21 +39,21 @@ public:
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
-
+
/**
* Try to determine system infomation such as shared library
- * extension, pthreads, byte order etc.
+ * extension, pthreads, byte order etc.
*/
- virtual void EnableLanguage(std::vector<std::string>const& languages,
+ virtual void EnableLanguage(std::vector<std::string>const& languages,
cmMakefile *, bool optional);
/**
- * Try running cmake and building a file. This is used for dynalically
+ * Try running cmake and building a file. This is used for dynamically
* loaded commands, not as part of the usual build process.
*/
virtual std::string GenerateBuildCommand(const char* makeProgram,
- const char *projectName,
- const char* additionalOptions,
+ const char *projectName,
+ const char* additionalOptions,
const char *targetName,
const char* config,
bool ignoreErrors,
@@ -62,7 +62,7 @@ public:
/**
* Generate the all required files for building this project/tree. This
* basically creates a series of LocalGenerators for each directory and
- * requests that they Generate.
+ * requests that they Generate.
*/
virtual void Generate();
@@ -75,7 +75,7 @@ public:
* Get the list of configurations
*/
std::vector<std::string> *GetConfigurations();
-
+
///! Create a GUID or get an existing one.
void CreateGUID(const char* name);
std::string GetGUID(const char* name);
@@ -97,13 +97,13 @@ protected:
virtual const char* GetIDEVersion() { return "7.0"; }
static cmIDEFlagTable const* GetExtraFlagTableVS7();
- virtual void OutputSLNFile(cmLocalGenerator* root,
+ virtual void OutputSLNFile(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
- virtual void WriteProject(std::ostream& fout,
+ virtual void WriteProject(std::ostream& fout,
const char* name, const char* path, cmTarget &t);
- virtual void WriteProjectDepends(std::ostream& fout,
+ virtual void WriteProjectDepends(std::ostream& fout,
const char* name, const char* path, cmTarget &t);
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
@@ -124,11 +124,11 @@ protected:
std::ostream& fout,
cmLocalGenerator* root,
OrderedTargetDependSet const& projectTargets);
-
+
void GenerateConfigurations(cmMakefile* mf);
- virtual void WriteExternalProject(std::ostream& fout,
- const char* name,
+ virtual void WriteExternalProject(std::ostream& fout,
+ const char* name,
const char* path,
const std::set<cmStdString>&
dependencies);
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 09265ae..32eaef8 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1328,6 +1328,8 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
cmSystemTools::ReplaceString(makecmd, "\\ ", "\\\\ ");
buildphase->AddAttribute("shellScript",
this->CreateString(makecmd.c_str()));
+ buildphase->AddAttribute("showEnvVarsInLog",
+ this->CreateString("0"));
}
//----------------------------------------------------------------------------
@@ -2065,6 +2067,9 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
shellBuildPhase->AddAttribute("shellScript",
this->CreateString(
"# shell script goes here\nexit 0"));
+ shellBuildPhase->AddAttribute("showEnvVarsInLog",
+ this->CreateString("0"));
+
cmXCodeObject* target =
this->CreateObject(cmXCodeObject::PBXAggregateTarget);
target->SetComment(cmtarget.GetName());
diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h
index e5ff4f0..aa13589 100644
--- a/Source/cmLinkDirectoriesCommand.h
+++ b/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."
;
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index c0fe886..0c5b9d0 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -25,7 +25,7 @@ class cmCustomCommand;
* \brief Create required build files for a directory.
*
* Subclasses of this abstract class generate makefiles, DSP, etc for various
- * platforms. This class should never be constructued directly. A
+ * platforms. This class should never be constructed directly. A
* GlobalGenerator will create it and invoke the appropriate commands on it.
*/
class cmLocalGenerator
@@ -33,19 +33,19 @@ class cmLocalGenerator
public:
cmLocalGenerator();
virtual ~cmLocalGenerator();
-
+
/**
- * Generate the makefile for this directory.
+ * Generate the makefile for this directory.
*/
virtual void Generate() {}
/**
* Process the CMakeLists files for this directory to fill in the
- * Makefile ivar
+ * Makefile ivar
*/
virtual void Configure();
- /**
+ /**
* Calls TraceVSDependencies() on all targets of this generator.
*/
virtual void TraceDependencies();
@@ -75,11 +75,11 @@ public:
///! Get the makefile for this generator
cmMakefile *GetMakefile() {
return this->Makefile; };
-
+
///! Get the makefile for this generator, const version
const cmMakefile *GetMakefile() const {
return this->Makefile; };
-
+
///! Get the GlobalGenerator this is associated with
cmGlobalGenerator *GetGlobalGenerator() {
return this->GlobalGenerator; };
@@ -89,10 +89,10 @@ public:
///! Set the Global Generator, done on creation by the GlobalGenerator
void SetGlobalGenerator(cmGlobalGenerator *gg);
- /**
- * Convert something to something else. This is a centralized coversion
+ /**
+ * Convert something to something else. This is a centralized conversion
* routine used by the generators to handle relative paths and the like.
- * The flags determine what is actually done.
+ * The flags determine what is actually done.
*
* relative: treat the argument as a directory and convert it to make it
* relative or full or unchanged. If relative (HOME, START etc) then that
@@ -117,7 +117,7 @@ public:
* Get path for the specified relative root.
*/
const char* GetRelativeRootPath(RelativeRoot relroot);
-
+
/**
* Convert the given path to an output path that is optionally
* relative based on the cache option CMAKE_USE_RELATIVE_PATHS. The
@@ -126,14 +126,14 @@ public:
*/
std::string ConvertToOptionallyRelativeOutputPath(const char* remote);
- ///! set/get the parent generator
+ ///! set/get the parent generator
cmLocalGenerator* GetParent(){return this->Parent;}
void SetParent(cmLocalGenerator* g) { this->Parent = g; g->AddChild(this); }
///! set/get the children
void AddChild(cmLocalGenerator* g) { this->Children.push_back(g); }
std::vector<cmLocalGenerator*>& GetChildren() { return this->Children; };
-
+
void AddArchitectureFlags(std::string& flags, cmTarget* target,
const char *lang, const char* config);
@@ -143,6 +143,7 @@ public:
void AddSharedFlags(std::string& flags, const char* lang, bool shared);
void AddConfigVariableFlags(std::string& flags, const char* var,
const char* config);
+ ///! Append flags to a string.
virtual void AppendFlags(std::string& flags, const char* newFlags);
///! Get the include flags for the current makefile and language
const char* GetIncludeFlags(const char* lang,
@@ -183,9 +184,9 @@ public:
virtual std::string ConvertToIncludeReference(std::string const& path);
/** Called from command-line hook to clear dependencies. */
- virtual void ClearDependencies(cmMakefile* /* mf */,
+ virtual void ClearDependencies(cmMakefile* /* mf */,
bool /* verbose */) {}
-
+
/** Called from command-line hook to update dependencies. */
virtual bool UpdateDependencies(const char* /* tgtInfo */,
bool /*verbose*/,
@@ -259,11 +260,11 @@ public:
/** Return the directories into which object files will be put.
* There maybe more than one for fat binary systems like OSX.
*/
- virtual void
+ virtual void
GetTargetObjectFileDirectories(cmTarget* target,
- std::vector<std::string>&
+ std::vector<std::string>&
dirs);
-
+
/**
* Convert the given remote path to a relative path with respect to
* the given local path. The local path must be given in component
@@ -321,15 +322,15 @@ public:
/** Fill out these strings for the given target. Libraries to link,
* flags, and linkflags. */
- void GetTargetFlags(std::string& linkLibs,
+ void GetTargetFlags(std::string& linkLibs,
std::string& flags,
std::string& linkFlags,
cmTarget&target);
-
+
protected:
///! put all the libraries for a target on into the given stream
virtual void OutputLinkLibraries(std::ostream&, cmTarget&, bool relink);
-
+
// Expand rule variables in CMake of the type found in language rules
void ExpandRuleVariables(std::string& string,
const RuleVariables& replaceValues);
@@ -341,13 +342,13 @@ protected:
void InsertRuleLauncher(std::string& s, cmTarget* target,
const char* prop);
-
- /** Convert a target to a utility target for unsupported
+
+ /** Convert a target to a utility target for unsupported
* languages of a generator */
void AddBuildTargetRule(const char* llang, cmTarget& target);
- ///! add a custom command to build a .o file that is part of a target
- void AddCustomCommandToCreateObject(const char* ofname,
- const char* lang,
+ ///! add a custom command to build a .o file that is part of a target
+ void AddCustomCommandToCreateObject(const char* ofname,
+ const char* lang,
cmSourceFile& source,
cmTarget& target);
// Create Custom Targets and commands for unsupported languages
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index da6a1c6..4e4f1d9 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -608,6 +608,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
::WriteMakeVariables(std::ostream& makefileStream)
@@ -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)
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 0994222..45ac21d 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -38,21 +38,21 @@ public:
/**
* Process the CMakeLists files for this directory to fill in the
- * Makefile ivar
+ * Makefile ivar
*/
virtual void Configure();
/**
- * Generate the makefile for this directory.
+ * Generate the makefile for this directory.
*/
virtual void Generate();
-
+
// this returns the relative path between the HomeOutputDirectory and this
// local generators StartOutputDirectory
const std::string &GetHomeRelativeOutputPath();
- // Write out a make rule
+ // Write out a make rule
void WriteMakeRule(std::ostream& os,
const char* comment,
const char* target,
@@ -60,7 +60,7 @@ public:
const std::vector<std::string>& commands,
bool symbolic,
bool in_help = false);
-
+
// write the main variables used by the makefiles
void WriteMakeVariables(std::ostream& makefileStream);
@@ -71,7 +71,7 @@ public:
*/
void SetPassMakeflags(bool s){this->PassMakeflags = s;}
bool GetPassMakeflags() { return this->PassMakeflags; }
-
+
/**
* Set the flag used to keep the make program silent.
*/
@@ -115,7 +115,7 @@ public:
void SetDefineWindowsNULL(bool v) {this->DefineWindowsNULL = v;}
/**
- * If set to true, cd dir && command is used to
+ * If set to true, cd dir && command is used to
* run commands in a different directory.
*/
void SetUnixCD(bool v) {this->UnixCD = v;}
@@ -161,15 +161,15 @@ public:
// used in writing out Cmake files such as WriteDirectoryInformation
static void WriteCMakeArgument(std::ostream& os, const char* s);
- /** creates the common disclainer text at the top of each makefile */
+ /** creates the common disclaimer text at the top of each makefile */
void WriteDisclaimer(std::ostream& os);
// write a comment line #====... in the stream
void WriteDivider(std::ostream& os);
/** used to create a recursive make call */
- std::string GetRecursiveMakeCall(const char *makefile, const char* tgt);
-
+ std::string GetRecursiveMakeCall(const char *makefile, const char* tgt);
+
// append flags to a string
virtual void AppendFlags(std::string& flags, const char* newFlags);
@@ -185,7 +185,7 @@ public:
virtual std::string GetTargetDirectory(cmTarget const& target) const;
// create a command that cds to the start dir then runs the commands
- void CreateCDCommand(std::vector<std::string>& commands,
+ void CreateCDCommand(std::vector<std::string>& commands,
const char *targetDir,
cmLocalGenerator::RelativeRoot returnDir);
@@ -200,7 +200,7 @@ public:
/** Called from command-line hook to clear dependencies. */
virtual void ClearDependencies(cmMakefile* mf, bool verbose);
-
+
/** write some extra rules such as make test etc */
void WriteSpecialTargetsTop(std::ostream& makefileStream);
void WriteSpecialTargetsBottom(std::ostream& makefileStream);
@@ -224,7 +224,7 @@ public:
// write the target rules for the local Makefile into the stream
void WriteLocalAllRules(std::ostream& ruleFileStream);
-
+
struct LocalObjectEntry
{
cmTarget* Target;
@@ -238,7 +238,7 @@ public:
bool HasSourceExtension;
bool HasPreprocessRule;
bool HasAssembleRule;
- LocalObjectInfo():HasSourceExtension(false), HasPreprocessRule(false),
+ LocalObjectInfo():HasSourceExtension(false), HasPreprocessRule(false),
HasAssembleRule(false) {}
};
std::map<cmStdString, LocalObjectInfo> const& GetLocalObjectFiles()
@@ -261,15 +261,15 @@ public:
void GetTargetObjectFileDirectories(cmTarget* target,
std::vector<std::string>& dirs);
- // Fill the vector with the target names for the object files,
- // preprocessed files and assembly files. Currently only used by the
+ // Fill the vector with the target names for the object files,
+ // preprocessed files and assembly files. Currently only used by the
// Eclipse generator.
void GetIndividualFileTargets(std::vector<std::string>& targets);
-
+
protected:
void WriteLocalMakefile();
-
-
+
+
// write the target rules for the local Makefile into the stream
void WriteLocalMakefileTargets(std::ostream& ruleFileStream,
std::set<cmStdString> &emitted);
@@ -278,17 +278,17 @@ protected:
void WriteDirectoryInformationFile();
- // write the depend info
+ // write the depend info
void WriteDependLanguageInfo(std::ostream& cmakefileStream, cmTarget &tgt);
-
+
// write the local help rule
void WriteHelpRule(std::ostream& ruleFileStream);
-
+
// this converts a file name that is relative to the StartOuputDirectory
// into a full path
std::string ConvertToFullPath(const std::string& localPath);
-
+
void WriteConvenienceRule(std::ostream& ruleFileStream,
const char* realTarget,
const char* helpTarget);
@@ -304,7 +304,7 @@ protected:
void WriteObjectConvenienceRule(std::ostream& ruleFileStream,
const char* comment, const char* output,
LocalObjectInfo const& info);
-
+
std::string GetObjectFileName(cmTarget& target,
const cmSourceFile& source,
std::string* nameWithoutTargetDir = 0,
@@ -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);
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index d9b2772..ae70759 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/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";
+ }
}
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 618f4f3..7c3e4ee 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -72,7 +72,7 @@ public:
/** Return whether compatibility features needed for a version of
the cache or lower should be enabled. */
bool NeedCacheCompatibility(int major, int minor);
-
+
/**
* Construct an empty makefile.
*/
@@ -87,8 +87,8 @@ public:
/**
* Read and parse a CMakeLists.txt file.
*/
- bool ReadListFile(const char* listfile,
- const char* external= 0,
+ bool ReadListFile(const char* listfile,
+ const char* external= 0,
std::string* fullPath= 0,
bool noPolicyScope = true);
@@ -121,21 +121,21 @@ public:
* Try running cmake and building a file. This is used for dynalically
* loaded commands, not as part of the usual build process.
*/
- int TryCompile(const char *srcdir, const char *bindir,
+ int TryCompile(const char *srcdir, const char *bindir,
const char *projectName, const char *targetName,
bool fast,
const std::vector<std::string> *cmakeArgs,
std::string *output);
-
+
/**
* Specify the makefile generator. This is platform/compiler
* dependent, although the interface is through a generic
* superclass.
*/
void SetLocalGenerator(cmLocalGenerator*);
-
+
///! Get the current makefile generator.
- cmLocalGenerator* GetLocalGenerator()
+ cmLocalGenerator* GetLocalGenerator()
{ return this->LocalGenerator;}
/**
@@ -153,15 +153,15 @@ public:
/**
* Perform FinalPass, Library dependency analysis etc before output of the
- * makefile.
+ * makefile.
*/
void ConfigureFinalPass();
-
+
/**
* run the final pass on all commands.
*/
void FinalPass();
-
+
/**
* Print the object state to std::cout.
*/
@@ -205,11 +205,11 @@ public:
cmTarget* AddImportedTarget(const char* name, cmTarget::TargetType type);
cmTarget* AddNewTarget(cmTarget::TargetType type, const char* name);
-
+
/**
* Add an executable to the build.
*/
- cmTarget* AddExecutable(const char *exename,
+ cmTarget* AddExecutable(const char *exename,
const std::vector<std::string> &srcs,
bool excludeFromAll = false);
@@ -237,7 +237,7 @@ public:
*/
void AddLinkLibrary(const char*);
void AddLinkLibrary(const char*, cmTarget::LinkLibraryType type);
- void AddLinkLibraryForTarget(const char *tgt, const char*,
+ void AddLinkLibraryForTarget(const char *tgt, const char*,
cmTarget::LinkLibraryType type);
void AddLinkDirectoryForTarget(const char *tgt, const char* d);
@@ -265,9 +265,9 @@ public:
/**
* Add a subdirectory to the build.
*/
- void AddSubDirectory(const char*, bool excludeFromAll=false,
+ void AddSubDirectory(const char*, bool excludeFromAll=false,
bool preorder = false);
- void AddSubDirectory(const char* fullSrcDir,const char *fullBinDir,
+ void AddSubDirectory(const char* fullSrcDir,const char *fullBinDir,
bool excludeFromAll, bool preorder,
bool immediate);
@@ -275,7 +275,7 @@ public:
* Configure a subdirectory
*/
void ConfigureSubDirectory(cmLocalGenerator *);
-
+
/**
* Add an include directory to the build.
*/
@@ -287,13 +287,13 @@ public:
*/
void AddDefinition(const char* name, const char* value);
///! Add a definition to this makefile and the global cmake cache.
- void AddCacheDefinition(const char* name, const char* value,
+ void AddCacheDefinition(const char* name, const char* value,
const char* doc,
cmCacheManager::CacheEntryType type,
bool force = false);
/**
- * Add bool variable definition to the build.
+ * Add bool variable definition to the build.
*/
void AddDefinition(const char* name, bool);
@@ -304,7 +304,7 @@ public:
void RemoveDefinition(const char* name);
///! Remove a definition from the cache.
void RemoveCacheDefinition(const char* name);
-
+
/**
* Specify the name of the project for this build.
*/
@@ -339,14 +339,14 @@ public:
* Add a source group for consideration when adding a new source.
* name is tokenized.
*/
- void AddSourceGroup(const std::vector<std::string>& name,
+ void AddSourceGroup(const std::vector<std::string>& name,
const char* regex=0);
#endif
//@{
/**
- * Set, Push, Pop policy values for CMake.
+ * Set, Push, Pop policy values for CMake.
*/
bool SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
bool SetPolicy(const char *id, cmPolicies::PolicyStatus status);
@@ -374,31 +374,31 @@ public:
* Get the Policies Instance
*/
cmPolicies *GetPolicies();
-
+
/**
* Add an auxiliary directory to the build.
*/
void AddExtraDirectory(const char* dir);
-
+
/**
* Add an auxiliary directory to the build.
*/
void MakeStartDirectoriesCurrent()
{
- this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
+ this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
this->cmStartDirectory.c_str());
- this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
+ this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
this->StartOutputDirectory.c_str());
}
-
+
//@{
/**
* Set/Get the home directory (or output directory) in the project. The
* home directory is the top directory of the project. It is where
* CMakeSetup or configure was run. Remember that CMake processes
* CMakeLists files by recursing up the tree starting at the StartDirectory
- * and going up until it reaches the HomeDirectory.
+ * and going up until it reaches the HomeDirectory.
*/
void SetHomeDirectory(const char* dir);
const char* GetHomeDirectory() const
@@ -428,15 +428,15 @@ public:
* is the directory of the CMakeLists.txt file that started the current
* round of processing. Remember that CMake processes CMakeLists files by
* recursing up the tree starting at the StartDirectory and going up until
- * it reaches the HomeDirectory.
+ * it reaches the HomeDirectory.
*/
- void SetStartDirectory(const char* dir)
+ void SetStartDirectory(const char* dir)
{
this->cmStartDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
- this->cmStartDirectory =
+ this->cmStartDirectory =
cmSystemTools::CollapseFullPath(this->cmStartDirectory.c_str());
- this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
+ this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
this->cmStartDirectory.c_str());
}
const char* GetStartDirectory() const
@@ -447,10 +447,10 @@ public:
{
this->StartOutputDirectory = lib;
cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
- this->StartOutputDirectory =
+ this->StartOutputDirectory =
cmSystemTools::CollapseFullPath(this->StartOutputDirectory.c_str());
cmSystemTools::MakeDirectory(this->StartOutputDirectory.c_str());
- this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
+ this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
this->StartOutputDirectory.c_str());
}
const char* GetStartOutputDirectory() const
@@ -459,7 +459,7 @@ public:
}
//@}
- const char* GetCurrentDirectory() const
+ const char* GetCurrentDirectory() const
{
return this->cmStartDirectory.c_str();
}
@@ -478,7 +478,7 @@ public:
//@}
- /**
+ /**
* Set a regular expression that include files must match
* in order to be considered as part of the depend information.
*/
@@ -487,11 +487,11 @@ public:
this->IncludeFileRegularExpression = regex;
}
const char* GetIncludeRegularExpression()
- {
+ {
return this->IncludeFileRegularExpression.c_str();
}
- /**
+ /**
* Set a regular expression that include files that are not found
* must match in order to be considered a problem.
*/
@@ -523,11 +523,11 @@ public:
* Get a list of include directories in the build.
*/
std::vector<std::string>& GetIncludeDirectories()
- {
+ {
return this->IncludeDirectories;
}
const std::vector<std::string>& GetIncludeDirectories() const
- {
+ {
return this->IncludeDirectories;
}
void SetIncludeDirectories(const std::vector<std::string>& vec)
@@ -542,7 +542,7 @@ public:
bool IsSystemIncludeDirectory(const char* dir);
/** Expand out any arguements in the vector that have ; separated
- * strings into multiple arguements. A new vector is created
+ * strings into multiple arguements. A new vector is created
* containing the expanded versions of all arguments in argsIn.
* This method differes from the one in cmSystemTools in that if
* the CmakeLists file is version 1.2 or earlier it will check for
@@ -558,7 +558,7 @@ public:
cmSourceFile* GetSource(const char* sourceName);
/** Get a cmSourceFile pointer for a given source name, if the name is
- * not found, then create the source file and return it. generated
+ * not found, then create the source file and return it. generated
* indicates if it is a generated file, this is used in determining
* how to create the source file instance e.g. name
*/
@@ -597,8 +597,8 @@ public:
* variables will be listed.
*/
std::vector<std::string> GetDefinitions(int cacheonly=0) const;
-
- /** Test a boolean cache entry to see if it is true or false,
+
+ /** Test a boolean cache entry to see if it is true or false,
* returns false if no entry defined.
*/
bool IsOn(const char* name) const;
@@ -617,13 +617,13 @@ public:
* Make sure CMake can write this file
*/
bool CanIWriteThisFile(const char* fileName);
-
+
/**
* Get the vector of used command instances.
*/
const std::vector<cmCommand*>& GetUsedCommands() const
{return this->UsedCommands;}
-
+
#if defined(CMAKE_BUILD_WITH_CMAKE)
/**
* Get the vector source groups.
@@ -663,12 +663,12 @@ public:
{ return this->OutputFiles; }
void AddCMakeOutputFile(const char* file)
{ this->OutputFiles.push_back(file);}
-
+
/**
- * Expand all defined variables in the string.
+ * Expand all defined variables in the string.
* Defined variables come from the this->Definitions map.
* They are expanded with ${var} where var is the
- * entry in the this->Definitions map. Also @var@ is
+ * entry in the this->Definitions map. Also \@var\@ is
* expanded to match autoconf style expansions.
*/
const char *ExpandVariablesInString(std::string& source);
@@ -682,15 +682,15 @@ public:
/**
* Remove any remaining variables in the string. Anything with ${var} or
- * @var@ will be removed.
+ * \@var\@ will be removed.
*/
- void RemoveVariablesInString(std::string& source,
+ void RemoveVariablesInString(std::string& source,
bool atOnly = false) const;
/**
* Expand variables in the makefiles ivars such as link directories etc
*/
- void ExpandVariables();
+ void ExpandVariables();
/**
* Replace variables and #cmakedefine lines in the given string.
@@ -702,7 +702,7 @@ public:
/**
* Copy file but change lines acording to ConfigureString
*/
- int ConfigureFile(const char* infile, const char* outfile,
+ int ConfigureFile(const char* infile, const char* outfile,
bool copyonly, bool atOnly, bool escapeQuotes);
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -717,12 +717,12 @@ public:
* Execute a single CMake command. Returns true if the command
* succeeded or false if it failed.
*/
- bool ExecuteCommand(const cmListFileFunction& lff,
+ bool ExecuteCommand(const cmListFileFunction& lff,
cmExecutionStatus &status);
/** Check if a command exists. */
bool CommandExists(const char* name) const;
-
+
/**
* Add a command to this cmake instance
*/
@@ -748,7 +748,7 @@ public:
///! Display progress or status message.
void DisplayStatus(const char*, float);
-
+
/**
* Expand the given list file arguments into the full set after
* variable replacement and list expansion.
@@ -757,13 +757,13 @@ public:
std::vector<std::string>& outArgs);
/**
* Get the instance
- */
+ */
cmake *GetCMakeInstance() const;
/**
* Get all the source files this makefile knows about
*/
- const std::vector<cmSourceFile*> &GetSourceFiles() const
+ const std::vector<cmSourceFile*> &GetSourceFiles() const
{return this->SourceFiles;}
std::vector<cmSourceFile*> &GetSourceFiles() {return this->SourceFiles;}
@@ -775,7 +775,7 @@ public:
/**
* Add a macro to the list of macros. The arguments should be name of the
- * macro and a documentation signature of it
+ * macro and a documentation signature of it
*/
void AddMacro(const char* name, const char* signature);
@@ -797,7 +797,7 @@ public:
*/
std::string GetModulesFile(const char* name);
- ///! Set/Get a property of this directory
+ ///! Set/Get a property of this directory
void SetProperty(const char *prop, const char *value);
void AppendProperty(const char *prop, const char *value,bool asString=false);
const char *GetProperty(const char *prop);
@@ -812,7 +812,7 @@ public:
///! Initialize a makefile from its parent
void InitializeFromParent();
-
+
///! Set/Get the preorder flag
void SetPreOrder(bool p) { this->PreOrder = p; }
bool GetPreOrder() const { return this->PreOrder; }
@@ -859,11 +859,11 @@ protected:
void CheckForUnused(const char* reason, const char* name) const;
std::string Prefix;
- std::vector<std::string> AuxSourceDirectories; //
+ std::vector<std::string> AuxSourceDirectories; //
- std::string cmStartDirectory;
- std::string StartOutputDirectory;
- std::string cmHomeDirectory;
+ std::string cmStartDirectory;
+ std::string StartOutputDirectory;
+ std::string cmHomeDirectory;
std::string HomeOutputDirectory;
std::string cmCurrentListFile;
@@ -875,7 +875,7 @@ protected:
// Tests
std::map<cmStdString, cmTest*> Tests;
-
+
// The include and link-library paths. These may have order
// dependency, so they must be vectors (not set).
std::vector<std::string> IncludeDirectories;
@@ -887,8 +887,8 @@ protected:
std::vector<std::string> ListFiles; // list of command files loaded
std::vector<std::string> OutputFiles; // list of command files loaded
-
-
+
+
cmTarget::LinkLibraryVectorType LinkLibraries;
std::vector<cmInstallGenerator*> InstallGenerators;
@@ -911,9 +911,9 @@ protected:
std::vector<cmCommand*> UsedCommands;
cmLocalGenerator* LocalGenerator;
- bool IsFunctionBlocked(const cmListFileFunction& lff,
+ bool IsFunctionBlocked(const cmListFileFunction& lff,
cmExecutionStatus &status);
-
+
private:
void Initialize();
@@ -923,10 +923,10 @@ private:
void ReadSources(std::ifstream& fin, bool t);
friend class cmMakeDepend; // make depend needs direct access
- // to the Sources array
- void PrintStringVector(const char* s, const
+ // to the Sources array
+ void PrintStringVector(const char* s, const
std::vector<std::pair<cmStdString, bool> >& v) const;
- void PrintStringVector(const char* s,
+ void PrintStringVector(const char* s,
const std::vector<std::string>& v) const;
void AddDefaultDefinitions();
@@ -954,7 +954,7 @@ private:
bool WarnUnused;
bool CheckSystemVars;
- // stack of list files being read
+ // stack of list files being read
std::deque<cmStdString> ListFileStack;
// stack of commands being invoked.
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index abda47e..ae63701 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -1,3 +1,16 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2004-2011 Kitware, Inc.
+ Copyright 2011 Alexander Neundorf (neundorf@kde.org)
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
@@ -38,7 +51,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
const char* targetName = target->GetName();
// don't do anything if there is no Qt4:
std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
- if (qtMajorVersion != "4")
+ if (qtMajorVersion != "4" && qtMajorVersion != "5")
{
return;
}
@@ -54,7 +67,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);
@@ -111,9 +124,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);
@@ -122,10 +141,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;
@@ -157,7 +177,7 @@ bool cmQtAutomoc::Run(const char* targetDirectory)
this->Init();
- if (this->QtMajorVersion == "4")
+ if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5")
{
this->RunAutomocQt4();
}
@@ -213,6 +233,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");
@@ -289,6 +310,8 @@ void cmQtAutomoc::Init()
}
}
+ cmSystemTools::ExpandListArgument(this->MocOptionsStr, this->MocOptions);
+
std::vector<std::string> incPaths;
cmSystemTools::ExpandListArgument(this->MocIncludesStr, incPaths);
@@ -377,9 +400,8 @@ bool cmQtAutomoc::RunAutomocQt4()
// key = moc source filepath, value = moc output filepath
std::map<std::string, std::string> includedMocs;
- // key = moc source filepath, value = moc output filename
- std::map<std::string, std::string> notIncludedMocs;
-
+ // collect all headers which may need to be mocced
+ std::set<std::string> headerFiles;
std::vector<std::string> sourceFiles;
cmSystemTools::ExpandListArgument(this->Sources, sourceFiles);
@@ -393,34 +415,22 @@ bool cmQtAutomoc::RunAutomocQt4()
{
std::cout << "AUTOMOC: Checking " << absFilename << std::endl;
}
- this->ParseCppFile(absFilename, includedMocs, notIncludedMocs);
+ this->ParseCppFile(absFilename, includedMocs, headerFiles);
}
- std::vector<std::string> headerFiles;
- cmSystemTools::ExpandListArgument(this->Headers, headerFiles);
- for (std::vector<std::string>::const_iterator it = headerFiles.begin();
- it != headerFiles.end();
+ std::vector<std::string> headerFilesVec;
+ cmSystemTools::ExpandListArgument(this->Headers, headerFilesVec);
+ for (std::vector<std::string>::const_iterator it = headerFilesVec.begin();
+ it != headerFilesVec.end();
++it)
{
- const std::string &absFilename = *it;
- if (this->Verbose)
- {
- std::cout << "AUTOMOC: Checking " << absFilename << std::endl;
- }
- if (includedMocs.find(absFilename) == includedMocs.end()
- && notIncludedMocs.find(absFilename) == notIncludedMocs.end())
- {
- // if this header is not getting processed yet and is explicitly
- // mentioned for the automoc the moc is run unconditionally on the
- // header and the resulting file is included in the _automoc.cpp file
- // (unless there's a .cpp file later on that includes the moc from
- // this header)
- const std::string currentMoc = "moc_" + cmsys::SystemTools::
- GetFilenameWithoutLastExtension(absFilename) + ".cpp";
- notIncludedMocs[absFilename] = currentMoc;
- }
+ headerFiles.insert(*it);
}
+ // key = moc source filepath, value = moc output filename
+ std::map<std::string, std::string> notIncludedMocs;
+ this->ParseHeaders(headerFiles, includedMocs, notIncludedMocs);
+
// run moc on all the moc's that are #included in source files
for(std::map<std::string, std::string>::const_iterator
it = includedMocs.begin();
@@ -487,12 +497,11 @@ bool cmQtAutomoc::RunAutomocQt4()
void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
std::map<std::string, std::string>& includedMocs,
- std::map<std::string, std::string>& notIncludedMocs)
+ std::set<std::string>& absHeaders)
{
cmsys::RegularExpression mocIncludeRegExp(
"[\n][ \t]*#[ \t]*include[ \t]+"
"[\"<](([^ \">]+/)?moc_[^ \">/]+\\.cpp|[^ \">]+\\.moc)[\">]");
- cmsys::RegularExpression qObjectRegExp("[\n][ \t]*Q_OBJECT[^a-zA-Z0-9_]");
std::list<std::string> headerExtensions;
headerExtensions.push_back(".h");
headerExtensions.push_back(".hpp");
@@ -520,52 +529,7 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/';
std::string::size_type matchOffset = 0;
- if (!mocIncludeRegExp.find(contentsString.c_str()))
- {
- // no moc #include, look whether we need to create a moc from
- // the .h nevertheless
- const std::string basename =
- cmsys::SystemTools::GetFilenameWithoutLastExtension(absFilename);
- for(std::list<std::string>::const_iterator ext = headerExtensions.begin();
- ext != headerExtensions.end();
- ++ext)
- {
- const std::string headername = absPath + basename + (*ext);
- if (cmsys::SystemTools::FileExists(headername.c_str())
- && includedMocs.find(headername) == includedMocs.end()
- && notIncludedMocs.find(headername) == notIncludedMocs.end())
- {
- const std::string currentMoc = "moc_" + basename + ".cpp";
- const std::string contents = this->ReadAll(headername);
- if (qObjectRegExp.find(contents))
- {
- //std::cout << "header contains Q_OBJECT macro";
- notIncludedMocs[headername] = currentMoc;
- }
- break;
- }
- }
- for(std::list<std::string>::const_iterator ext = headerExtensions.begin();
- ext != headerExtensions.end();
- ++ext)
- {
- const std::string privateHeaderName = absPath+basename+"_p"+(*ext);
- if (cmsys::SystemTools::FileExists(privateHeaderName.c_str())
- && includedMocs.find(privateHeaderName) == includedMocs.end()
- && notIncludedMocs.find(privateHeaderName) == notIncludedMocs.end())
- {
- const std::string currentMoc = "moc_" + basename + "_p.cpp";
- const std::string contents = this->ReadAll(privateHeaderName);
- if (qObjectRegExp.find(contents))
- {
- //std::cout << "header contains Q_OBJECT macro";
- notIncludedMocs[privateHeaderName] = currentMoc;
- }
- break;
- }
- }
- }
- else
+ if (mocIncludeRegExp.find(contentsString.c_str()))
{
// for every moc include in the file
do
@@ -581,17 +545,13 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
// the Q_OBJECT class declaration in a header file.
// If the moc include is of the foo.moc style we need to look for
// a Q_OBJECT macro in the current source file, if it contains the
- // macro we generate the moc file from the source file, else from the
- // header.
+ // macro we generate the moc file from the source file.
// Q_OBJECT
- if (moc_style || !qObjectRegExp.find(contentsString))
+ if (moc_style)
{
- if (moc_style)
- {
- // basename should be the part of the moc filename used for
- // finding the correct header, so we need to remove the moc_ part
- basename = basename.substr(4);
- }
+ // basename should be the part of the moc filename used for
+ // finding the correct header, so we need to remove the moc_ part
+ basename = basename.substr(4);
bool headerFound = false;
for(std::list<std::string>::const_iterator ext =
@@ -604,7 +564,6 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
{
headerFound = true;
includedMocs[sourceFilePath] = currentMoc;
- notIncludedMocs.erase(sourceFilePath);
break;
}
}
@@ -628,7 +587,6 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
{
headerFound = true;
includedMocs[sourceFilePath] = currentMoc;
- notIncludedMocs.erase(sourceFilePath);
break;
}
}
@@ -658,11 +616,71 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
else
{
includedMocs[absFilename] = currentMoc;
- notIncludedMocs.erase(absFilename);
}
matchOffset += mocIncludeRegExp.end();
} while(mocIncludeRegExp.find(contentsString.c_str() + matchOffset));
}
+
+ // search for header files and private header files we may need to moc:
+ const std::string basename =
+ cmsys::SystemTools::GetFilenameWithoutLastExtension(absFilename);
+ for(std::list<std::string>::const_iterator ext = headerExtensions.begin();
+ ext != headerExtensions.end();
+ ++ext)
+ {
+ const std::string headerName = absPath + basename + (*ext);
+ if (cmsys::SystemTools::FileExists(headerName.c_str()))
+ {
+ absHeaders.insert(headerName);
+ break;
+ }
+ }
+ for(std::list<std::string>::const_iterator ext = headerExtensions.begin();
+ ext != headerExtensions.end();
+ ++ext)
+ {
+ const std::string privateHeaderName = absPath+basename+"_p"+(*ext);
+ if (cmsys::SystemTools::FileExists(privateHeaderName.c_str()))
+ {
+ absHeaders.insert(privateHeaderName);
+ break;
+ }
+ }
+
+}
+
+
+void cmQtAutomoc::ParseHeaders(const std::set<std::string>& absHeaders,
+ const std::map<std::string, std::string>& includedMocs,
+ std::map<std::string, std::string>& notIncludedMocs)
+{
+ cmsys::RegularExpression qObjectRegExp("[\n][ \t]*Q_OBJECT[^a-zA-Z0-9_]");
+ for(std::set<std::string>::const_iterator hIt=absHeaders.begin();
+ hIt!=absHeaders.end();
+ ++hIt)
+ {
+ const std::string& headerName = *hIt;
+
+ if (includedMocs.find(headerName) == includedMocs.end())
+ {
+ if (this->Verbose)
+ {
+ std::cout << "AUTOMOC: Checking " << headerName << std::endl;
+ }
+
+ const std::string basename = cmsys::SystemTools::
+ GetFilenameWithoutLastExtension(headerName);
+
+ const std::string currentMoc = "moc_" + basename + ".cpp";
+ const std::string contents = this->ReadAll(headerName);
+ if (qObjectRegExp.find(contents))
+ {
+ //std::cout << "header contains Q_OBJECT macro";
+ notIncludedMocs[headerName] = currentMoc;
+ }
+ }
+ }
+
}
@@ -703,6 +721,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
diff --git a/Source/cmQtAutomoc.h b/Source/cmQtAutomoc.h
index 4fd9041..db53b21 100644
--- a/Source/cmQtAutomoc.h
+++ b/Source/cmQtAutomoc.h
@@ -1,3 +1,16 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2004-2011 Kitware, Inc.
+ Copyright 2011 Alexander Neundorf (neundorf@kde.org)
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
#ifndef cmQtAutomoc_h
#define cmQtAutomoc_h
@@ -27,6 +40,9 @@ private:
const std::string& mocFileName);
void ParseCppFile(const std::string& absFilename,
std::map<std::string, std::string>& includedMocs,
+ std::set<std::string>& absHeaders);
+ void ParseHeaders(const std::set<std::string>& absHeaders,
+ const std::map<std::string, std::string>& includedMocs,
std::map<std::string, std::string>& notIncludedMocs);
void Init();
@@ -46,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;
@@ -55,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;
diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h
index 320378d..f001a11 100644
--- a/Source/cmSetTargetPropertiesCommand.h
+++ b/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 "
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e74e70c..dad0353 100644
--- a/Source/cmTarget.cxx
+++ b/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,
@@ -642,6 +655,9 @@ void cmTarget::DefineProperties(cmake *cm)
"If the list is empty then no transitive link dependencies will be "
"incorporated when this target is linked into another target even if "
"the default set is non-empty. "
+ "This property is initialized by the value of the variable "
+ "CMAKE_LINK_INTERFACE_LIBRARIES if it is set when a target is "
+ "created. "
"This property is ignored for STATIC libraries.");
cm->DefineProperty
@@ -1008,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
@@ -1017,6 +1033,11 @@ void cmTarget::DefineProperties(cmake *cm)
"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.",
"Tell the Visual Studio generator to set the global variable "
@@ -1176,6 +1197,8 @@ 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.
std::vector<std::string> configNames;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index c51254a..d748c40 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/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);
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 05699da..d691f46 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2881,7 +2881,7 @@ int cmake::CheckBuildSystem()
return 1;
}
- // Find find the newest dependency.
+ // Find the newest dependency.
std::vector<std::string>::iterator dep = depends.begin();
std::string dep_newest = *dep++;
for(;dep != depends.end(); ++dep)
@@ -2907,7 +2907,7 @@ int cmake::CheckBuildSystem()
}
}
- // Find find the oldest output.
+ // Find the oldest output.
std::vector<std::string>::iterator out = outputs.begin();
std::string out_oldest = *out++;
for(;out != outputs.end(); ++out)
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 3937d8d..85cecea 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -68,6 +68,10 @@ static const char * cmDocumentationOptions[][3] =
{"-F", "Enable failover.", "This option allows ctest to resume a test "
"set execution that was previously interrupted. If no interruption "
"occurred, the -F option will have no effect."},
+ {"-j <jobs>, --parallel <jobs>", "Run the tests in parallel using the"
+ "given number of jobs.",
+ "This option tells ctest to run the tests in parallel using given "
+ "number of jobs."},
{"-Q,--quiet", "Make ctest quiet.",
"This option will suppress all the output. The output log file will "
"still be generated if the --output-log is specified. Options such "
@@ -180,8 +184,8 @@ static const char * cmDocumentationOptions[][3] =
{"--build-project", "Specify the name of the project to build.", "" },
{"--build-makeprogram", "Specify the make program to use.", "" },
{"--build-noclean", "Skip the make clean step.", "" },
- {"--build-config-sample",
- "A sample executable to use to determine the configuration",
+ {"--build-config-sample",
+ "A sample executable to use to determine the configuration",
"A sample executable to use to determine the configuration that "
"should be used. e.g. Debug/Release/etc" },
{"--build-options", "Add extra options to the build step.",
@@ -276,7 +280,7 @@ int main (int argc, char *argv[])
// If there is a testing input file, check for documentation options
// only if there are actually arguments. We want running without
// arguments to run tests.
- if(argc > 1 || !(cmSystemTools::FileExists("CTestTestfile.cmake") ||
+ if(argc > 1 || !(cmSystemTools::FileExists("CTestTestfile.cmake") ||
cmSystemTools::FileExists("DartTestfile.txt")))
{
if(argc == 1)
@@ -301,7 +305,7 @@ int main (int argc, char *argv[])
doc.SetSection("Name",cmDocumentationName);
doc.SetSection("Usage",cmDocumentationUsage);
doc.SetSection("Description",cmDocumentationDescription);
- doc.SetSection("Options",cmDocumentationOptions);
+ doc.PrependSection("Options",cmDocumentationOptions);
doc.SetSection("Commands",commands);
doc.SetSeeAlsoList(cmDocumentationSeeAlso);
#ifdef cout
diff --git a/Source/kwsys/CommandLineArguments.cxx b/Source/kwsys/CommandLineArguments.cxx
index 9f43a47..ece88ae 100644
--- a/Source/kwsys/CommandLineArguments.cxx
+++ b/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
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 9bc659e..d49c0d7 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/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";
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 695949a..ed7f62c 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -128,7 +128,7 @@ public:
#include <io.h>
#include <direct.h>
#define _unlink unlink
-#endif
+#endif
/* The maximum length of a file name. */
#if defined(PATH_MAX)
@@ -168,9 +168,9 @@ static inline char *realpath(const char *path, char *resolved_path)
snprintf(resolved_path, maxlen, "%s", path);
BPath normalized(resolved_path, NULL, true);
const char *resolved = normalized.Path();
- if (resolved != NULL) // NULL == No such file.
+ if (resolved != NULL) // NULL == No such file.
{
- if (snprintf(resolved_path, maxlen, "%s", resolved) < maxlen)
+ if (snprintf(resolved_path, maxlen, "%s", resolved) < maxlen)
{
return resolved_path;
}
@@ -179,7 +179,7 @@ static inline char *realpath(const char *path, char *resolved_path)
}
#endif
-#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__))
+#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__))
inline int Mkdir(const char* dir)
{
return _mkdir(dir);
@@ -300,7 +300,7 @@ double SystemTools::GetTime(void)
#endif
}
-class SystemToolsTranslationMap :
+class SystemToolsTranslationMap :
public kwsys_stl::map<kwsys_stl::string,kwsys_stl::string>
{
};
@@ -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:
@@ -388,7 +392,7 @@ kwsysDeletingCharVector::~kwsysDeletingCharVector()
#endif
}
bool SystemTools::PutEnv(const char* value)
-{
+{
static kwsysDeletingCharVector localEnvironment;
char* envVar = new char[strlen(value)+1];
strcpy(envVar, value);
@@ -399,14 +403,13 @@ bool SystemTools::PutEnv(const char* value)
return ret == 0;
}
-
const char* SystemTools::GetExecutableExtension()
{
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__VMS)
return ".exe";
#else
return "";
-#endif
+#endif
}
@@ -474,7 +477,7 @@ void SystemTools::ReplaceString(kwsys_stl::string& source,
{
const char *src = source.c_str();
char *searchPos = const_cast<char *>(strstr(src,replace));
-
+
// get out quick if string is not found
if (!searchPos)
{
@@ -491,7 +494,7 @@ void SystemTools::ReplaceString(kwsys_stl::string& source,
char *orig = strdup(src);
char *currentPos = orig;
searchPos = searchPos - src + orig;
-
+
// initialize the result
source.erase(source.begin(),source.end());
do
@@ -543,7 +546,7 @@ static DWORD SystemToolsMakeRegistryMode(DWORD mode,
#endif
// Read a registry value.
-// Example :
+// Example :
// HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.1\InstallPath
// => will return the data of the "default" value of the key
// HKEY_LOCAL_MACHINE\SOFTWARE\Scriptics\Tcl\8.4;Root
@@ -572,7 +575,7 @@ bool SystemTools::ReadRegistryValue(const char *key, kwsys_stl::string &value,
second = primary.substr(start+1, valuenamepos-start-1);
primary = primary.substr(0, start);
-
+
HKEY primaryKey = HKEY_CURRENT_USER;
if (primary == "HKEY_CURRENT_USER")
{
@@ -594,11 +597,11 @@ bool SystemTools::ReadRegistryValue(const char *key, kwsys_stl::string &value,
{
primaryKey = HKEY_USERS;
}
-
+
HKEY hKey;
- if(RegOpenKeyEx(primaryKey,
- second.c_str(),
- 0,
+ if(RegOpenKeyEx(primaryKey,
+ second.c_str(),
+ 0,
SystemToolsMakeRegistryMode(KEY_READ, view),
&hKey) != ERROR_SUCCESS)
{
@@ -609,11 +612,11 @@ bool SystemTools::ReadRegistryValue(const char *key, kwsys_stl::string &value,
DWORD dwType, dwSize;
dwSize = 1023;
char data[1024];
- if(RegQueryValueEx(hKey,
- (LPTSTR)valuename.c_str(),
- NULL,
- &dwType,
- (BYTE *)data,
+ if(RegQueryValueEx(hKey,
+ (LPTSTR)valuename.c_str(),
+ NULL,
+ &dwType,
+ (BYTE *)data,
&dwSize) == ERROR_SUCCESS)
{
if (dwType == REG_SZ)
@@ -648,7 +651,7 @@ bool SystemTools::ReadRegistryValue(const char *, kwsys_stl::string &,
// Write a registry value.
-// Example :
+// Example :
// HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.1\InstallPath
// => will set the data of the "default" value of the key
// HKEY_LOCAL_MACHINE\SOFTWARE\Scriptics\Tcl\8.4;Root
@@ -661,7 +664,7 @@ bool SystemTools::WriteRegistryValue(const char *key, const char *value,
kwsys_stl::string primary = key;
kwsys_stl::string second;
kwsys_stl::string valuename;
-
+
size_t start = primary.find("\\");
if (start == kwsys_stl::string::npos)
{
@@ -676,7 +679,7 @@ bool SystemTools::WriteRegistryValue(const char *key, const char *value,
second = primary.substr(start+1, valuenamepos-start-1);
primary = primary.substr(0, start);
-
+
HKEY primaryKey = HKEY_CURRENT_USER;
if (primary == "HKEY_CURRENT_USER")
{
@@ -698,13 +701,13 @@ bool SystemTools::WriteRegistryValue(const char *key, const char *value,
{
primaryKey = HKEY_USERS;
}
-
+
HKEY hKey;
DWORD dwDummy;
char lpClass[] = "";
- if(RegCreateKeyEx(primaryKey,
- second.c_str(),
- 0,
+ if(RegCreateKeyEx(primaryKey,
+ second.c_str(),
+ 0,
lpClass,
REG_OPTION_NON_VOLATILE,
SystemToolsMakeRegistryMode(KEY_WRITE, view),
@@ -715,11 +718,11 @@ bool SystemTools::WriteRegistryValue(const char *key, const char *value,
return false;
}
- if(RegSetValueEx(hKey,
- (LPTSTR)valuename.c_str(),
- 0,
- REG_SZ,
- (CONST BYTE *)value,
+ if(RegSetValueEx(hKey,
+ (LPTSTR)valuename.c_str(),
+ 0,
+ REG_SZ,
+ (CONST BYTE *)value,
(DWORD)(strlen(value) + 1)) == ERROR_SUCCESS)
{
return true;
@@ -734,7 +737,7 @@ bool SystemTools::WriteRegistryValue(const char *, const char *, KeyWOW64)
#endif
// Delete a registry value.
-// Example :
+// Example :
// HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.1\InstallPath
// => will delete the data of the "default" value of the key
// HKEY_LOCAL_MACHINE\SOFTWARE\Scriptics\Tcl\8.4;Root
@@ -746,7 +749,7 @@ bool SystemTools::DeleteRegistryValue(const char *key, KeyWOW64 view)
kwsys_stl::string primary = key;
kwsys_stl::string second;
kwsys_stl::string valuename;
-
+
size_t start = primary.find("\\");
if (start == kwsys_stl::string::npos)
{
@@ -761,7 +764,7 @@ bool SystemTools::DeleteRegistryValue(const char *key, KeyWOW64 view)
second = primary.substr(start+1, valuenamepos-start-1);
primary = primary.substr(0, start);
-
+
HKEY primaryKey = HKEY_CURRENT_USER;
if (primary == "HKEY_CURRENT_USER")
{
@@ -783,11 +786,11 @@ bool SystemTools::DeleteRegistryValue(const char *key, KeyWOW64 view)
{
primaryKey = HKEY_USERS;
}
-
+
HKEY hKey;
- if(RegOpenKeyEx(primaryKey,
- second.c_str(),
- 0,
+ if(RegOpenKeyEx(primaryKey,
+ second.c_str(),
+ 0,
SystemToolsMakeRegistryMode(KEY_WRITE, view),
&hKey) != ERROR_SUCCESS)
{
@@ -795,7 +798,7 @@ bool SystemTools::DeleteRegistryValue(const char *key, KeyWOW64 view)
}
else
{
- if(RegDeleteValue(hKey,
+ if(RegDeleteValue(hKey,
(LPTSTR)valuename.c_str()) == ERROR_SUCCESS)
{
RegCloseKey(hKey);
@@ -816,17 +819,17 @@ bool SystemTools::SameFile(const char* file1, const char* file2)
#ifdef _WIN32
HANDLE hFile1, hFile2;
- hFile1 = CreateFile( file1,
- GENERIC_READ,
+ hFile1 = CreateFile( file1,
+ GENERIC_READ,
FILE_SHARE_READ ,
NULL,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS,
NULL
);
- hFile2 = CreateFile( file2,
- GENERIC_READ,
- FILE_SHARE_READ,
+ hFile2 = CreateFile( file2,
+ GENERIC_READ,
+ FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS,
@@ -860,10 +863,10 @@ bool SystemTools::SameFile(const char* file1, const char* file2)
{
// see if the files are the same file
// check the device inode and size
- if(memcmp(&fileStat2.st_dev, &fileStat1.st_dev, sizeof(fileStat1.st_dev)) == 0 &&
+ if(memcmp(&fileStat2.st_dev, &fileStat1.st_dev, sizeof(fileStat1.st_dev)) == 0 &&
memcmp(&fileStat2.st_ino, &fileStat1.st_ino, sizeof(fileStat1.st_ino)) == 0 &&
- fileStat2.st_size == fileStat1.st_size
- )
+ fileStat2.st_size == fileStat1.st_size
+ )
{
return true;
}
@@ -1060,11 +1063,11 @@ kwsys_stl::string SystemTools::CapitalizedWords(const kwsys_stl::string& s)
#if defined(_MSC_VER) && defined (_MT) && defined (_DEBUG)
// MS has an assert that will fail if s[i] < 0; setting
// LC_CTYPE using setlocale() does *not* help. Painful.
- if ((int)s[i] >= 0 && isalpha(s[i]) &&
+ if ((int)s[i] >= 0 && isalpha(s[i]) &&
(i == 0 || ((int)s[i - 1] >= 0 && isspace(s[i - 1]))))
#else
if (isalpha(s[i]) && (i == 0 || isspace(s[i - 1])))
-#endif
+#endif
{
n[i] = static_cast<kwsys_stl::string::value_type>(toupper(s[i]));
}
@@ -1081,11 +1084,11 @@ kwsys_stl::string SystemTools::UnCapitalizedWords(const kwsys_stl::string& s)
#if defined(_MSC_VER) && defined (_MT) && defined (_DEBUG)
// MS has an assert that will fail if s[i] < 0; setting
// LC_CTYPE using setlocale() does *not* help. Painful.
- if ((int)s[i] >= 0 && isalpha(s[i]) &&
+ if ((int)s[i] >= 0 && isalpha(s[i]) &&
(i == 0 || ((int)s[i - 1] >= 0 && isspace(s[i - 1]))))
#else
if (isalpha(s[i]) && (i == 0 || isspace(s[i - 1])))
-#endif
+#endif
{
n[i] = static_cast<kwsys_stl::string::value_type>(tolower(s[i]));
}
@@ -1163,7 +1166,7 @@ char* SystemTools::AppendStrings(
return newstr;
}
-// Return a lower case string
+// Return a lower case string
kwsys_stl::string SystemTools::LowerCase(const kwsys_stl::string& s)
{
kwsys_stl::string n;
@@ -1175,7 +1178,7 @@ kwsys_stl::string SystemTools::LowerCase(const kwsys_stl::string& s)
return n;
}
-// Return a lower case string
+// Return a lower case string
kwsys_stl::string SystemTools::UpperCase(const kwsys_stl::string& s)
{
kwsys_stl::string n;
@@ -1305,7 +1308,7 @@ const char* SystemTools::FindLastString(const char* str1, const char* str2)
{
return NULL;
}
-
+
size_t len1 = strlen(str1), len2 = strlen(str2);
if (len1 >= len2)
{
@@ -1333,8 +1336,8 @@ char* SystemTools::DuplicateString(const char* str)
return NULL;
}
-// Return a cropped string
-kwsys_stl::string SystemTools::CropString(const kwsys_stl::string& s,
+// Return a cropped string
+kwsys_stl::string SystemTools::CropString(const kwsys_stl::string& s,
size_t max_len)
{
if (!s.size() || max_len == 0 || max_len >= s.size())
@@ -1378,7 +1381,7 @@ kwsys_stl::vector<kwsys::String> SystemTools::SplitString(const char* p, char se
if(isPath && path[0] == '/')
{
path.erase(path.begin());
- paths.push_back("/");
+ paths.push_back("/");
}
kwsys_stl::string::size_type pos1 = 0;
kwsys_stl::string::size_type pos2 = path.find(sep, pos1+1);
@@ -1387,9 +1390,9 @@ kwsys_stl::vector<kwsys::String> SystemTools::SplitString(const char* p, char se
paths.push_back(path.substr(pos1, pos2-pos1));
pos1 = pos2+1;
pos2 = path.find(sep, pos1+1);
- }
+ }
paths.push_back(path.substr(pos1, pos2-pos1));
-
+
return paths;
}
@@ -1403,11 +1406,11 @@ int SystemTools::EstimateFormatLength(const char *format, va_list ap)
// Quick-hack attempt at estimating the length of the string.
// Should never under-estimate.
-
+
// Start with the length of the format string itself.
size_t length = strlen(format);
-
+
// Increase the length for every argument in the format.
const char* cur = format;
@@ -1439,7 +1442,7 @@ int SystemTools::EstimateFormatLength(const char *format, va_list ap)
{
// Assume the argument contributes no more than 64 characters.
length += 64;
-
+
// Eat the argument.
static_cast<void>(va_arg(ap, double));
} break;
@@ -1447,24 +1450,24 @@ int SystemTools::EstimateFormatLength(const char *format, va_list ap)
{
// Assume the argument contributes no more than 64 characters.
length += 64;
-
+
// Eat the argument.
static_cast<void>(va_arg(ap, int));
} break;
}
}
-
+
// Move past the characters just tested.
++cur;
}
}
-
+
return static_cast<int>(length);
}
kwsys_stl::string SystemTools::EscapeChars(
- const char *str,
- const char *chars_to_escape,
+ const char *str,
+ const char *chars_to_escape,
char escape_char)
{
kwsys_stl::string n;
@@ -1521,7 +1524,7 @@ static void ConvertVMSToUnix(kwsys_stl::string& path)
}
#endif
-// convert windows slashes to unix slashes
+// convert windows slashes to unix slashes
void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
{
const char* pathCString = path.c_str();
@@ -1588,7 +1591,7 @@ void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
}
}
#endif
- // remove trailing slash if the path is more than
+ // remove trailing slash if the path is more than
// a single /
pathCString = path.c_str();
if(path.size() > 1 && *(pathCString+(path.size()-1)) == '/')
@@ -1606,7 +1609,7 @@ void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
kwsys_stl::string SystemTools::ConvertToUnixOutputPath(const char* path)
{
kwsys_stl::string ret = path;
-
+
// remove // except at the beginning might be a cygwin drive
kwsys_stl::string::size_type pos=1;
while((pos = ret.find("//", pos)) != kwsys_stl::string::npos)
@@ -1644,7 +1647,7 @@ kwsys_stl::string SystemTools::ConvertToOutputPath(const char* path)
// remove double slashes not at the start
kwsys_stl::string SystemTools::ConvertToWindowsOutputPath(const char* path)
-{
+{
kwsys_stl::string ret;
// make it big enough for all of path and double quotes
ret.reserve(strlen(path)+3);
@@ -1730,13 +1733,13 @@ bool SystemTools::FilesDiffer(const char* source,
const char* destination)
{
struct stat statSource;
- if (stat(source, &statSource) != 0)
+ if (stat(source, &statSource) != 0)
{
return true;
}
struct stat statDestination;
- if (stat(destination, &statDestination) != 0)
+ if (stat(destination, &statDestination) != 0)
{
return true;
}
@@ -1782,7 +1785,7 @@ bool SystemTools::FilesDiffer(const char* source,
{
return true;
}
-
+
// If this block differs the file differs.
if(memcmp(static_cast<const void*>(source_buf),
static_cast<const void*>(dest_buf),
@@ -1841,7 +1844,7 @@ bool SystemTools::CopyFileAlways(const char* source, const char* destination)
// Open files
#if defined(_WIN32) || defined(__CYGWIN__)
- kwsys_ios::ifstream fin(source,
+ kwsys_ios::ifstream fin(source,
kwsys_ios::ios::binary | kwsys_ios::ios::in);
#else
kwsys_ios::ifstream fin(source);
@@ -1850,7 +1853,7 @@ bool SystemTools::CopyFileAlways(const char* source, const char* destination)
{
return false;
}
-
+
// try and remove the destination file so that read only destination files
// can be written to.
// If the remove fails continue so that files in read only directories
@@ -1858,17 +1861,17 @@ bool SystemTools::CopyFileAlways(const char* source, const char* destination)
SystemTools::RemoveFile(destination);
#if defined(_WIN32) || defined(__CYGWIN__)
- kwsys_ios::ofstream fout(destination,
+ kwsys_ios::ofstream fout(destination,
kwsys_ios::ios::binary | kwsys_ios::ios::out | kwsys_ios::ios::trunc);
#else
- kwsys_ios::ofstream fout(destination,
+ kwsys_ios::ofstream fout(destination,
kwsys_ios::ios::out | kwsys_ios::ios::trunc);
#endif
if(!fout)
{
return false;
}
-
+
// This copy loop is very sensitive on certain platforms with
// slightly broken stream libraries (like HPUX). Normally, it is
// incorrect to not check the error condition on the fin.read()
@@ -1882,12 +1885,12 @@ bool SystemTools::CopyFileAlways(const char* source, const char* destination)
fout.write(buffer, fin.gcount());
}
}
-
+
// Make sure the operating system has finished writing the file
// before closing it. This will ensure the file is finished before
// the check below.
fout.flush();
-
+
fin.close();
fout.close();
@@ -1971,7 +1974,7 @@ bool SystemTools::CopyADirectory(const char* source, const char* destination,
unsigned long SystemTools::FileLength(const char* filename)
{
struct stat fs;
- if (stat(filename, &fs) != 0)
+ if (stat(filename, &fs) != 0)
{
return 0;
}
@@ -2217,7 +2220,7 @@ kwsys_stl::string SystemTools
{
// Add the system search path to our path first
kwsys_stl::vector<kwsys_stl::string> path;
- if (!no_system_path)
+ if (!no_system_path)
{
SystemTools::GetPath(path, "CMAKE_FILE_PATH");
SystemTools::GetPath(path);
@@ -2332,7 +2335,7 @@ kwsys_stl::string SystemTools::FindProgram(
// first try with extensions if the os supports them
if(extensions.size())
{
- for(kwsys_stl::vector<kwsys_stl::string>::iterator i =
+ for(kwsys_stl::vector<kwsys_stl::string>::iterator i =
extensions.begin(); i != extensions.end(); ++i)
{
tryPath = name;
@@ -2360,7 +2363,7 @@ kwsys_stl::string SystemTools::FindProgram(
}
// now add the additional paths
{
- for(kwsys_stl::vector<kwsys_stl::string>::const_iterator i =
+ for(kwsys_stl::vector<kwsys_stl::string>::const_iterator i =
userPaths.begin(); i != userPaths.end(); ++i)
{
path.push_back(*i);
@@ -2389,7 +2392,7 @@ kwsys_stl::string SystemTools::FindProgram(
// first try with extensions
if(extensions.size())
{
- for(kwsys_stl::vector<kwsys_stl::string>::iterator ext
+ for(kwsys_stl::vector<kwsys_stl::string>::iterator ext
= extensions.begin(); ext != extensions.end(); ++ext)
{
tryPath = *p;
@@ -2954,7 +2957,7 @@ kwsys_stl::string SystemTools::RelativePath(const char* local, const char* remot
}
// split up both paths into arrays of strings using / as a separator
- kwsys_stl::vector<kwsys::String> localSplit = SystemTools::SplitString(local, '/', true);
+ kwsys_stl::vector<kwsys::String> localSplit = SystemTools::SplitString(local, '/', true);
kwsys_stl::vector<kwsys::String> remoteSplit = SystemTools::SplitString(remote, '/', true);
kwsys_stl::vector<kwsys::String> commonPath; // store shared parts of path in this array
kwsys_stl::vector<kwsys::String> finalPath; // store the final relative path here
@@ -3011,7 +3014,7 @@ kwsys_stl::string SystemTools::RelativePath(const char* local, const char* remot
}
}
kwsys_stl::string relativePath; // result string
- // now turn the array of directories into a unix path by puttint /
+ // now turn the array of directories into a unix path by puttint /
// between each entry that does not already have one
for(kwsys_stl::vector<String>::iterator vit1 = finalPath.begin();
vit1 != finalPath.end(); ++vit1)
@@ -3388,7 +3391,7 @@ kwsys_stl::string SystemTools::GetFilenamePath(const kwsys_stl::string& filename
{
kwsys_stl::string fn = filename;
SystemTools::ConvertToUnixSlashes(fn);
-
+
kwsys_stl::string::size_type slash_pos = fn.rfind("/");
if(slash_pos != kwsys_stl::string::npos)
{
@@ -3507,7 +3510,7 @@ SystemTools::GetFilenameWithoutLastExtension(const kwsys_stl::string& filename)
}
bool SystemTools::FileHasSignature(const char *filename,
- const char *signature,
+ const char *signature,
long offset)
{
if (!filename || !signature)
@@ -3539,9 +3542,9 @@ bool SystemTools::FileHasSignature(const char *filename,
return res;
}
-SystemTools::FileTypeEnum
+SystemTools::FileTypeEnum
SystemTools::DetectFileType(const char *filename,
- unsigned long length,
+ unsigned long length,
double percent_bin)
{
if (!filename || percent_bin < 0)
@@ -3569,13 +3572,13 @@ SystemTools::DetectFileType(const char *filename,
// Loop over contents and count
size_t text_count = 0;
-
+
const unsigned char *ptr = buffer;
const unsigned char *buffer_end = buffer + read_length;
while (ptr != buffer_end)
{
- if ((*ptr >= 0x20 && *ptr <= 0x7F) ||
+ if ((*ptr >= 0x20 && *ptr <= 0x7F) ||
*ptr == '\n' ||
*ptr == '\r' ||
*ptr == '\t')
@@ -3587,7 +3590,7 @@ SystemTools::DetectFileType(const char *filename,
delete [] buffer;
- double current_percent_bin =
+ double current_percent_bin =
(static_cast<double>(read_length - text_count) /
static_cast<double>(read_length));
@@ -3599,8 +3602,8 @@ SystemTools::DetectFileType(const char *filename,
return SystemTools::FileTypeText;
}
-bool SystemTools::LocateFileInDir(const char *filename,
- const char *dir,
+bool SystemTools::LocateFileInDir(const char *filename,
+ const char *dir,
kwsys_stl::string& filename_found,
int try_filename_dirs)
{
@@ -3613,7 +3616,7 @@ bool SystemTools::LocateFileInDir(const char *filename,
kwsys_stl::string filename_base = SystemTools::GetFilenameName(filename);
- // Check if 'dir' is really a directory
+ // Check if 'dir' is really a directory
// If win32 and matches something like C:, accept it as a dir
kwsys_stl::string real_dir;
@@ -3637,7 +3640,7 @@ bool SystemTools::LocateFileInDir(const char *filename,
if (filename_base.size() && dir)
{
size_t dir_len = strlen(dir);
- int need_slash =
+ int need_slash =
(dir_len && dir[dir_len - 1] != '/' && dir[dir_len - 1] != '\\');
kwsys_stl::string temp = dir;
@@ -3668,7 +3671,7 @@ bool SystemTools::LocateFileInDir(const char *filename,
filename_dir = SystemTools::GetFilenamePath(filename_dir);
filename_dir_base = SystemTools::GetFilenameName(filename_dir);
#if defined( _WIN32 )
- if (!filename_dir_base.size() ||
+ if (!filename_dir_base.size() ||
filename_dir_base[filename_dir_base.size() - 1] == ':')
#else
if (!filename_dir_base.size())
@@ -3692,7 +3695,7 @@ bool SystemTools::LocateFileInDir(const char *filename,
} while (!res && filename_dir_base.size());
}
}
-
+
return res;
}
@@ -3738,12 +3741,12 @@ bool SystemTools::FileIsFullPath(const char* in_name)
bool SystemTools::GetShortPath(const char* path, kwsys_stl::string& shortPath)
{
-#if defined(WIN32) && !defined(__CYGWIN__)
+#if defined(WIN32) && !defined(__CYGWIN__)
const int size = int(strlen(path)) +1; // size of return
char *buffer = new char[size]; // create a buffer
char *tempPath = new char[size]; // create a buffer
int ret;
-
+
// if the path passed in has quotes around it, first remove the quotes
if (path[0] == '"' && path[strlen(path)-1] == '"')
{
@@ -3754,7 +3757,7 @@ bool SystemTools::GetShortPath(const char* path, kwsys_stl::string& shortPath)
{
strcpy(tempPath,path);
}
-
+
buffer[0] = 0;
ret = GetShortPathName(tempPath, buffer, size);
@@ -3777,7 +3780,7 @@ bool SystemTools::GetShortPath(const char* path, kwsys_stl::string& shortPath)
#endif
}
-void SystemTools::SplitProgramFromArgs(const char* path,
+void SystemTools::SplitProgramFromArgs(const char* path,
kwsys_stl::string& program, kwsys_stl::string& args)
{
// see if this is a full path to a program
@@ -3789,7 +3792,7 @@ void SystemTools::SplitProgramFromArgs(const char* path,
return;
}
// Try to find the program in the path, note the program
- // may have spaces in its name so we have to look for it
+ // may have spaces in its name so we have to look for it
kwsys_stl::vector<kwsys_stl::string> e;
kwsys_stl::string findProg = SystemTools::FindProgram(path, e);
if(findProg.size())
@@ -3820,7 +3823,7 @@ void SystemTools::SplitProgramFromArgs(const char* path,
args = dir.substr(spacePos, dir.size()-spacePos);
return;
}
- // Now try and find the the program in the path
+ // Now try and find the the program in the path
findProg = SystemTools::FindProgram(tryProg.c_str(), e);
if(findProg.size())
{
@@ -4195,23 +4198,23 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
if (!bOsVersionInfoEx)
{
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- if (!GetVersionEx((OSVERSIONINFO *)&osvi))
+ if (!GetVersionEx((OSVERSIONINFO *)&osvi))
{
return 0;
}
}
-
+
switch (osvi.dwPlatformId)
{
// Test for the Windows NT product family.
case VER_PLATFORM_WIN32_NT:
-
+
// Test for the specific product family.
if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)
{
-#if (_MSC_VER >= 1300)
+#if (_MSC_VER >= 1300)
if (osvi.wProductType == VER_NT_WORKSTATION)
{
res += "Microsoft Windows Vista";
@@ -4251,7 +4254,7 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
{
// Test for the workstation type.
-#if (_MSC_VER >= 1300)
+#if (_MSC_VER >= 1300)
if (osvi.wProductType == VER_NT_WORKSTATION)
{
if (osvi.dwMajorVersion == 4)
@@ -4270,7 +4273,7 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
}
}
}
-
+
// Test for the server type.
else if (osvi.wProductType == VER_NT_SERVER)
@@ -4294,7 +4297,7 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
res += " Standard Edition";
}
}
-
+
else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0)
{
if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
@@ -4311,7 +4314,7 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
}
}
- else if (osvi.dwMajorVersion <= 4) // Windows NT 4.0
+ else if (osvi.dwMajorVersion <= 4) // Windows NT 4.0
{
if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
{
@@ -4328,7 +4331,7 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
// Test for specific product on Windows NT 4.0 SP5 and earlier
- else
+ else
{
HKEY hKey;
#define BUFSIZE 80
@@ -4378,7 +4381,7 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
// Display service pack (if any) and build number.
- if (osvi.dwMajorVersion == 4 &&
+ if (osvi.dwMajorVersion == 4 &&
lstrcmpi(osvi.szCSDVersion, "Service Pack 6") == 0)
{
HKEY hKey;
@@ -4407,7 +4410,7 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
res += buffer;
res += ")";
}
-
+
RegCloseKey(hKey);
}
else // Windows NT 3.51 and earlier or Windows 2000 and later
@@ -4447,11 +4450,11 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)
{
res += "Microsoft Windows Millennium Edition";
- }
+ }
break;
case VER_PLATFORM_WIN32s:
-
+
res += "Microsoft Win32s";
break;
}
@@ -4461,7 +4464,7 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
}
// ----------------------------------------------------------------------
-bool SystemTools::ParseURLProtocol( const kwsys_stl::string& URL,
+bool SystemTools::ParseURLProtocol( const kwsys_stl::string& URL,
kwsys_stl::string& protocol,
kwsys_stl::string& dataglom )
{
@@ -4479,12 +4482,12 @@ bool SystemTools::ParseURLProtocol( const kwsys_stl::string& URL,
}
// ----------------------------------------------------------------------
-bool SystemTools::ParseURL( const kwsys_stl::string& URL,
+bool SystemTools::ParseURL( const kwsys_stl::string& URL,
kwsys_stl::string& protocol,
- kwsys_stl::string& username,
- kwsys_stl::string& password,
- kwsys_stl::string& hostname,
- kwsys_stl::string& dataport,
+ kwsys_stl::string& username,
+ kwsys_stl::string& password,
+ kwsys_stl::string& hostname,
+ kwsys_stl::string& dataport,
kwsys_stl::string& database )
{
kwsys::RegularExpression urlRe( VTK_URL_REGEX );
@@ -4507,7 +4510,7 @@ bool SystemTools::ParseURL( const kwsys_stl::string& URL,
hostname = urlRe.match( 6 );
dataport = urlRe.match( 8 );
database = urlRe.match( 9 );
-
+
return true;
}
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index 60a30d5..9e6a6d8 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/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 24)
+SET(KWSYS_DATE_STAMP_DAY 14)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index cfc59be..28c6261 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1586,6 +1586,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.
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
index d82943f..9444a14 100644
--- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
+++ b/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")
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in
index 1e1a410..2d251b3 100644
--- a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in
+++ b/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")
diff --git a/Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt b/Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt
new file mode 100644
index 0000000..3c53e66
--- /dev/null
+++ b/Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(CTestTestConfigFileInBuildDir)
+include(CTest)
diff --git a/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake b/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake
new file mode 100644
index 0000000..d2c28f9
--- /dev/null
+++ b/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)
diff --git a/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in
new file mode 100644
index 0000000..498cab2
--- /dev/null
+++ b/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)
diff --git a/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in
new file mode 100644
index 0000000..d359f2d
--- /dev/null
+++ b/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)
diff --git a/Tests/CTestUpdateSVN.cmake.in b/Tests/CTestUpdateSVN.cmake.in
index 97b2a07..edafb4ef 100644
--- a/Tests/CTestUpdateSVN.cmake.in
+++ b/Tests/CTestUpdateSVN.cmake.in
@@ -23,6 +23,16 @@ file(MAKE_DIRECTORY ${TOP}/config)
set(SVNCMD ${SVN} --config-dir ${TOP}/config)
set(SVNUSER --username "test author" --non-interactive)
+# Configure for this svn version.
+execute_process(
+ COMMAND ${SVN} help add OUTPUT_VARIABLE help_add ERROR_VARIABLE help_add
+ )
+if("${help_add}" MATCHES "--depth")
+ set(depth_empty "--depth=empty")
+else()
+ set(depth_empty "")
+endif()
+
#-----------------------------------------------------------------------------
# Initialize the testing directory.
message("Creating test directory...")
@@ -63,7 +73,7 @@ update_content(user-source files_added files_removed dirs_added)
if(dirs_added)
run_child(
WORKING_DIRECTORY ${TOP}/user-source
- COMMAND ${SVNCMD} add ${dirs_added}
+ COMMAND ${SVNCMD} add ${depth_empty} ${dirs_added}
)
endif(dirs_added)
run_child(
diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt
index 4a5ff10..01f6bea 100644
--- a/Tests/QtAutomoc/CMakeLists.txt
+++ b/Tests/QtAutomoc/CMakeLists.txt
@@ -13,7 +13,7 @@ add_definitions(-DFOO)
# create an executable and a library target, both requiring automoc:
add_library(codeeditorLib STATIC codeeditor.cpp)
-add_executable(foo main.cpp calwidget.cpp )
+add_executable(foo main.cpp calwidget.cpp foo.cpp)
set_target_properties(foo codeeditorLib PROPERTIES AUTOMOC TRUE)
diff --git a/Tests/QtAutomoc/foo.cpp b/Tests/QtAutomoc/foo.cpp
new file mode 100644
index 0000000..699ba09
--- /dev/null
+++ b/Tests/QtAutomoc/foo.cpp
@@ -0,0 +1,39 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2004-2011 Kitware, Inc.
+ Copyright 2011 Alexander Neundorf (neundorf@kde.org)
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#include "foo.h"
+
+#include <stdio.h>
+
+class FooFoo : public QObject
+{
+ Q_OBJECT
+ public:
+ FooFoo():QObject() {}
+ public slots:
+ int getValue() const { return 12; }
+};
+
+Foo::Foo()
+:QObject()
+{
+}
+
+
+void Foo::doFoo()
+{
+ FooFoo ff;
+ printf("Hello automoc: %d\n", ff.getValue());
+}
+
+#include "foo.moc"
diff --git a/Tests/QtAutomoc/foo.h b/Tests/QtAutomoc/foo.h
new file mode 100644
index 0000000..32d4c8d
--- /dev/null
+++ b/Tests/QtAutomoc/foo.h
@@ -0,0 +1,28 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2004-2011 Kitware, Inc.
+ Copyright 2011 Alexander Neundorf (neundorf@kde.org)
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#ifndef FOO_H
+#define FOO_H
+
+#include <QObject>
+
+class Foo : public QObject
+{
+ Q_OBJECT
+ public:
+ Foo();
+ public slots:
+ void doFoo();
+};
+
+#endif
diff --git a/Tests/QtAutomoc/main.cpp b/Tests/QtAutomoc/main.cpp
index 7bf4a5d..b7cfb41 100644
--- a/Tests/QtAutomoc/main.cpp
+++ b/Tests/QtAutomoc/main.cpp
@@ -42,6 +42,7 @@
#include "codeeditor.h"
#include "calwidget.h"
+#include "foo.h"
int main(int argv, char **args)
{
@@ -54,5 +55,8 @@ int main(int argv, char **args)
Window w;
w.show();
+ Foo foo;
+ foo.doFoo();
+
return app.exec();
}
diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt
index 5d076e0..2430391 100644
--- a/Utilities/Doxygen/CMakeLists.txt
+++ b/Utilities/Doxygen/CMakeLists.txt
@@ -17,8 +17,6 @@ INCLUDE (${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
IF (BUILD_DOCUMENTATION)
- INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
-
#
# Configure the script and the doxyfile, then add target
#
diff --git a/Utilities/Doxygen/doxyfile.in b/Utilities/Doxygen/doxyfile.in
index c3d3a38..9743af7 100644
--- a/Utilities/Doxygen/doxyfile.in
+++ b/Utilities/Doxygen/doxyfile.in
@@ -28,6 +28,8 @@ INCLUDED_BY_GRAPH = YES
CLASS_DIAGRAMS = YES
GENERATE_LEGEND = YES
GRAPHICAL_HIERARCHY = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
ALLEXTERNALS = NO
@@ -61,7 +63,7 @@ SORT_MEMBER_DOCS = NO
DISTRIBUTE_GROUP_DOC = YES
TAB_SIZE = 3
-FILE_PATTERNS = *.h *.hxx
+FILE_PATTERNS = *.h *.hxx *.cxx
RECURSIVE = NO
EXCLUDE_PATTERNS =
diff --git a/Utilities/Git/commit-msg b/Utilities/Git/commit-msg
new file mode 100755
index 0000000..9a5d1c1
--- /dev/null
+++ b/Utilities/Git/commit-msg
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+#=============================================================================
+# CMake - Cross Platform Makefile Generator
+# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+die() {
+ echo 'commit-msg hook failure' 1>&2
+ echo '-----------------------' 1>&2
+ echo '' 1>&2
+ echo "$@" 1>&2
+ exit 1
+}
+
+# This is a placeholder for future commit-msg checks.
+exit 0
diff --git a/Utilities/Git/pre-commit b/Utilities/Git/pre-commit
new file mode 100755
index 0000000..110e9ee
--- /dev/null
+++ b/Utilities/Git/pre-commit
@@ -0,0 +1,47 @@
+#!/usr/bin/env bash
+#=============================================================================
+# CMake - Cross Platform Makefile Generator
+# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+die() {
+ echo 'pre-commit hook failure' 1>&2
+ echo '-----------------------' 1>&2
+ echo '' 1>&2
+ echo "$@" 1>&2
+ exit 1
+}
+
+if test -z "$HOOKS_ALLOW_KWSYS"; then
+ # Disallow changes to KWSys
+ files=$(git diff-index --name-only --cached HEAD -- Source/kwsys) &&
+ if test -n "$files"; then
+ die 'Changes to KWSys files
+
+'"$(echo "$files" | sed 's/^/ /')"'
+
+cannot be committed through Git. KWSys is kept in a CVS repository
+shared by several projects. A robot replays changes committed there
+into the Source/kwsys directory in CMake. Please send changes to
+this directory separately. Run
+
+ git reset HEAD -- Source/kwsys
+
+to unstage these changes and then
+
+ git diff -- Source/kwsys > kwsys.patch
+
+to construct the patch. Alternatively, set environment variable
+
+ HOOKS_ALLOW_KWSYS=1
+
+to disable this check and commit the changes locally.'
+ fi
+fi
diff --git a/Utilities/Git/prepare-commit-msg b/Utilities/Git/prepare-commit-msg
new file mode 100755
index 0000000..1517bb2
--- /dev/null
+++ b/Utilities/Git/prepare-commit-msg
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+#=============================================================================
+# CMake - Cross Platform Makefile Generator
+# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+# This is a placeholder for future prepare-commit-msg hooks.
+exit 0