summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
-rw-r--r--Docs/CMakeLists.txt4
-rw-r--r--Docs/bash-completion/CMakeLists.txt8
-rw-r--r--Docs/bash-completion/cmake149
-rw-r--r--Docs/bash-completion/cpack61
-rw-r--r--Docs/bash-completion/ctest81
-rw-r--r--Docs/cmake-completion207
-rw-r--r--Modules/CPack.cmake5
-rw-r--r--Modules/CPackNSIS.cmake22
-rw-r--r--Modules/CheckCCompilerFlag.cmake4
-rw-r--r--Modules/CheckCXXCompilerFlag.cmake4
-rw-r--r--Modules/ExternalProject.cmake3
-rw-r--r--Modules/FindPkgConfig.cmake8
-rw-r--r--Modules/FindPythonLibs.cmake15
-rw-r--r--Modules/NSIS.template.in23
-rw-r--r--Modules/Platform/Windows-Intel-CXX.cmake2
-rw-r--r--Modules/UseJava.cmake2
-rw-r--r--Source/CMakeLists.txt12
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx15
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx30
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx2
-rw-r--r--Source/cmCoreTryCompile.cxx1
-rw-r--r--Source/cmDocumentationFormatterHTML.cxx10
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx46
-rw-r--r--Source/cmExtraCodeBlocksGenerator.h2
-rw-r--r--Source/cmFileCommand.cxx2
-rw-r--r--Source/cmFindPackageCommand.cxx29
-rw-r--r--Source/cmGlobalGenerator.cxx15
-rw-r--r--Source/cmGlobalGenerator.h3
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx18
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h4
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx14
-rw-r--r--Source/cmGlobalVisualStudio71Generator.h4
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx28
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h4
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx25
-rw-r--r--Source/cmGlobalVisualStudio8Generator.h3
-rw-r--r--Source/cmIncludeExternalMSProjectCommand.cxx67
-rw-r--r--Source/cmIncludeExternalMSProjectCommand.h12
-rw-r--r--Source/cmListCommand.cxx15
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx8
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx2
-rw-r--r--Source/cmMakefile.cxx50
-rw-r--r--Source/cmMakefile.h30
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx33
-rw-r--r--Source/cmNinjaNormalTargetGenerator.h3
-rw-r--r--Source/cmSystemTools.cxx3
-rw-r--r--Source/cmTargetLinkLibrariesCommand.h3
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx5
-rw-r--r--Source/kwsys/CMakeLists.txt3
-rw-r--r--Source/kwsys/DateStamp.h.in42
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake21
-rwxr-xr-xSource/kwsys/kwsysDateStamp.py54
-rw-r--r--Tests/CMakeOnly/AllFindModules/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMakeLists.txt16
-rw-r--r--Tests/RunCMake/RunCMake.cmake17
-rw-r--r--Tests/RunCMake/include_external_msproject/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake1
-rw-r--r--Tests/RunCMake/include_external_msproject/CustomGuid.cmake2
-rw-r--r--Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake1
-rw-r--r--Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform.cmake5
-rw-r--r--Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake1
-rw-r--r--Tests/RunCMake/include_external_msproject/CustomTypePlatform.cmake3
-rw-r--r--Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/include_external_msproject/check_utils.cmake109
-rw-r--r--Tests/RunCMake/include_external_msproject/main.cpp3
-rw-r--r--Tests/RunCMake/list/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/list/EmptyGet0-result.txt1
-rw-r--r--Tests/RunCMake/list/EmptyGet0-stderr.txt4
-rw-r--r--Tests/RunCMake/list/EmptyGet0.cmake2
-rw-r--r--Tests/RunCMake/list/EmptyInsert-1-result.txt1
-rw-r--r--Tests/RunCMake/list/EmptyInsert-1-stderr.txt4
-rw-r--r--Tests/RunCMake/list/EmptyInsert-1.cmake2
-rw-r--r--Tests/RunCMake/list/EmptyRemoveAt0-result.txt1
-rw-r--r--Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt4
-rw-r--r--Tests/RunCMake/list/EmptyRemoveAt0.cmake2
-rw-r--r--Tests/RunCMake/list/RunCMakeTest.cmake5
-rwxr-xr-xUtilities/GitSetup/setup-stage46
-rw-r--r--Utilities/cmlibarchive/CMakeLists.txt2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_endian.h3
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c10
82 files changed, 1005 insertions, 483 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b1d5930..8522cad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
#=============================================================================
# CMake - Cross Platform Makefile Generator
-# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
+# Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2 FATAL_ERROR)
SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
PROJECT(CMake)
@@ -324,10 +324,9 @@ MACRO (CMAKE_BUILD_UTILITIES)
#---------------------------------------------------------------------
# Build or use system libarchive for CMake and CTest.
IF(CMAKE_USE_SYSTEM_LIBARCHIVE)
- IF(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake)
+ IF(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) # added in 2.8.3
FIND_PACKAGE(LibArchive)
ELSE()
- CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
INCLUDE(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake)
ENDIF()
IF(NOT LibArchive_FOUND)
@@ -620,6 +619,9 @@ INSTALL(
WORLD_READ WORLD_EXECUTE
)
+# process docs related install
+ADD_SUBDIRECTORY(Docs)
+
#-----------------------------------------------------------------------
# End of the main section of the CMakeLists file
#-----------------------------------------------------------------------
diff --git a/Docs/CMakeLists.txt b/Docs/CMakeLists.txt
new file mode 100644
index 0000000..b04b32d
--- /dev/null
+++ b/Docs/CMakeLists.txt
@@ -0,0 +1,4 @@
+string(REGEX REPLACE "^/(.*)" "\\1" REL_CMAKE_DATA_DIR "${CMAKE_DATA_DIR}")
+install(FILES cmake-help.vim cmake-indent.vim cmake-syntax.vim DESTINATION ${REL_CMAKE_DATA_DIR}/editors/vim)
+install(FILES cmake-mode.el DESTINATION ${REL_CMAKE_DATA_DIR}/editors/emacs)
+ADD_SUBDIRECTORY (bash-completion)
diff --git a/Docs/bash-completion/CMakeLists.txt b/Docs/bash-completion/CMakeLists.txt
new file mode 100644
index 0000000..592b71e
--- /dev/null
+++ b/Docs/bash-completion/CMakeLists.txt
@@ -0,0 +1,8 @@
+# Always install completion file in local dir
+# in order to be sure to always be able to install
+# in a local user directory rooted in a single directory.
+# packager should either patch that out or
+# add symlinks to the files in appropriate places
+# /etc/bash_completion.d/
+# DATADIR/completions (may be /usr/share/<package>/completions
+install(FILES cmake cpack ctest DESTINATION ${REL_CMAKE_DATA_DIR}/completions)
diff --git a/Docs/bash-completion/cmake b/Docs/bash-completion/cmake
new file mode 100644
index 0000000..59b565a
--- /dev/null
+++ b/Docs/bash-completion/cmake
@@ -0,0 +1,149 @@
+# bash completion for cmake(1) -*- shell-script -*-
+
+_cmake()
+{
+ local cur prev words cword split=false
+ _init_completion -n := || return
+
+ # Workaround for options like -DCMAKE_BUILD_TYPE=Release
+ local prefix=
+ if [[ $cur == -D* ]]; then
+ prev=-D
+ prefix=-D
+ cur="${cur#-D}"
+ elif [[ $cur == -U* ]]; then
+ prev=-U
+ prefix=-U
+ cur="${cur#-U}"
+ fi
+
+ case "$prev" in
+ -D)
+ if [[ $cur == *=* ]]; then
+ # complete values for variables
+ local var type value
+ var="${cur%%[:=]*}"
+ value="${cur#*=}"
+
+ if [[ $cur == CMAKE_BUILD_TYPE* ]]; then # most widely used case
+ COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo
+ MinSizeRel' -- "$value" ) )
+ return
+ fi
+
+ if [[ $cur == *:* ]]; then
+ type="${cur#*:}"
+ type="${type%%=*}"
+ else # get type from cache if it's not set explicitly
+ type=$( cmake -LA -N 2>/dev/null | grep "$var:" \
+ 2>/dev/null )
+ type="${type#*:}"
+ type="${type%%=*}"
+ fi
+ case "$type" in
+ FILEPATH)
+ cur="$value"
+ _filedir
+ return
+ ;;
+ PATH)
+ cur="$value"
+ _filedir -d
+ return
+ ;;
+ BOOL)
+ COMPREPLY=( $( compgen -W 'ON OFF TRUE FALSE' -- \
+ "$value" ) )
+ return
+ ;;
+ STRING|INTERNAL)
+ # no completion available
+ return
+ ;;
+ esac
+ elif [[ $cur == *:* ]]; then
+ # complete types
+ local type="${cur#*:}"
+ COMPREPLY=( $( compgen -W 'FILEPATH PATH STRING BOOL INTERNAL'\
+ -S = -- "$type" ) )
+ compopt -o nospace
+ else
+ # complete variable names
+ COMPREPLY=( $( compgen -W '$( cmake -LA -N | tail -n +2 |
+ cut -f1 -d: )' -P "$prefix" -- "$cur" ) )
+ compopt -o nospace
+ fi
+ return
+ ;;
+ -U)
+ COMPREPLY=( $( compgen -W '$( cmake -LA -N | tail -n +2 |
+ cut -f1 -d: )' -P "$prefix" -- "$cur" ) )
+ return
+ ;;
+ esac
+
+ _split_longopt && split=true
+
+ case "$prev" in
+ -C|-P|--graphviz|--system-information)
+ _filedir
+ return
+ ;;
+ --build)
+ _filedir -d
+ return
+ ;;
+ -E)
+ COMPREPLY=( $( compgen -W "$( cmake -E help |& sed -n \
+ '/^ /{s|^ \([^ ]\{1,\}\) .*$|\1|;p}' 2>/dev/null )" \
+ -- "$cur" ) )
+ return
+ ;;
+ -G)
+ # FIXME: doesn't work properly
+ local IFS=$'\n'
+ COMPREPLY=( $( compgen -W '$( cmake --help 2>/dev/null | sed -n \
+ "/^.*[^ ].*= Generates/{s|^ *\(.*[^ ]\) *= Generates.*$|\1|;s| |\\\\ |g;p}" \
+ 2>/dev/null )' -- "$cur" ) )
+ return
+ ;;
+ --help-command)
+ COMPREPLY=( $( compgen -W '$( cmake --help-command-list 2>/dev/null|
+ tail -n +2 )' -- "$cur" ) )
+ return
+ ;;
+ --help-module)
+ COMPREPLY=( $( compgen -W '$( cmake --help-module-list 2>/dev/null|
+ tail -n +2 )' -- "$cur" ) )
+ return
+ ;;
+ --help-policy)
+ COMPREPLY=( $( compgen -W '$( cmake --help-policies 2>/dev/null |
+ grep "^ CMP" 2>/dev/null )' -- "$cur" ) )
+ return
+ ;;
+ --help-property)
+ COMPREPLY=( $( compgen -W '$( cmake --help-property-list \
+ 2>/dev/null | tail -n +2 )' -- "$cur" ) )
+ return
+ ;;
+ --help-variable)
+ COMPREPLY=( $( compgen -W '$( cmake --help-variable-list \
+ 2>/dev/null | tail -n +2 )' -- "$cur" ) )
+ return
+ ;;
+ esac
+
+ $split && return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ [[ $COMPREPLY ]] && return
+ fi
+
+ _filedir
+} &&
+complete -F _cmake cmake
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/Docs/bash-completion/cpack b/Docs/bash-completion/cpack
new file mode 100644
index 0000000..84dcfd5
--- /dev/null
+++ b/Docs/bash-completion/cpack
@@ -0,0 +1,61 @@
+# bash completion for cpack(1) -*- shell-script -*-
+
+_cpack()
+{
+ local cur prev words cword
+ _init_completion -n = || return
+
+ case "$prev" in
+ -G)
+ COMPREPLY=( $( compgen -W '$( cpack --help 2>/dev/null |
+ grep "^ .*=\ .*" 2> /dev/null | grep -v "^ -" 2>/dev/null |
+ cut -d" " -f 3 )' -- "$cur" ) )
+ return
+ ;;
+ -C)
+ COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo
+ MinSizeRel' -- "$cur" ) )
+ return
+ ;;
+ -D)
+ [[ $cur == *=* ]] && return # no completion for values
+ COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \
+ 2>/dev/null | tail -n +2 )' -S = -- "$cur" ) )
+ compopt -o nospace
+ return
+ ;;
+ -P|-R|--vendor)
+ # argument required but no completions available
+ return
+ ;;
+ -B)
+ _filedir -d
+ return
+ ;;
+ --config)
+ _filedir
+ return
+ ;;
+ --help-command)
+ COMPREPLY=( $( compgen -W '$( cpack --help-command-list 2>/dev/null|
+ tail -n +2 )' -- "$cur" ) )
+ return
+ ;;
+ --help-variable)
+ COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \
+ 2>/dev/null | tail -n +2 )' -- "$cur" ) )
+ return
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ [[ $COMPREPLY ]] && return
+ fi
+
+ _filedir
+} &&
+complete -F _cpack cpack
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/Docs/bash-completion/ctest b/Docs/bash-completion/ctest
new file mode 100644
index 0000000..9707f62
--- /dev/null
+++ b/Docs/bash-completion/ctest
@@ -0,0 +1,81 @@
+# bash completion for ctest(1) -*- shell-script -*-
+
+_ctest()
+{
+ local cur prev words cword
+ _init_completion -n = || return
+
+ case "$prev" in
+ -C|--build-config)
+ COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo
+ MinSizeRel' -- "$cur" ) )
+ return
+ ;;
+ -j|--parallel)
+ COMPREPLY=( $( compgen -W "{1..$(( $(_ncpus)*2 ))}" -- "$cur" ) )
+ return
+ ;;
+ -O|--output-log|-A|--add-notes|--extra-submit)
+ _filedir
+ return
+ ;;
+ -L|--label-regex|-LE|--label-exclude|--track|-I|--tests-information|\
+ --max-width|--timeout|--stop-time)
+ # argument required but no completions available
+ return
+ ;;
+ -R|--tests-regex|-E|--exclude-regex)
+ COMPREPLY=( $( compgen -W '$( ctest -N 2>/dev/null |
+ grep "^ Test" 2>/dev/null | cut -d: -f 2 )' -- "$cur" ) )
+ return
+ ;;
+ -D|--dashboard)
+ if [[ $cur == @(Experimental|Nightly|Continuous)* ]]; then
+ local model action
+ action=${cur#@(Experimental|Nightly|Continuous)}
+ model=${cur%"$action"}
+ COMPREPLY=( $( compgen -W 'Start Update Configure Build Test
+ Coverage Submit MemCheck' -P "$model" -- "$action" ) )
+ else
+ COMPREPLY=( $( compgen -W 'Experimental Nightly Continuous' \
+ -- "$cur" ) )
+ compopt -o nospace
+ fi
+ return
+ ;;
+ -M|--test-model)
+ COMPREPLY=( $( compgen -W 'Experimental Nightly Continuous' -- \
+ "$cur" ) )
+ return
+ ;;
+ -T|--test-action)
+ COMPREPLY=( $( compgen -W 'Start Update Configure Build Test
+ Coverage Submit MemCheck' -- "$cur" ) )
+ return
+ ;;
+ -S|--script|-SP|--script-new-process)
+ # FIXME ?
+ return
+ ;;
+ --interactive-debug-mode)
+ COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) )
+ return
+ ;;
+ --help-command)
+ COMPREPLY=( $( compgen -W '$( ctest --help-command-list 2>/dev/null|
+ tail -n +2 )' -- "$cur" ) )
+ return
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ [[ $COMPREPLY ]] && return
+ fi
+
+ _filedir
+} &&
+complete -F _ctest ctest
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/Docs/cmake-completion b/Docs/cmake-completion
deleted file mode 100644
index d70ac24..0000000
--- a/Docs/cmake-completion
+++ /dev/null
@@ -1,207 +0,0 @@
-#
-# bash-completion file for CMake
-# Provided by Eric NOULARD - eric.noulard@gmail.com
-#
-# see http://bash-completion.alioth.debian.org/
-# and http://www.cmake.org
-#
-# We will try to complete cmake commands options
-# at 2 (or may be 3 levels)
-# [cmake|cpack|ctest] <level0> <level1> <level2>
-#
-# level0 is top level cmake/cpack/ctest options
-# level1 is the first argument of level0 option
-# level2 is the seconf argument of level1 argument
-# FIXME: I don't know how to handle level2
-#
-# The file has been proposed for inclusion in the bash-completion package
-# https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312632&group_id=100114
-# In the meantime,
-# 1) If you want to test bash completion for cmake/cpack/ctest
-# just source the current file at bash prompt
-# . ./cmake-completion
-#
-# 2) If you want to install it for good copy this file to
-# cp cmake-completion /etc/bash_completion.d/cmake
-#
-
-#
-# cmake command
-#
-# have cmake &&
-_cmake()
-{
- local cur prev opts words cword
- COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
- # seems to be only available on bash-completion 1.2
- #_get_comp_words_by_ref cur prev
-
- # cmake command line option we want to complete
- opts=`cmake --help | grep "^ \-.*=\ .*" | cut -d" " -f 3 | cut -d= -f 1 | cut -d[ -f 1`
-
- #
- # Complete the arguments to some of
- # the most commonly used commands (Level 1).
- #
- case "${prev}" in
- -E)
- local running=$(for x in `cmake -E |& grep "^ " | cut -d" " -f 3`; do echo ${x} ; done )
- COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
- return 0
- ;;
- # FIXME: don't know how to handle multi words completion
- # or more precisely word that contains space in them like "Unix Makefiles"
- # -G)
- # local running=$(for x in `cmake --help | grep "^ .*=\ .*" | grep -v "^ -" | cut -d"=" -f 1 | grep -v "^ "`; do echo \"${x}\" ; done )
- # COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
- # return 0
- # ;;
- --help-command)
- local running=$(for x in `cmake --help-command-list | grep -v "cmake version"`; do echo ${x} ; done )
- COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
- return 0
- ;;
- --help-module)
- local running=$(for x in `cmake --help-module-list | grep -v "cmake version"`; do echo ${x} ; done )
- COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
- return 0
- ;;
- --help-policy)
- local running=$(for x in `cmake --help-policies | grep "^ CMP"`; do echo ${x} ; done )
- COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
- return 0
- ;;
- --help-property)
- local running=$(for x in `cmake --help-property-list | grep -v "cmake version"`; do echo ${x} ; done )
- COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
- return 0
- ;;
- --help-variable)
- local running=$(for x in `cmake --help-variable-list | grep -v "cmake version"`; do echo ${x} ; done )
- COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
- return 0
- ;;
- *)
- ;;
- esac
-
- #
- # Complete the arguments to some of
- # the most commonly used commands (Level 2).
- # ?? How to do that ..
-
- #
- # Complete the option (Level 0 - right after cmake)
- #
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
-} &&
-complete -F _cmake -o default cmake
-
-#
-# cpack command
-#
-#have cpack &&
-_cpack()
-{
- local cur prev opts words cword
- COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
- # seems to be only available on bash-completion 1.2
- #_get_comp_words_by_ref cur prev
-
- # cpack command line option we want to complete
- opts=`cpack --help | grep "^ \-.*=\ .*" | cut -d" " -f 3 | cut -d= -f 1`
- opts="${opts} --help -V"
-
- #
- # Complete the arguments to some of
- # the most commonly used commands (Level 1).
- #
- case "${prev}" in
- -G)
- local running=$(for x in `cpack --help | grep "^ .*=\ .*" | grep -v "^ -" | cut -d" " -f 3`; do echo ${x} ; done )
- COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
- return 0
- ;;
- --config)
- COMPREPLY=( $(compgen -f ${cur}) )
- return 0
- ;;
- --help-variable)
- local running=$(for x in `cpack --help-variable-list | grep -v "cpack version" `; do echo ${x} ; done )
- COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
- return 0
- ;;
- --help-command)
- local running=$(for x in `cpack --help-command-list | grep -v "cpack version" `; do echo ${x} ; done )
- COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
- return 0
- ;;
- *)
- ;;
- esac
-
- #
- # Complete the option (Level 0 - right after cpack)
- #
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
-} &&
-complete -F _cpack -o default cpack
-
-#
-# ctest command
-#
-# have ctest &&
-_ctest()
-{
- local cur prev opts words cword
- COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
- # seems to be only available on bash-completion 1.2
- #_get_comp_words_by_ref cur prev
-
- # cmake command line option we want to complete
- opts=`ctest --help | grep "\-\-.*" | cut -d" " -f 3 | sed s/,/\\\n/g`
-
- #
- # Complete the arguments to some of
- # the most commonly used commands (Level 1).
- #
- case "${prev}" in
- --help-command)
- local running=$(for x in `ctest --help-command-list | grep -v "ctest version" `; do echo ${x} ; done )
- COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
- return 0
- ;;
- -R|-E)
- local running=$(for x in `ctest -N 2> /dev/null | grep "^ Test" | cut -d: -f 2`; do echo ${x} ; done )
- COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
- return 0
- ;;
- *)
- ;;
- esac
-
- #
- # Complete the arguments to some of
- # the most commonly used commands (Level 2).
- # ?? How to do that ..
-
- #
- # Complete the option (Level 0 - right after cmake)
- #
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
-} &&
-complete -F _ctest -o default ctest
-
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
-# ex: ts=4 sw=4 et filetype=sh
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 571770e..e572119 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -89,6 +89,7 @@
# CPACK_PACKAGE_FILE_NAME - The name of the package file to generate,
# not including the extension. For example, cmake-2.6.1-Linux-i686.
# The default value is
+#
# ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}.
##end
#
@@ -341,6 +342,10 @@ cpack_set_if_not_set(CPACK_RESOURCE_FILE_WELCOME
cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
+IF(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
+ SET(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
+ENDIF(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
+
IF(CPACK_NSIS_MODIFY_PATH)
SET(CPACK_NSIS_MODIFY_PATH ON)
ENDIF(CPACK_NSIS_MODIFY_PATH)
diff --git a/Modules/CPackNSIS.cmake b/Modules/CPackNSIS.cmake
index 5e2ba17..d140053 100644
--- a/Modules/CPackNSIS.cmake
+++ b/Modules/CPackNSIS.cmake
@@ -31,13 +31,21 @@
##end
#
##variable
-# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will
-# be added to the install Section.
+# CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS - Extra NSIS commands that
+# will be added to the beginning of the install Section, before your
+# install tree is available on the target system.
+##end
+#
+##variable
+# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that
+# will be added to the end of the install Section, after your
+# install tree is available on the target system.
##end
#
##variable
# CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will
-# be added to the uninstall Section.
+# be added to the uninstall Section, before your install tree is
+# removed from the target system.
##end
#
##variable
@@ -46,6 +54,14 @@
##end
#
##variable
+# CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL - Ask about uninstalling
+# previous versions first.
+# If this is set to "ON", then an installer will look for previous
+# installed versions and if one is found, ask the user whether to
+# uninstall it before proceeding with the install.
+##end
+#
+##variable
# CPACK_NSIS_MODIFY_PATH - Modify PATH toggle.
# If this is set to "ON", then an extra page
# will appear in the installer that will allow the user to choose
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index 1c08c59..90d04ac 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -33,7 +33,9 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
FAIL_REGEX "unknown .*option" # Clang
FAIL_REGEX "ignoring unknown option" # MSVC
FAIL_REGEX "warning D9002" # MSVC, any lang
- FAIL_REGEX "option .*not supported" # Intel
+ FAIL_REGEX "option.*not supported" # Intel
+ FAIL_REGEX "invalid argument .*option" # Intel
+ FAIL_REGEX "ignoring option .*argument required" # Intel
FAIL_REGEX "[Uu]nknown option" # HP
FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro
FAIL_REGEX "command option .* is not recognized" # XL
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index 6fa69b1..19963ea 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -33,7 +33,9 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
FAIL_REGEX "unknown .*option" # Clang
FAIL_REGEX "ignoring unknown option" # MSVC
FAIL_REGEX "warning D9002" # MSVC, any lang
- FAIL_REGEX "option .*not supported" # Intel
+ FAIL_REGEX "option.*not supported" # Intel
+ FAIL_REGEX "invalid argument .*option" # Intel
+ FAIL_REGEX "ignoring option .*argument required" # Intel
FAIL_REGEX "[Uu]nknown option" # HP
FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro
FAIL_REGEX "command option .* is not recognized" # XL
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index b6fe190..301d1fc 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1141,7 +1141,8 @@ function(_ep_add_download_command name)
set(comment "Performing download step (verify and extract) for '${name}'")
endif()
_ep_write_verifyfile_script("${stamp_dir}/verify-${name}.cmake" "${file}" "${md5}")
- list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/verify-${name}.cmake)
+ list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/verify-${name}.cmake
+ COMMAND)
_ep_write_extractfile_script("${stamp_dir}/extract-${name}.cmake" "${name}" "${file}" "${source_dir}")
list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/extract-${name}.cmake)
endif()
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 5d93ab1..39d3a76 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -13,11 +13,10 @@
# When the 'QUIET' argument is set, no status messages will be printed.
#
# It sets the following variables:
-# PKG_CONFIG_FOUND ... true if pkg-config works on the system
+# PKG_CONFIG_FOUND ... if pkg-config executable was found
# PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
# PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
# (since CMake 2.8.8)
-# PKG_CONFIG_FOUND ... if pkg-config executable was found
#
# For the following variables two sets of values exist; first one is the
# common one and has the given PREFIX. The second set contains flags
@@ -104,6 +103,11 @@ find_package_handle_standard_args(PkgConfig
REQUIRED_VARS PKG_CONFIG_EXECUTABLE
VERSION_VAR PKG_CONFIG_VERSION_STRING)
+# This is needed because the module name is "PkgConfig" but the name of
+# this variable has always been PKG_CONFIG_FOUND so this isn't automatically
+# handled by FPHSA.
+set(PKG_CONFIG_FOUND "${PKGCONFIG_FOUND}")
+
# Unsets the given variables
macro(_pkgconfig_unset var)
set(${var} "" CACHE INTERNAL "")
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index fcd0838..591b3e6 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -82,7 +82,12 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
ENDIF(WIN32)
FIND_LIBRARY(PYTHON_LIBRARY
- NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
+ NAMES
+ python${_CURRENT_VERSION_NO_DOTS}
+ python${_CURRENT_VERSION}mu
+ python${_CURRENT_VERSION}m
+ python${_CURRENT_VERSION}u
+ python${_CURRENT_VERSION}
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
@@ -120,12 +125,14 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
PATH_SUFFIXES
+ python${_CURRENT_VERSION}mu
+ python${_CURRENT_VERSION}m
+ python${_CURRENT_VERSION}u
python${_CURRENT_VERSION}
)
- # For backward compatibility, set PYTHON_INCLUDE_PATH, but make it internal.
- SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}" CACHE INTERNAL
- "Path to where Python.h is found (deprecated)")
+ # For backward compatibility, set PYTHON_INCLUDE_PATH.
+ SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
IF(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
FILE(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" python_version_str
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index 819cc5c..43f72f6 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -637,6 +637,7 @@ Section "-Core installation"
;Use the entire tree produced by the INSTALL target. Keep the
;list of directories here in sync with the RMDir commands below.
SetOutPath "$INSTDIR"
+ @CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@
@CPACK_NSIS_FULL_INSTALL@
;Store installation folder
@@ -899,6 +900,28 @@ SectionEnd
; "Program Files" for AllUsers, "My Documents" for JustMe...
Function .onInit
+ StrCmp "@CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL@" "ON" 0 inst
+
+ ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "UninstallString"
+ StrCmp $0 "" inst
+
+ MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \
+ "@CPACK_NSIS_PACKAGE_NAME@ is already installed. $\n$\nDo you want to uninstall the old version before installing the new one?" \
+ IDYES uninst IDNO inst
+ Abort
+
+;Run the uninstaller
+uninst:
+ ClearErrors
+ ExecWait '$0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
+
+ IfErrors uninst_failed inst
+uninst_failed:
+ MessageBox MB_OK|MB_ICONSTOP "Uninstall failed."
+ Abort
+
+
+inst:
; Reads components status for registry
!insertmacro SectionList "InitSection"
diff --git a/Modules/Platform/Windows-Intel-CXX.cmake b/Modules/Platform/Windows-Intel-CXX.cmake
index 2845b0f..ec5f0ae 100644
--- a/Modules/Platform/Windows-Intel-CXX.cmake
+++ b/Modules/Platform/Windows-Intel-CXX.cmake
@@ -1,4 +1,4 @@
include(Platform/Windows-Intel)
set(_COMPILE_CXX " /TP")
-set(_FLAGS_CXX " /GX /GR")
+set(_FLAGS_CXX " /EHsc /GR")
__windows_compiler_intel(CXX)
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 84d0afd..30cc920 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -130,7 +130,7 @@
# Example:
# create_javadoc(my_example_doc
# PACKAGES com.exmaple.foo com.example.bar
-# SOURCEPATH ${CMAKE_CURRENT_SOURCE_PATH}
+# SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
# CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
# WINDOWTITLE "My example"
# DOCTITLE "<h1>My example</h1>"
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index f9d1c03..c01c490 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -355,18 +355,18 @@ IF (WIN32)
ENDIF(NOT UNIX)
ENDIF (WIN32)
-# turn on Ninja by default
+# Turn on Ninja by default, but disable it
+# on platforms where it does not pass all tests.
+# Enforce Ninja support by setting CMAKE_USE_NINJA
set(_CMAKE_DEFAULT_NINJA_VALUE TRUE)
-# turn it off for platforms where it does not pass all the
-# tests
if(WIN32 OR APPLE)
SET(_CMAKE_DEFAULT_NINJA_VALUE FALSE)
endif()
SET(CMAKE_ENABLE_NINJA ${_CMAKE_DEFAULT_NINJA_VALUE} CACHE BOOL
- "Enable the ninja generator for CMake. currently not fully working for Windows or OSX")
+ "Enable the ninja generator for CMake. On Windows and OSX broken")
MARK_AS_ADVANCED(CMAKE_ENABLE_NINJA)
IF(CMAKE_ENABLE_NINJA)
- MESSAGE(STATUS "Enable ninja generator.")
+ MESSAGE(STATUS "Ninja generator enabled.")
SET(SRCS ${SRCS}
cmGlobalNinjaGenerator.cxx
cmGlobalNinjaGenerator.h
@@ -382,7 +382,7 @@ IF(CMAKE_ENABLE_NINJA)
)
ADD_DEFINITIONS(-DCMAKE_USE_NINJA)
ELSE()
- MESSAGE(STATUS "Disable ninja generator.")
+ MESSAGE(STATUS "Ninja generator disabled, enforce with -DCMAKE_ENABLE_NINJA=ON")
ENDIF()
# create a library used by the command line and the GUI
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 2c0122c..0908537 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 8)
SET(CMake_VERSION_PATCH 8)
-SET(CMake_VERSION_TWEAK 20120423)
+SET(CMake_VERSION_TWEAK 20120501)
#SET(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 178a18d..fa456de 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -480,11 +480,16 @@ int cmCPackDebGenerator::createDeb()
// Do not end the md5sum file with yet another (invalid)
}
- cmd = "\"";
- cmd += cmakeExecutable;
- cmd += "\" -E tar cfz control.tar.gz ./control ./md5sums";
- const char* controlExtra =
- this->GetOption("CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA");
+ cmd = "";
+ if (NULL != this->GetOption("CPACK_DEBIAN_FAKEROOT_EXECUTABLE"))
+ {
+ cmd = this->GetOption("CPACK_DEBIAN_FAKEROOT_EXECUTABLE");
+ }
+ cmd += " \"";
+ cmd += cmakeExecutable;
+ cmd += "\" -E tar cfz control.tar.gz ./control ./md5sums";
+ const char* controlExtra =
+ this->GetOption("CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA");
if( controlExtra )
{
std::vector<std::string> controlExtraList;
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 309abb1..ae06b0f 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -752,6 +752,33 @@ int cmCTestCoverageHandler::HandlePHPCoverage(
return static_cast<int>(cont->TotalCoverage.size());
}
+struct cmCTestCoverageHandlerLocale
+{
+ cmCTestCoverageHandlerLocale()
+ {
+ if(const char* l = cmSystemTools::GetEnv("LC_ALL"))
+ {
+ lc_all = l;
+ }
+ if(lc_all != "C")
+ {
+ cmSystemTools::PutEnv("LC_ALL=C");
+ }
+ }
+ ~cmCTestCoverageHandlerLocale()
+ {
+ if(!lc_all.empty())
+ {
+ cmSystemTools::PutEnv(("LC_ALL=" + lc_all).c_str());
+ }
+ else
+ {
+ cmSystemTools::UnsetEnv("LC_ALL");
+ }
+ }
+ std::string lc_all;
+};
+
//----------------------------------------------------------------------
int cmCTestCoverageHandler::HandleGCovCoverage(
cmCTestCoverageHandlerContainer* cont)
@@ -815,7 +842,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
int file_count = 0;
// make sure output from gcov is in English!
- cmSystemTools::PutEnv("LC_ALL=POSIX");
+ cmCTestCoverageHandlerLocale locale_C;
+ static_cast<void>(locale_C);
// files is a list of *.da and *.gcda files with coverage data in them.
// These are binary files that you give as input to gcov so that it will
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 035aaa9..3e4ecdd 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -358,7 +358,7 @@ void cmCTestMemCheckHandler::GenerateDartOutput(std::ostream& os)
os
<< "\t\t</Results>\n"
- << logTag << memcheckstr << std::endl
+ << logTag << cmXMLSafe(memcheckstr) << std::endl
<< "\t</Log>\n";
this->WriteTestResultFooter(os, result);
if ( current < cc )
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 48f644b..ed485e3 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -404,6 +404,7 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
if(cmSystemTools::FileIsDirectory(fullPath.c_str()))
{
this->CleanupFiles(fullPath.c_str());
+ cmSystemTools::RemoveADirectory(fullPath.c_str());
}
else
{
diff --git a/Source/cmDocumentationFormatterHTML.cxx b/Source/cmDocumentationFormatterHTML.cxx
index 6ced1e4..ed28b45 100644
--- a/Source/cmDocumentationFormatterHTML.cxx
+++ b/Source/cmDocumentationFormatterHTML.cxx
@@ -127,7 +127,7 @@ void cmDocumentationFormatterHTML
{
os << "<h2><a name=\"section_";
cmDocumentationPrintHTMLId(os, name);
- os << "\"/>" << name << "</h2>\n";
+ os << "\"></a>" << name << "</h2>\n";
}
// Is a list needed?
@@ -167,9 +167,9 @@ void cmDocumentationFormatterHTML
{
os << " <a name=\"" << prefix << ":";
cmDocumentationPrintHTMLId(os, op->Name.c_str());
- os << "\"><b><code>";
+ os << "\"></a><b><code>";
this->PrintHTMLEscapes(os, op->Name.c_str());
- os << "</code></b></a>: ";
+ os << "</code></b>: ";
}
this->PrintHTMLEscapes(os, op->Brief.c_str());
if(op->Full.size())
@@ -269,9 +269,9 @@ void cmDocumentationFormatterHTML
return;
}
- os << "<h2><a name=\"section_Index\">Master Index "
+ os << "<h2><a name=\"section_Index\"></a>Master Index "
<< "CMake " << cmVersion::GetCMakeVersion()
- << "</a></h2>\n";
+ << "</h2>\n";
if (!sections.empty())
{
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index ccb17f0..5df8627 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -60,6 +60,9 @@ cmExtraCodeBlocksGenerator::cmExtraCodeBlocksGenerator()
// disable until somebody actually tests it:
// this->SupportedGlobalGenerators.push_back("MSYS Makefiles");
#endif
+#ifdef CMAKE_USE_NINJA
+ this->SupportedGlobalGenerators.push_back("Ninja");
+#endif
this->SupportedGlobalGenerators.push_back("Unix Makefiles");
}
@@ -383,6 +386,7 @@ void cmExtraCodeBlocksGenerator
case cmTarget::STATIC_LIBRARY:
case cmTarget::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY:
+ case cmTarget::OBJECT_LIBRARY:
{
this->AppendTarget(fout, ti->first.c_str(), &ti->second,
make.c_str(), makefile, compiler.c_str());
@@ -420,6 +424,7 @@ void cmExtraCodeBlocksGenerator
case cmTarget::STATIC_LIBRARY:
case cmTarget::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY:
+ case cmTarget::OBJECT_LIBRARY:
case cmTarget::UTILITY: // can have sources since 2.6.3
{
const std::vector<cmSourceFile*>&sources=ti->second.GetSourceFiles();
@@ -532,6 +537,31 @@ void cmExtraCodeBlocksGenerator
}
+// Write a dummy file for OBJECT libraries, so C::B can reference some file
+std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile(
+ cmMakefile* mf, cmTarget* target) const
+{
+ // this file doesn't seem to be used by C::B in custom makefile mode,
+ // but we generate a unique file for each OBJECT library so in case
+ // C::B uses it in some way, the targets don't interfere with each other.
+ std::string filename = mf->GetCurrentOutputDirectory();
+ filename += "/";
+ filename += mf->GetLocalGenerator()->GetTargetDirectory(*target);
+ filename += "/";
+ filename += target->GetName();
+ filename += ".objlib";
+ cmGeneratedFileStream fout(filename.c_str());
+ if(fout)
+ {
+ fout << "# This is a dummy file for the OBJECT library "
+ << target->GetName()
+ << " for the CMake CodeBlocks project generator.\n"
+ << "# Don't edit, this file will be overwritten.\n";
+ }
+ return filename;
+}
+
+
// Generate the xml code for one target.
void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
const char* targetName,
@@ -570,7 +600,18 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
}
const char* buildType = makefile->GetDefinition("CMAKE_BUILD_TYPE");
- fout<<" <Option output=\"" << target->GetLocation(buildType)
+ std::string location;
+ if ( target->GetType()==cmTarget::OBJECT_LIBRARY)
+ {
+ location = this->CreateDummyTargetFile(const_cast<cmMakefile*>(makefile),
+ target);
+ }
+ else
+ {
+ location = target->GetLocation(buildType);
+ }
+
+ fout<<" <Option output=\"" << location
<< "\" prefix_auto=\"0\" extension_auto=\"0\" />\n"
" <Option working_dir=\"" << workingDir << "\" />\n"
" <Option object_output=\"./\" />\n"
@@ -728,7 +769,8 @@ int cmExtraCodeBlocksGenerator::GetCBTargetType(cmTarget* target)
return 1;
}
}
- else if ( target->GetType()==cmTarget::STATIC_LIBRARY)
+ else if (( target->GetType()==cmTarget::STATIC_LIBRARY)
+ || (target->GetType()==cmTarget::OBJECT_LIBRARY))
{
return 2;
}
diff --git a/Source/cmExtraCodeBlocksGenerator.h b/Source/cmExtraCodeBlocksGenerator.h
index 57751fc..e0a64ca 100644
--- a/Source/cmExtraCodeBlocksGenerator.h
+++ b/Source/cmExtraCodeBlocksGenerator.h
@@ -44,6 +44,8 @@ private:
void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
const std::string& filename);
+ std::string CreateDummyTargetFile(cmMakefile* mf, cmTarget* target) const;
+
std::string GetCBCompilerId(const cmMakefile* mf);
int GetCBTargetType(cmTarget* target);
std::string BuildMakeCommand(const std::string& make, const char* makefile,
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 3f14fa1..d69431e 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -300,7 +300,7 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args)
offset = atoi(offsetArg.GetCString());
}
- file.seekg(offset);
+ file.seekg(offset, std::ios::beg); // explicit ios::beg for IBM VisualAge 6
std::string output;
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index ef16ce8..4f9ba7e 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -89,7 +89,7 @@ void cmFindPackageCommand::GenerateDocumentation()
"FIND_XXX", "find_package");
this->CommandDocumentation =
" find_package(<package> [version] [EXACT] [QUIET] [MODULE]\n"
- " [[REQUIRED|COMPONENTS] [components...]]\n"
+ " [REQUIRED] [[COMPONENTS] [components...]]\n"
" [OPTIONAL_COMPONENTS components...]\n"
" [NO_POLICY_SCOPE])\n"
"Finds and loads settings from an external project. "
@@ -102,7 +102,7 @@ void cmFindPackageCommand::GenerateDocumentation()
"package cannot be found."
"\n"
"A package-specific list of required components may be listed after the "
- "COMPONENTS option or directly after the REQUIRED option. "
+ "COMPONENTS option (or after the REQUIRED option if present). "
"Additional optional components may be listed after OPTIONAL_COMPONENTS. "
"Available components and their influence on whether a package is "
"considered to be found are defined by the target package."
@@ -136,7 +136,7 @@ void cmFindPackageCommand::GenerateDocumentation()
"proceeds to Config mode.\n"
"The complete Config mode command signature is:\n"
" find_package(<package> [version] [EXACT] [QUIET]\n"
- " [[REQUIRED|COMPONENTS] [components...]]\n"
+ " [REQUIRED] [[COMPONENTS] [components...]]\n"
" [CONFIG|NO_MODULE]\n"
" [NO_POLICY_SCOPE]\n"
" [NAMES name1 [name2 ...]]\n"
@@ -353,6 +353,29 @@ void cmFindPackageCommand::GenerateDocumentation()
"variable CMAKE_DISABLE_FIND_PACKAGE_<package> to TRUE. See the "
"documentation for the CMAKE_DISABLE_FIND_PACKAGE_<package> variable for "
"more information.\n"
+ "When loading a find module or package configuration file find_package "
+ "defines variables to provide information about the call arguments "
+ "(and restores their original state before returning):\n"
+ " <package>_FIND_REQUIRED = true if REQUIRED option was given\n"
+ " <package>_FIND_QUIETLY = true if QUIET option was given\n"
+ " <package>_FIND_VERSION = full requested version string\n"
+ " <package>_FIND_VERSION_MAJOR = major version if requested, else 0\n"
+ " <package>_FIND_VERSION_MINOR = minor version if requested, else 0\n"
+ " <package>_FIND_VERSION_PATCH = patch version if requested, else 0\n"
+ " <package>_FIND_VERSION_TWEAK = tweak version if requested, else 0\n"
+ " <package>_FIND_VERSION_COUNT = number of version components, 0 to 4\n"
+ " <package>_FIND_VERSION_EXACT = true if EXACT option was given\n"
+ " <package>_FIND_COMPONENTS = list of requested components\n"
+ " <package>_FIND_REQUIRED_<c> = true if component <c> is required\n"
+ " false if component <c> is optional\n"
+ "In Module mode the loaded find module is responsible to honor the "
+ "request detailed by these variables; see the find module for details. "
+ "In Config mode find_package handles REQUIRED, QUIET, and version "
+ "options automatically but leaves it to the package configuration file "
+ "to handle components in a way that makes sense for the package. "
+ "The package configuration file may set <package>_FOUND to false "
+ "to tell find_package that component requirements are not satisfied."
+ "\n"
"See the cmake_policy() command documentation for discussion of the "
"NO_POLICY_SCOPE option."
;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 545f9e8..b06cdb4 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2092,6 +2092,21 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(
}
//----------------------------------------------------------------------------
+std::string
+cmGlobalGenerator::GenerateRuleFile(std::string const& output) const
+{
+ std::string ruleFile = output;
+ ruleFile += ".rule";
+ const char* dir = this->GetCMakeCFGIntDir();
+ if(dir && dir[0] == '$')
+ {
+ cmSystemTools::ReplaceString(ruleFile, dir,
+ cmake::GetCMakeFilesDirectory());
+ }
+ return ruleFile;
+}
+
+//----------------------------------------------------------------------------
void cmGlobalGenerator::AppendDirectoryForConfig(const char*, const char*,
const char*, std::string&)
{
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 80b948b..5254b89 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -277,6 +277,9 @@ public:
i.e. "Can I build Debug and Release in the same tree?" */
virtual bool IsMultiConfig() { return false; }
+ /** Generate an <output>.rule file path for a given command output. */
+ virtual std::string GenerateRuleFile(std::string const& output) const;
+
protected:
typedef std::vector<cmLocalGenerator*> GeneratorVector;
// for a project collect all its targets by following depend
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 22ead10..28d738a 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -212,3 +212,21 @@ bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf)
return false;
}
}
+
+//----------------------------------------------------------------------------
+std::string
+cmGlobalVisualStudio10Generator
+::GenerateRuleFile(std::string const& output) const
+{
+ // The VS 10 generator needs to create the .rule files on disk.
+ // Hide them away under the CMakeFiles directory.
+ std::string ruleDir = this->GetCMakeInstance()->GetHomeOutputDirectory();
+ ruleDir += cmake::GetCMakeFilesDirectory();
+ ruleDir += "/";
+ ruleDir += cmSystemTools::ComputeStringMD5(
+ cmSystemTools::GetFilenamePath(output).c_str());
+ std::string ruleFile = ruleDir + "/";
+ ruleFile += cmSystemTools::GetFilenameName(output);
+ ruleFile += ".rule";
+ return ruleFile;
+}
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 750b89c..e2cc14e 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -75,6 +75,10 @@ public:
virtual const char* GetCMakeCFGIntDir() const
{ return "$(Configuration)";}
bool Find64BitTools(cmMakefile* mf);
+
+ /** Generate an <output>.rule file path for a given command output. */
+ virtual std::string GenerateRuleFile(std::string const& output) const;
+
protected:
virtual const char* GetIDEVersion() { return "10.0"; }
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index a5feaca..d6b653c 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -241,9 +241,12 @@ void cmGlobalVisualStudio71Generator
::WriteExternalProject(std::ostream& fout,
const char* name,
const char* location,
+ const char* typeGuid,
const std::set<cmStdString>& depends)
{
- fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
+ fout << "Project(\"{"
+ << (typeGuid ? typeGuid : "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942")
+ << "}\") = \""
<< name << "\", \""
<< this->ConvertToSolutionPath(location) << "\", \"{"
<< this->GetGUID(name)
@@ -279,18 +282,21 @@ void cmGlobalVisualStudio71Generator
// executables to the libraries it uses are also done here
void cmGlobalVisualStudio71Generator
::WriteProjectConfigurations(std::ostream& fout, const char* name,
- bool partOfDefaultBuild)
+ bool partOfDefaultBuild,
+ const char* platformMapping)
{
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
i != this->Configurations.end(); ++i)
{
fout << "\t\t{" << guid << "}." << *i
- << ".ActiveCfg = " << *i << "|Win32\n";
+ << ".ActiveCfg = " << *i << "|"
+ << (platformMapping ? platformMapping : "Win32") << std::endl;
if(partOfDefaultBuild)
{
fout << "\t\t{" << guid << "}." << *i
- << ".Build.0 = " << *i << "|Win32\n";
+ << ".Build.0 = " << *i << "|"
+ << (platformMapping ? platformMapping : "Win32") << std::endl;
}
}
}
diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h
index 81c2087..503b708 100644
--- a/Source/cmGlobalVisualStudio71Generator.h
+++ b/Source/cmGlobalVisualStudio71Generator.h
@@ -64,10 +64,12 @@ protected:
const char* name, const char* path, cmTarget &t);
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
- bool partOfDefaultBuild);
+ bool partOfDefaultBuild,
+ const char* platformMapping = NULL);
virtual void WriteExternalProject(std::ostream& fout,
const char* name,
const char* path,
+ const char* typeGuid,
const std::set<cmStdString>& depends);
virtual void WriteSLNFooter(std::ostream& fout);
virtual void WriteSLNHeader(std::ostream& fout);
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index a68e6d8..6332d0b 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -250,8 +250,9 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations(
const char* expath = target->GetProperty("EXTERNAL_MSPROJECT");
if(expath)
{
- this->WriteProjectConfigurations(fout, target->GetName(),
- true);
+ this->WriteProjectConfigurations(
+ fout, target->GetName(),
+ true, target->GetProperty("VS_PLATFORM_MAPPING"));
}
else
{
@@ -286,8 +287,12 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
{
std::string project = target->GetName();
std::string location = expath;
- this->WriteExternalProject(fout, project.c_str(),
- location.c_str(), target->GetUtilities());
+
+ this->WriteExternalProject(fout,
+ project.c_str(),
+ location.c_str(),
+ target->GetProperty("VS_PROJECT_TYPE"),
+ target->GetUtilities());
written = true;
}
else
@@ -580,18 +585,21 @@ cmGlobalVisualStudio7Generator
// executables to the libraries it uses are also done here
void cmGlobalVisualStudio7Generator
::WriteProjectConfigurations(std::ostream& fout, const char* name,
- bool partOfDefaultBuild)
+ bool partOfDefaultBuild,
+ const char* platformMapping)
{
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
i != this->Configurations.end(); ++i)
{
fout << "\t\t{" << guid << "}." << *i
- << ".ActiveCfg = " << *i << "|Win32\n";
+ << ".ActiveCfg = " << *i << "|"
+ << (platformMapping ? platformMapping : "Win32") << "\n";
if(partOfDefaultBuild)
{
fout << "\t\t{" << guid << "}." << *i
- << ".Build.0 = " << *i << "|Win32\n";
+ << ".Build.0 = " << *i << "|"
+ << (platformMapping ? platformMapping : "Win32") << "\n";
}
}
}
@@ -604,10 +612,14 @@ void cmGlobalVisualStudio7Generator
void cmGlobalVisualStudio7Generator::WriteExternalProject(std::ostream& fout,
const char* name,
const char* location,
+ const char* typeGuid,
const std::set<cmStdString>&)
{
std::string d = cmSystemTools::ConvertToOutputPath(location);
- fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
+ fout << "Project("
+ << "\"{"
+ << (typeGuid ? typeGuid : "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942")
+ << "}\") = \""
<< name << "\", \""
<< this->ConvertToSolutionPath(location) << "\", \"{"
<< this->GetGUID(name)
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index c92998e..9b9107d 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -107,7 +107,8 @@ protected:
const char* name, const char* path, cmTarget &t);
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
- bool partOfDefaultBuild);
+ bool partOfDefaultBuild,
+ const char* platformMapping = NULL);
virtual void WriteSLNFooter(std::ostream& fout);
virtual void WriteSLNHeader(std::ostream& fout);
virtual std::string WriteUtilityDepend(cmTarget* target);
@@ -130,6 +131,7 @@ protected:
virtual void WriteExternalProject(std::ostream& fout,
const char* name,
const char* path,
+ const char* typeGuid,
const std::set<cmStdString>&
dependencies);
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index a723109..e7c4232 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -214,13 +214,11 @@ void cmGlobalVisualStudio8Generator::AddCheckTarget()
// (this could be avoided with per-target source files)
const char* no_main_dependency = 0;
const char* no_working_directory = 0;
- mf->AddCustomCommandToOutput(
- stamps, listFiles,
- no_main_dependency, commandLines, "Checking Build System",
- no_working_directory, true);
- std::string ruleName = stamps[0];
- ruleName += ".rule";
- if(cmSourceFile* file = mf->GetSource(ruleName.c_str()))
+ if(cmSourceFile* file =
+ mf->AddCustomCommandToOutput(
+ stamps, listFiles,
+ no_main_dependency, commandLines, "Checking Build System",
+ no_working_directory, true))
{
tgt->AddSourceFile(file);
}
@@ -270,20 +268,23 @@ cmGlobalVisualStudio8Generator
void
cmGlobalVisualStudio8Generator
::WriteProjectConfigurations(std::ostream& fout, const char* name,
- bool partOfDefaultBuild)
+ bool partOfDefaultBuild,
+ const char* platformMapping)
{
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
i != this->Configurations.end(); ++i)
{
fout << "\t\t{" << guid << "}." << *i
- << "|" << this->GetPlatformName() << ".ActiveCfg = "
- << *i << "|" << this->GetPlatformName() << "\n";
+ << "|" << this->GetPlatformName() << ".ActiveCfg = " << *i << "|"
+ << (platformMapping ? platformMapping : this->GetPlatformName())
+ << "\n";
if(partOfDefaultBuild)
{
fout << "\t\t{" << guid << "}." << *i
- << "|" << this->GetPlatformName() << ".Build.0 = "
- << *i << "|" << this->GetPlatformName() << "\n";
+ << "|" << this->GetPlatformName() << ".Build.0 = " << *i << "|"
+ << (platformMapping ? platformMapping : this->GetPlatformName())
+ << "\n";
}
}
}
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index e0913ed..7dae429 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -77,7 +77,8 @@ protected:
virtual void WriteSolutionConfigurations(std::ostream& fout);
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
- bool partOfDefaultBuild);
+ bool partOfDefaultBuild,
+ const char* platformMapping = NULL);
virtual bool ComputeTargetDepends();
virtual void WriteProjectDepends(std::ostream& fout, const char* name,
const char* path, cmTarget &t);
diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx
index a4369a3..d219c16 100644
--- a/Source/cmIncludeExternalMSProjectCommand.cxx
+++ b/Source/cmIncludeExternalMSProjectCommand.cxx
@@ -25,18 +25,75 @@ bool cmIncludeExternalMSProjectCommand
#ifdef _WIN32
if(this->Makefile->GetDefinition("WIN32"))
{
+ enum Doing { DoingNone, DoingType, DoingGuid, DoingPlatform };
+
+ Doing doing = DoingNone;
+
+ std::string customType;
+ std::string customGuid;
+ std::string platformMapping;
+
+ std::vector<std::string> depends;
+ for (unsigned int i=2; i<args.size(); ++i)
+ {
+ if (args[i] == "TYPE")
+ {
+ doing = DoingType;
+ }
+ else if (args[i] == "GUID")
+ {
+ doing = DoingGuid;
+ }
+ else if (args[i] == "PLATFORM")
+ {
+ doing = DoingPlatform;
+ }
+ else
+ {
+ switch (doing)
+ {
+ case DoingNone: depends.push_back(args[i]); break;
+ case DoingType: customType = args[i]; break;
+ case DoingGuid: customGuid = args[i]; break;
+ case DoingPlatform: platformMapping = args[i]; break;
+ }
+ doing = DoingNone;
+ }
+ }
+
+ // Hack together a utility target storing enough information
+ // to reproduce the target inclusion.
+ std::string utility_name = args[0];
+
std::string path = args[1];
cmSystemTools::ConvertToUnixSlashes(path);
+ if (!customGuid.empty())
+ {
+ std::string guidVariable = utility_name + "_GUID_CMAKE";
+ this->Makefile->GetCMakeInstance()->AddCacheEntry(
+ guidVariable.c_str(), customGuid.c_str(),
+ "Stored GUID", cmCacheManager::INTERNAL);
+ }
+
// Create a target instance for this utility.
cmTarget* target=this->Makefile->AddNewTarget(cmTarget::UTILITY,
- args[0].c_str());
+ utility_name.c_str());
+
+ target->SetProperty("GENERATOR_FILE_NAME", utility_name.c_str());
target->SetProperty("EXTERNAL_MSPROJECT", path.c_str());
- target->SetProperty("EXCLUDE_FROM_ALL","FALSE");
- target->SetProperty("GENERATOR_FILE_NAME", args[0].c_str());
- for (unsigned int i=2; i<args.size(); ++i)
+ target->SetProperty("EXCLUDE_FROM_ALL", "FALSE");
+
+ if (!customType.empty())
+ target->SetProperty("VS_PROJECT_TYPE",customType.c_str());
+ if (!platformMapping.empty())
+ target->SetProperty("VS_PLATFORM_MAPPING",platformMapping.c_str());
+
+ for (std::vector<std::string>::const_iterator it = depends.begin();
+ it != depends.end();
+ ++it)
{
- target->AddUtility(args[i].c_str());
+ target->AddUtility(it->c_str());
}
}
#endif
diff --git a/Source/cmIncludeExternalMSProjectCommand.h b/Source/cmIncludeExternalMSProjectCommand.h
index 911a772..2b2ed0d 100644
--- a/Source/cmIncludeExternalMSProjectCommand.h
+++ b/Source/cmIncludeExternalMSProjectCommand.h
@@ -59,11 +59,21 @@ public:
{
return
" include_external_msproject(projectname location\n"
+ " [TYPE projectTypeGUID]\n"
+ " [GUID projectGUID]\n"
+ " [PLATFORM platformName]\n"
" dep1 dep2 ...)\n"
"Includes an external Microsoft project in the generated workspace "
"file. Currently does nothing on UNIX. This will create a "
"target named [projectname]. This can be used in the add_dependencies "
- "command to make things depend on the external project.";
+ "command to make things depend on the external project."
+ "\n"
+ "TYPE, GUID and PLATFORM are optional parameters that allow one "
+ "to specify the type of project, id (GUID) of the project and "
+ "the name of the target platform. "
+ "This is useful for projects requiring values other than the default "
+ "(e.g. WIX projects). "
+ "These options are not supported by the Visual Studio 6 generator.";
}
cmTypeMacro(cmIncludeExternalMSProjectCommand, cmCommand);
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index cbbcbb0..908f3b0 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -204,6 +204,12 @@ bool cmListCommand::HandleGetCommand(std::vector<std::string> const& args)
this->Makefile->AddDefinition(variableName.c_str(), "NOTFOUND");
return true;
}
+ // FIXME: Add policy to make non-existing lists an error like empty lists.
+ if(varArgsExpanded.empty())
+ {
+ this->SetError("GET given empty list");
+ return false;
+ }
std::string value;
size_t cc;
@@ -318,7 +324,8 @@ bool cmListCommand::HandleInsertCommand(std::vector<std::string> const& args)
// expand the variable
int item = atoi(args[2].c_str());
std::vector<std::string> varArgsExpanded;
- if ( !this->GetList(varArgsExpanded, listName.c_str()) && item != 0)
+ if((!this->GetList(varArgsExpanded, listName.c_str())
+ || varArgsExpanded.empty()) && item != 0)
{
cmOStringStream str;
str << "index: " << item << " out of range (0, 0)";
@@ -544,6 +551,12 @@ bool cmListCommand::HandleRemoveAtCommand(
this->SetError("sub-command REMOVE_AT requires list to be present.");
return false;
}
+ // FIXME: Add policy to make non-existing lists an error like empty lists.
+ if(varArgsExpanded.empty())
+ {
+ this->SetError("REMOVE_AT given empty list");
+ return false;
+ }
size_t cc;
std::vector<size_t> removed;
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index bf0e997..ace7adf 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -99,6 +99,14 @@ void cmLocalVisualStudio10Generator
{
cmVS10XMLParser parser;
parser.ParseFile(path);
+
+ // if we can not find a GUID then create one
+ if(parser.GUID.empty())
+ {
+ this->GlobalGenerator->CreateGUID(name);
+ return;
+ }
+
std::string guidStoreName = name;
guidStoreName += "_GUID_CMAKE";
// save the GUID in the cache
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 99a4c95..5ab223b 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -320,7 +320,7 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
sourceGroup.AssignSource(*i);
// while we are at it, if it is a .rule file then for visual studio 6 we
// must generate it
- if ((*i)->GetExtension() == "rule")
+ if ((*i)->GetPropertyAsBool("__CMAKE_RULE"))
{
if(!cmSystemTools::FileExists(source.c_str()))
{
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e7e5eda..17bb5ed 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -883,7 +883,7 @@ cmMakefile::AddCustomCommandToTarget(const char* target,
}
//----------------------------------------------------------------------------
-void
+cmSourceFile*
cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
const std::vector<std::string>& depends,
const char* main_dependency,
@@ -897,7 +897,7 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
if(outputs.empty())
{
cmSystemTools::Error("Attempt to add a custom rule with no output!");
- return;
+ return 0;
}
// Validate custom commands. TODO: More strict?
@@ -910,7 +910,7 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
cmOStringStream e;
e << "COMMAND may not contain literal quotes:\n " << cl[0] << "\n";
this->IssueMessage(cmake::FATAL_ERROR, e.str());
- return;
+ return 0;
}
}
@@ -928,7 +928,7 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
{
// The existing custom command is identical. Silently ignore
// the duplicate.
- return;
+ return file;
}
else
{
@@ -948,17 +948,11 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
// Generate a rule file if the main dependency is not available.
if(!file)
{
+ cmGlobalGenerator* gg = this->LocalGenerator->GetGlobalGenerator();
+
// Construct a rule file associated with the first output produced.
- std::string outName = outputs[0];
- outName += ".rule";
- const char* dir =
- this->LocalGenerator->GetGlobalGenerator()->
- GetCMakeCFGIntDir();
- if(dir && dir[0] == '$')
- {
- cmSystemTools::ReplaceString(outName, dir,
- cmake::GetCMakeFilesDirectory());
- }
+ std::string outName = gg->GenerateRuleFile(outputs[0]);
+
// Check if the rule file already exists.
file = this->GetSource(outName.c_str());
if(file && file->GetCustomCommand() && !replace)
@@ -970,11 +964,12 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
outName.c_str(),
"\" which already has a custom rule.");
}
- return;
+ return file;
}
// Create a cmSourceFile for the rule file.
file = this->GetOrCreateSource(outName.c_str(), true);
+ file->SetProperty("__CMAKE_RULE", "1");
}
// Always create the output sources and mark them generated.
@@ -1004,10 +999,11 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
cc->SetEscapeAllowMakeVars(true);
file->SetCustomCommand(cc);
}
+ return file;
}
//----------------------------------------------------------------------------
-void
+cmSourceFile*
cmMakefile::AddCustomCommandToOutput(const char* output,
const std::vector<std::string>& depends,
const char* main_dependency,
@@ -1019,9 +1015,9 @@ cmMakefile::AddCustomCommandToOutput(const char* output,
{
std::vector<std::string> outputs;
outputs.push_back(output);
- this->AddCustomCommandToOutput(outputs, depends, main_dependency,
- commandLines, comment, workingDir,
- replace, escapeOldStyle);
+ return this->AddCustomCommandToOutput(outputs, depends, main_dependency,
+ commandLines, comment, workingDir,
+ replace, escapeOldStyle);
}
//----------------------------------------------------------------------------
@@ -1054,13 +1050,14 @@ cmMakefile::AddCustomCommandOldStyle(const char* target,
{
// Get the name of this output.
const char* output = oi->c_str();
+ cmSourceFile* sf;
// Choose whether to use a main dependency.
if(sourceFiles.find(source))
{
// The source looks like a real file. Use it as the main dependency.
- this->AddCustomCommandToOutput(output, depends, source,
- commandLines, comment, 0);
+ sf = this->AddCustomCommandToOutput(output, depends, source,
+ commandLines, comment, 0);
}
else
{
@@ -1068,20 +1065,18 @@ cmMakefile::AddCustomCommandOldStyle(const char* target,
const char* no_main_dependency = 0;
std::vector<std::string> depends2 = depends;
depends2.push_back(source);
- this->AddCustomCommandToOutput(output, depends2, no_main_dependency,
- commandLines, comment, 0);
+ sf = this->AddCustomCommandToOutput(output, depends2, no_main_dependency,
+ commandLines, comment, 0);
}
// If the rule was added to the source (and not a .rule file),
// then add the source to the target to make sure the rule is
// included.
- std::string sname = output;
- sname += ".rule";
- if(!this->GetSource(sname.c_str()))
+ if(sf && !sf->GetPropertyAsBool("__CMAKE_RULE"))
{
if (this->Targets.find(target) != this->Targets.end())
{
- this->Targets[target].AddSource(source);
+ this->Targets[target].AddSourceFile(sf);
}
else
{
@@ -1976,7 +1971,6 @@ cmSourceFile *cmMakefile::GetSourceFileWithOutput(const char *cname)
// look through all the source files that have custom commands
// and see if the custom command has the passed source file as an output
- // keep in mind the possible .rule extension that may be tacked on
for(std::vector<cmSourceFile*>::const_iterator i =
this->SourceFiles.begin(); i != this->SourceFiles.end(); ++i)
{
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 960ba39..8b3bef7 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -175,20 +175,22 @@ public:
cmTarget::CustomCommandType type,
const char* comment, const char* workingDir,
bool escapeOldStyle = true);
- void AddCustomCommandToOutput(const std::vector<std::string>& outputs,
- const std::vector<std::string>& depends,
- const char* main_dependency,
- const cmCustomCommandLines& commandLines,
- const char* comment, const char* workingDir,
- bool replace = false,
- bool escapeOldStyle = true);
- void AddCustomCommandToOutput(const char* output,
- const std::vector<std::string>& depends,
- const char* main_dependency,
- const cmCustomCommandLines& commandLines,
- const char* comment, const char* workingDir,
- bool replace = false,
- bool escapeOldStyle = true);
+ cmSourceFile* AddCustomCommandToOutput(
+ const std::vector<std::string>& outputs,
+ const std::vector<std::string>& depends,
+ const char* main_dependency,
+ const cmCustomCommandLines& commandLines,
+ const char* comment, const char* workingDir,
+ bool replace = false,
+ bool escapeOldStyle = true);
+ cmSourceFile* AddCustomCommandToOutput(
+ const char* output,
+ const std::vector<std::string>& depends,
+ const char* main_dependency,
+ const cmCustomCommandLines& commandLines,
+ const char* comment, const char* workingDir,
+ bool replace = false,
+ bool escapeOldStyle = true);
void AddCustomCommandOldStyle(const char* target,
const std::vector<std::string>& outputs,
const std::vector<std::string>& depends,
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 2bad32c..cf2b427 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -47,8 +47,7 @@ cmNinjaNormalTargetGenerator(cmTarget* target)
{
// on Windows the output dir is already needed at compile time
// ensure the directory exists (OutDir test)
- std::string outpath = target->GetDirectory(this->GetConfigName());
- cmSystemTools::MakeDirectory(outpath.c_str());
+ EnsureDirectoryExists(target->GetDirectory(this->GetConfigName()));
}
}
@@ -56,6 +55,21 @@ cmNinjaNormalTargetGenerator::~cmNinjaNormalTargetGenerator()
{
}
+void
+cmNinjaNormalTargetGenerator
+::EnsureDirectoryExists(const std::string& dir)
+{
+ cmSystemTools::MakeDirectory(dir.c_str());
+}
+
+void
+cmNinjaNormalTargetGenerator
+::EnsureParentDirectoryExists(const std::string& path)
+{
+ EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path.c_str()));
+}
+
+
void cmNinjaNormalTargetGenerator::Generate()
{
if (!this->TargetLinkLanguage) {
@@ -380,13 +394,18 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
}
}
+ std::string path;
if (!this->TargetNameImport.empty()) {
- vars["TARGET_IMPLIB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
- targetOutputImplib.c_str(), cmLocalGenerator::SHELL);
+ path = this->GetLocalGenerator()->ConvertToOutputFormat(
+ targetOutputImplib.c_str(), cmLocalGenerator::SHELL);
+ vars["TARGET_IMPLIB"] = path;
+ EnsureParentDirectoryExists(path);
}
- vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
- this->GetTargetPDB().c_str(), cmLocalGenerator::SHELL);
+ path = this->GetLocalGenerator()->ConvertToOutputFormat(
+ this->GetTargetPDB().c_str(), cmLocalGenerator::SHELL);
+ vars["TARGET_PDB"] = path;
+ EnsureParentDirectoryExists(path);
std::vector<cmCustomCommand> *cmdLists[3] = {
&this->GetTarget()->GetPreBuildCommands(),
@@ -413,7 +432,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
// If we have any PRE_LINK commands, we need to go back to HOME_OUTPUT for
// the link commands.
if (!preLinkCmdLines.empty()) {
- std::string path = this->GetLocalGenerator()->ConvertToOutputFormat(
+ path = this->GetLocalGenerator()->ConvertToOutputFormat(
this->GetMakefile()->GetHomeOutputDirectory(),
cmLocalGenerator::SHELL);
preLinkCmdLines.push_back("cd " + path);
diff --git a/Source/cmNinjaNormalTargetGenerator.h b/Source/cmNinjaNormalTargetGenerator.h
index 1702caf..7acbe8f 100644
--- a/Source/cmNinjaNormalTargetGenerator.h
+++ b/Source/cmNinjaNormalTargetGenerator.h
@@ -35,6 +35,9 @@ private:
void WriteObjectLibStatement();
std::vector<std::string> ComputeLinkCmd();
+ void EnsureDirectoryExists(const std::string& dir);
+ void EnsureParentDirectoryExists(const std::string& path);
+
private:
// Target name info.
std::string TargetNameOut;
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 548fa74..89f03f6 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -104,6 +104,9 @@ public:
private:
HANDLE handle_;
};
+#elif defined(__APPLE__)
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
#endif
bool cmSystemTools::s_RunCommandHideConsole = false;
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index be866c3..63114d2 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -64,7 +64,8 @@ public:
"Specify libraries or flags to use when linking a given target. "
"The named <target> must have been created in the current directory "
"by a command such as add_executable or add_library. "
- "The remaining arguments specify library names or flags."
+ "The remaining arguments specify library names or flags. "
+ "Repeated calls for the same <target> append items in the order called."
"\n"
"If a library name matches that of another target in the project "
"a dependency will automatically be added in the build system to make "
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 6caaad1..9c25b0c 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -459,8 +459,9 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
command)
{
std::string sourcePath = source->GetFullPath();
- // the rule file seems to need to exist for vs10
- if (source->GetExtension() == "rule")
+ // VS 10 will always rebuild a custom command attached to a .rule
+ // file that doesn't exist so create the file explicitly.
+ if (source->GetPropertyAsBool("__CMAKE_RULE"))
{
if(!cmSystemTools::FileExists(sourcePath.c_str()))
{
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index f51712c..520cafb 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -123,7 +123,6 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
SET(KWSYS_USE_FundamentalType 1)
SET(KWSYS_USE_Terminal 1)
SET(KWSYS_USE_IOStream 1)
- SET(KWSYS_USE_DateStamp 1)
SET(KWSYS_USE_String 1)
SET(KWSYS_USE_SystemInformation 1)
SET(KWSYS_USE_CPU 1)
@@ -695,7 +694,7 @@ ENDFOREACH(cpp)
# Add selected C components.
FOREACH(c
- Process Base64 FundamentalType MD5 Terminal System DateStamp String CPU
+ Process Base64 FundamentalType MD5 Terminal System String CPU
)
IF(KWSYS_USE_${c})
# Use the corresponding header file.
diff --git a/Source/kwsys/DateStamp.h.in b/Source/kwsys/DateStamp.h.in
deleted file mode 100644
index c3d0099..0000000
--- a/Source/kwsys/DateStamp.h.in
+++ /dev/null
@@ -1,42 +0,0 @@
-/*============================================================================
- KWSys - Kitware System Library
- Copyright 2000-2009 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.
-============================================================================*/
-#ifndef @KWSYS_NAMESPACE@_DateStamp_h
-#define @KWSYS_NAMESPACE@_DateStamp_h
-
-/** Version date integer year. The format is CCYY. */
-#define @KWSYS_NAMESPACE@_DATE_STAMP_YEAR @KWSYS_DATE_STAMP_YEAR@
-
-/** Version date integer month. The format is MM. */
-#define @KWSYS_NAMESPACE@_DATE_STAMP_MONTH @KWSYS_DATE_STAMP_MONTH@
-
-/** Version date integer day. The format is DD. */
-#define @KWSYS_NAMESPACE@_DATE_STAMP_DAY @KWSYS_DATE_STAMP_DAY@
-
-/** Version date full integer. The format is CCYYMMDD. */
-#define @KWSYS_NAMESPACE@_DATE_STAMP_FULL @KWSYS_DATE_STAMP_YEAR@@KWSYS_DATE_STAMP_MONTH@@KWSYS_DATE_STAMP_DAY@
-
-/** Version date string year. The format is "CCYY". */
-#define @KWSYS_NAMESPACE@_DATE_STAMP_STRING_YEAR "@KWSYS_DATE_STAMP_YEAR@"
-
-/** Version date string month. The format is "MM". */
-#define @KWSYS_NAMESPACE@_DATE_STAMP_STRING_MONTH "@KWSYS_DATE_STAMP_MONTH@"
-
-/** Version date string day. The format is "DD". */
-#define @KWSYS_NAMESPACE@_DATE_STAMP_STRING_DAY "@KWSYS_DATE_STAMP_DAY@"
-
-/** Version date full string. The format is "CCYYMMDD". */
-#define @KWSYS_NAMESPACE@_DATE_STAMP_STRING_FULL "@KWSYS_DATE_STAMP_YEAR@@KWSYS_DATE_STAMP_MONTH@@KWSYS_DATE_STAMP_DAY@"
-
-/** Version date formatted string. The format is "CCYY-MM-DD". */
-#define @KWSYS_NAMESPACE@_DATE_STAMP_STRING "@KWSYS_DATE_STAMP_YEAR@-@KWSYS_DATE_STAMP_MONTH@-@KWSYS_DATE_STAMP_DAY@"
-
-#endif
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
deleted file mode 100644
index 3d0f03d..0000000
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ /dev/null
@@ -1,21 +0,0 @@
-# Do not edit! Generated by kwsysDateStamp.py
-#=============================================================================
-# KWSys - Kitware System Library
-# Copyright 2000-2009 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.
-#=============================================================================
-
-# KWSys version date year component. Format is CCYY.
-SET(KWSYS_DATE_STAMP_YEAR 2012)
-
-# KWSys version date month component. Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 04)
-
-# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 20)
diff --git a/Source/kwsys/kwsysDateStamp.py b/Source/kwsys/kwsysDateStamp.py
deleted file mode 100755
index bd2e49a..0000000
--- a/Source/kwsys/kwsysDateStamp.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/python
-#=============================================================================
-# KWSys - Kitware System Library
-# Copyright 2000-2009 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.
-#=============================================================================
-
-import sys,os
-import time
-
-# Get the path to the directory containing this script.
-if __name__ == '__main__':
- selfdir = os.path.abspath(sys.path[0] or os.curdir)
-else:
- selfdir = os.path.abspath(os.path.dirname(__file__))
-
-# Open the CMake code file.
-fname = os.path.join(selfdir, 'kwsysDateStamp.cmake')
-fout = open(fname, 'w');
-
-# Get the current time.
-ct = time.localtime()
-
-# Write the CMake code describing the date.
-fout.write("""# Do not edit! Generated by kwsysDateStamp.py
-#=============================================================================
-# KWSys - Kitware System Library
-# Copyright 2000-2009 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.
-#=============================================================================
-
-# KWSys version date year component. Format is CCYY.
-SET(KWSYS_DATE_STAMP_YEAR %04u)
-
-# KWSys version date month component. Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH %02u)
-
-# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY %02u)
-""" % (ct.tm_year, ct.tm_mon, ct.tm_mday))
-
-fout.close()
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
index 6604208..fc65e58 100644
--- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
+++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
@@ -71,7 +71,7 @@ endmacro(check_version_string)
# reported.
foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HSPELL
- JASPER LIBXML2 LIBXSLT PERL PostgreSQL TIFF ZLIB)
+ JASPER LIBXML2 LIBXSLT PERL PKG_CONFIG PostgreSQL TIFF ZLIB)
check_version_string(${VTEST} ${VTEST}_VERSION_STRING)
endforeach(VTEST)
@@ -82,4 +82,3 @@ endforeach(VTEST)
check_version_string(PYTHONINTERP PYTHON_VERSION_STRING)
check_version_string(SUBVERSION Subversion_VERSION_SVN)
-check_version_string(PKGCONFIG PKG_CONFIG_VERSION_STRING)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 0b79efa..1c6db39 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -24,11 +24,16 @@
# 4.) Create a <SubTest>.cmake file for each sub-test named above
# containing the actual test code. Optionally create files
# containing expected test results:
-# <SubTest>-result.txt = Process result expected if not "0"
-# <SubTest>-stdout.txt = Regex matching expected stdout content
-# <SubTest>-stderr.txt = Regex matching expected stderr content
+# <SubTest>-result.txt = Process result expected if not "0"
+# <SubTest>-stdout.txt = Regex matching expected stdout content
+# <SubTest>-stderr.txt = Regex matching expected stderr content
+# <SubTest>-check.cmake = Custom result check
# Note that trailing newlines will be stripped from actual test
# output before matching against the stdout and stderr expressions.
+# The code in <SubTest>-check.cmake may use variables
+# RunCMake_TEST_SOURCE_DIR = Top of test source tree
+# RunCMake_TEST_BINARY_DIR = Top of test binary tree
+# and an failure must store a message in RunCMake_TEST_FAILED.
macro(add_RunCMake_test test)
add_test(RunCMake.${test} ${CMAKE_CMAKE_COMMAND}
@@ -44,3 +49,8 @@ add_RunCMake_test(ObjectLibrary)
add_RunCMake_test(build_command)
add_RunCMake_test(find_package)
+add_RunCMake_test(list)
+
+if("${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [^6]")
+ add_RunCMake_test(include_external_msproject)
+endif()
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index 2639463..c3c161a 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -25,14 +25,14 @@ function(run_cmake test)
unset(expect_std${o})
endif()
endforeach()
- set(source_dir "${top_src}")
- set(binary_dir "${top_bin}/${test}-build")
- file(REMOVE_RECURSE "${binary_dir}")
- file(MAKE_DIRECTORY "${binary_dir}")
+ set(RunCMake_TEST_SOURCE_DIR "${top_src}")
+ set(RunCMake_TEST_BINARY_DIR "${top_bin}/${test}-build")
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
execute_process(
- COMMAND ${CMAKE_COMMAND} "${source_dir}"
+ COMMAND ${CMAKE_COMMAND} "${RunCMake_TEST_SOURCE_DIR}"
-G "${RunCMake_GENERATOR}" -DRunCMake_TEST=${test}
- WORKING_DIRECTORY "${binary_dir}"
+ WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}"
OUTPUT_VARIABLE actual_stdout
ERROR_VARIABLE actual_stderr
RESULT_VARIABLE actual_result
@@ -53,6 +53,11 @@ function(run_cmake test)
endif()
endif()
endforeach()
+ unset(RunCMake_TEST_FAILED)
+ include(${top_src}/${test}-check.cmake OPTIONAL)
+ if(RunCMake_TEST_FAILED)
+ set(msg "${RunCMake_TEST_FAILED}\n${msg}")
+ endif()
if(msg)
string(REGEX REPLACE "\n" "\n actual-out> " actual_out " actual-out> ${actual_stdout}")
string(REGEX REPLACE "\n" "\n actual-err> " actual_err " actual-err> ${actual_stderr}")
diff --git a/Tests/RunCMake/include_external_msproject/CMakeLists.txt b/Tests/RunCMake/include_external_msproject/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/include_external_msproject/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake b/Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake
new file mode 100644
index 0000000..68dec4c
--- /dev/null
+++ b/Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake
@@ -0,0 +1 @@
+check_project(CustomGuid external "aaa-bbb-ccc-000" "" "")
diff --git a/Tests/RunCMake/include_external_msproject/CustomGuid.cmake b/Tests/RunCMake/include_external_msproject/CustomGuid.cmake
new file mode 100644
index 0000000..1dbe7da
--- /dev/null
+++ b/Tests/RunCMake/include_external_msproject/CustomGuid.cmake
@@ -0,0 +1,2 @@
+include_external_msproject(external external.project
+ GUID aaa-bbb-ccc-000)
diff --git a/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake b/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake
new file mode 100644
index 0000000..614712e
--- /dev/null
+++ b/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake
@@ -0,0 +1 @@
+check_project(CustomGuidTypePlatform external "aaa-bbb-ccc-111" "aaa-bbb-ccc-ddd-eee" "Custom Platform")
diff --git a/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform.cmake b/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform.cmake
new file mode 100644
index 0000000..ee4db65
--- /dev/null
+++ b/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform.cmake
@@ -0,0 +1,5 @@
+# Test all optional parameters are set.
+include_external_msproject(external external.project
+ GUID aaa-bbb-ccc-111
+ TYPE aaa-bbb-ccc-ddd-eee
+ PLATFORM "Custom Platform")
diff --git a/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake b/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake
new file mode 100644
index 0000000..054eeb0
--- /dev/null
+++ b/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake
@@ -0,0 +1 @@
+check_project(CustomTypePlatform external "" "aaa-bbb-ccc-ddd-eee" "Custom Platform")
diff --git a/Tests/RunCMake/include_external_msproject/CustomTypePlatform.cmake b/Tests/RunCMake/include_external_msproject/CustomTypePlatform.cmake
new file mode 100644
index 0000000..8c76adb
--- /dev/null
+++ b/Tests/RunCMake/include_external_msproject/CustomTypePlatform.cmake
@@ -0,0 +1,3 @@
+include_external_msproject(external external.project
+ TYPE aaa-bbb-ccc-ddd-eee
+ PLATFORM "Custom Platform")
diff --git a/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake b/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake
new file mode 100644
index 0000000..90710f9
--- /dev/null
+++ b/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake
@@ -0,0 +1,6 @@
+include(RunCMake)
+include(${CMAKE_CURRENT_LIST_DIR}/check_utils.cmake)
+
+run_cmake(CustomGuid)
+run_cmake(CustomTypePlatform)
+run_cmake(CustomGuidTypePlatform)
diff --git a/Tests/RunCMake/include_external_msproject/check_utils.cmake b/Tests/RunCMake/include_external_msproject/check_utils.cmake
new file mode 100644
index 0000000..7d6b8f8
--- /dev/null
+++ b/Tests/RunCMake/include_external_msproject/check_utils.cmake
@@ -0,0 +1,109 @@
+# Check that file contains line that matches regular expression.
+# Sets IS_FOUND variable to TRUE if found and to FALSE otherwise.
+macro(check_line_exists TARGET_FILE REG_EXP_REF)
+ set(IS_FOUND "FALSE")
+
+ file(STRINGS ${TARGET_FILE} FOUND_LINE LIMIT_COUNT 1 REGEX "${${REG_EXP_REF}}")
+ list(LENGTH FOUND_LINE _VAR_LEN)
+
+ if(_VAR_LEN GREATER 0)
+ set(IS_FOUND "TRUE")
+ endif(_VAR_LEN GREATER 0)
+endmacro(check_line_exists TARGET_FILE REG_EXP_REF)
+
+# Search and parse project section line by project name.
+# If search was successful stores found type and guid into FOUND_TYPE and FOUND_GUID variables respectively.
+# Sets IS_FOUND variable to TRUE if found and to FALSE otherwise.
+macro(parse_project_section TARGET_FILE PROJECT_NAME)
+ set(REG_EXP "^Project\\(\\\"{(.+)}\\\"\\) = \\\"${PROJECT_NAME}\\\", \\\".+\\..+\\\", \\\"{(.+)}\\\"$")
+
+ check_line_exists(${TARGET_FILE} REG_EXP)
+ if(NOT IS_FOUND)
+ return()
+ endif(NOT IS_FOUND)
+
+ string(REGEX REPLACE "${REG_EXP}" "\\1;\\2" _GUIDS "${FOUND_LINE}")
+
+ list(GET _GUIDS 0 FOUND_TYPE)
+ list(GET _GUIDS 1 FOUND_GUID)
+endmacro(parse_project_section TARGET_FILE PROJECT_NAME)
+
+# Search project section line by project name and type.
+# Returns TRUE if found and FALSE otherwise
+function(check_project_type TARGET_FILE PROJECT_NAME PROJECT_TYPE RESULT)
+ set(${RESULT} "FALSE" PARENT_SCOPE)
+
+ parse_project_section(${TARGET_FILE} ${PROJECT_NAME})
+ if(IS_FOUND AND FOUND_TYPE STREQUAL PROJECT_TYPE)
+ set(${RESULT} "TRUE" PARENT_SCOPE)
+ endif(IS_FOUND AND FOUND_TYPE STREQUAL PROJECT_TYPE)
+endfunction(check_project_type TARGET_FILE PROJECT_NAME PROJECT_TYPE RESULT)
+
+
+# Search project section line by project name and id.
+# Returns TRUE if found and FALSE otherwise
+function(check_project_guid TARGET_FILE PROJECT_NAME PROJECT_GUID RESULT)
+ set(${RESULT} "FALSE" PARENT_SCOPE)
+
+ parse_project_section(${TARGET_FILE} ${PROJECT_NAME})
+ if(IS_FOUND AND FOUND_GUID STREQUAL PROJECT_GUID)
+ set(${RESULT} "TRUE" PARENT_SCOPE)
+ endif(IS_FOUND AND FOUND_GUID STREQUAL PROJECT_GUID)
+endfunction(check_project_guid TARGET_FILE PROJECT_NAME PROJECT_GUID RESULT)
+
+
+# Search project's build configuration line by project name and target platform name.
+# Returns TRUE if found and FALSE otherwise
+function(check_custom_platform TARGET_FILE PROJECT_NAME PLATFORM_NAME RESULT)
+ set(${RESULT} "FALSE" PARENT_SCOPE)
+
+ # extract project guid
+ parse_project_section(${TARGET_FILE} ${PROJECT_NAME})
+ if(NOT IS_FOUND)
+ return()
+ endif(NOT IS_FOUND)
+
+ # probably whould be better to use configuration name
+ # extracted from CMAKE_CONFIGURATION_TYPES than just hardcoded "Debug" instead
+ set(REG_EXP "^(\t)*\\{${FOUND_GUID}\\}\\.Debug[^ ]*\\.ActiveCfg = Debug\\|${PLATFORM_NAME}$")
+ check_line_exists(${TARGET_FILE} REG_EXP)
+
+ set(${RESULT} ${IS_FOUND} PARENT_SCOPE)
+endfunction(check_custom_platform TARGET_FILE PLATFORM_NAME RESULT)
+
+# RunCMake test check helper
+function(check_project test name guid type platform)
+ set(sln "${RunCMake_TEST_BINARY_DIR}/${test}.sln")
+ set(sep "")
+ set(failed "")
+ if(NOT type)
+ set(type 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942)
+ endif()
+ if(NOT platform)
+ if("${RunCMake_GENERATOR}" MATCHES "Win64")
+ set(platform "x64")
+ else()
+ set(platform "Win32")
+ endif()
+ endif()
+ if(guid)
+ check_project_guid("${sln}" "${name}" "${guid}" passed_guid)
+ if(NOT passed_guid)
+ set(failed "${failed}${sep}${name} solution has no project with expected GUID=${guid}")
+ set(sep "\n")
+ endif()
+ else()
+ set(passed_guid 1)
+ endif()
+ check_project_type("${sln}" "${name}" "${type}" passed_type)
+ if(NOT passed_type)
+ set(failed "${failed}${sep}${name} solution has no project with expected TYPE=${type}")
+ set(sep "\n")
+ endif()
+ check_custom_platform("${sln}" "${name}" "${platform}" passed_platform)
+ if(NOT passed_platform)
+ set(failed "${failed}${sep}${name} solution has no project with expected PLATFORM=${platform}")
+ set(sep "\n")
+ endif()
+ set(RunCMake_TEST_FAILED "${failed}" PARENT_SCOPE)
+endfunction()
diff --git a/Tests/RunCMake/include_external_msproject/main.cpp b/Tests/RunCMake/include_external_msproject/main.cpp
new file mode 100644
index 0000000..9198103
--- /dev/null
+++ b/Tests/RunCMake/include_external_msproject/main.cpp
@@ -0,0 +1,3 @@
+void main()
+{
+}
diff --git a/Tests/RunCMake/list/CMakeLists.txt b/Tests/RunCMake/list/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/list/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/list/EmptyGet0-result.txt b/Tests/RunCMake/list/EmptyGet0-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/list/EmptyGet0-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/list/EmptyGet0-stderr.txt b/Tests/RunCMake/list/EmptyGet0-stderr.txt
new file mode 100644
index 0000000..0c61b01
--- /dev/null
+++ b/Tests/RunCMake/list/EmptyGet0-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at EmptyGet0.cmake:2 \(list\):
+ list GET given empty list
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/EmptyGet0.cmake b/Tests/RunCMake/list/EmptyGet0.cmake
new file mode 100644
index 0000000..4947108
--- /dev/null
+++ b/Tests/RunCMake/list/EmptyGet0.cmake
@@ -0,0 +1,2 @@
+set(mylist "")
+list(GET mylist 0 result)
diff --git a/Tests/RunCMake/list/EmptyInsert-1-result.txt b/Tests/RunCMake/list/EmptyInsert-1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/list/EmptyInsert-1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/list/EmptyInsert-1-stderr.txt b/Tests/RunCMake/list/EmptyInsert-1-stderr.txt
new file mode 100644
index 0000000..0900ff9
--- /dev/null
+++ b/Tests/RunCMake/list/EmptyInsert-1-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at EmptyInsert-1.cmake:2 \(list\):
+ list index: -1 out of range \(0, 0\)
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/EmptyInsert-1.cmake b/Tests/RunCMake/list/EmptyInsert-1.cmake
new file mode 100644
index 0000000..140da5d
--- /dev/null
+++ b/Tests/RunCMake/list/EmptyInsert-1.cmake
@@ -0,0 +1,2 @@
+set(mylist "")
+list(INSERT mylist -1 x)
diff --git a/Tests/RunCMake/list/EmptyRemoveAt0-result.txt b/Tests/RunCMake/list/EmptyRemoveAt0-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/list/EmptyRemoveAt0-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt b/Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt
new file mode 100644
index 0000000..b24a0ed
--- /dev/null
+++ b/Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at EmptyRemoveAt0.cmake:2 \(list\):
+ list REMOVE_AT given empty list
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/EmptyRemoveAt0.cmake b/Tests/RunCMake/list/EmptyRemoveAt0.cmake
new file mode 100644
index 0000000..d6a3e85
--- /dev/null
+++ b/Tests/RunCMake/list/EmptyRemoveAt0.cmake
@@ -0,0 +1,2 @@
+set(mylist "")
+list(REMOVE_AT mylist 0)
diff --git a/Tests/RunCMake/list/RunCMakeTest.cmake b/Tests/RunCMake/list/RunCMakeTest.cmake
new file mode 100644
index 0000000..555051d
--- /dev/null
+++ b/Tests/RunCMake/list/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(EmptyGet0)
+run_cmake(EmptyRemoveAt0)
+run_cmake(EmptyInsert-1)
diff --git a/Utilities/GitSetup/setup-stage b/Utilities/GitSetup/setup-stage
index ef53b99..323e47a 100755
--- a/Utilities/GitSetup/setup-stage
+++ b/Utilities/GitSetup/setup-stage
@@ -37,17 +37,43 @@ die() {
cd "${BASH_SOURCE%/*}" &&
# Load the project configuration.
-url=$(git config -f config --get stage.url) &&
-pushurl=$(git config -f config --get stage.pushurl || echo '') ||
+fetchurl=$(git config -f config --get stage.url) &&
+pushurl_=$(git config -f config --get stage.pushurl || echo '') &&
+remote=$(git config -f config --get stage.remote || echo 'stage') ||
die 'This project is not configured to use a topic stage.'
-# Configure the remote if necessary.
-if git config remote.stage.url >/dev/null; then
- echo 'Topic stage already configured.'
+# Get current stage push URL.
+pushurl=$(git config --get remote."$remote".pushurl ||
+ git config --get remote."$remote".url || echo '') &&
+
+# Tell user about current configuration.
+if test -n "$pushurl"; then
+ echo 'Remote "'"$remote"'" is currently configured to push to
+
+ '"$pushurl"'
+' &&
+ read -ep 'Reconfigure Topic Stage? [y/N]: ' ans &&
+ if [ "$ans" == "y" ] || [ "$ans" == "Y" ]; then
+ setup=1
+ else
+ setup=''
+ fi
else
+ setup=1
+fi
+
+# Perform setup if necessary.
+if test -n "$setup"; then
echo 'Setting up the topic stage...' &&
- git remote add stage "$url" &&
- if test -n "$pushurl"; then
- git config remote.stage.pushurl "$pushurl"
- fi
-fi || die 'Could not add the topic stage remote.'
+ if test -z "$pushurl"; then
+ git remote add "$remote" "$fetchurl"
+ else
+ git config remote."$remote".url "$fetchurl"
+ fi &&
+ pushurl="${pushurl_}" &&
+ git config remote."$remote".pushurl "$pushurl" &&
+ echo 'Remote "'"$remote"'" is now configured to push to
+
+ '"$pushurl"'
+'
+fi || die 'Could not configure the topic stage remote.'
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
index 7f7a69f..ebf28ae 100644
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -2,7 +2,7 @@
#
PROJECT(libarchive C)
#
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake")
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin)
diff --git a/Utilities/cmlibarchive/libarchive/archive_endian.h b/Utilities/cmlibarchive/libarchive/archive_endian.h
index 1dd8536..c3c78b3 100644
--- a/Utilities/cmlibarchive/libarchive/archive_endian.h
+++ b/Utilities/cmlibarchive/libarchive/archive_endian.h
@@ -44,9 +44,12 @@
* - Watcom C++ in C code. (For any version?)
* - SGI MIPSpro
* - Microsoft Visual C++ 6.0 (supposedly newer versions too)
+ * - IBM VisualAge 6 (XL v6)
*/
#if defined(__WATCOMC__) || defined(__sgi) || defined(__hpux) || defined(__BORLANDC__)
#define inline
+#elif defined(__IBMC__) && __IBMC__ < 700
+#define inline
#elif defined(_MSC_VER) || defined(__osf__)
#define inline __inline
#endif
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c
index 87136a6..0b9aaf9 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c
@@ -197,7 +197,7 @@ struct isofile {
enum {
NO = 0,
BOOT_CATALOG,
- BOOT_IMAGE,
+ BOOT_IMAGE
} boot;
/*
@@ -850,7 +850,7 @@ enum dir_rec_type {
DIR_REC_VD, /* Stored in Volume Descriptor. */
DIR_REC_SELF, /* Stored as Current Directory. */
DIR_REC_PARENT, /* Stored as Parent Directory. */
- DIR_REC_NORMAL, /* Stored as Child. */
+ DIR_REC_NORMAL /* Stored as Child. */
};
/*
@@ -860,7 +860,7 @@ enum vdc {
VDC_STD,
VDC_LOWERCASE,
VDC_UCS2,
- VDC_UCS2_DIRECT,
+ VDC_UCS2_DIRECT
};
/*
@@ -897,7 +897,7 @@ struct idr {
enum char_type {
A_CHAR,
- D_CHAR,
+ D_CHAR
};
@@ -3989,7 +3989,7 @@ enum keytype {
KEY_FLG,
KEY_STR,
KEY_INT,
- KEY_HEX,
+ KEY_HEX
};
static void
set_option_info(struct archive_string *info, int *opt, const char *key,