diff options
320 files changed, 9372 insertions, 2470 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bbd7cb9..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) @@ -422,26 +421,13 @@ ENDIF() # The main section of the CMakeLists file # #----------------------------------------------------------------------- -# The CMake version number. -SET(CMake_VERSION_MAJOR 2) -SET(CMake_VERSION_MINOR 8) -SET(CMake_VERSION_PATCH 8) -SET(CMake_VERSION_TWEAK 0) -SET(CMake_VERSION_RC 2) - -# Releases define a tweak level. -IF(DEFINED CMake_VERSION_TWEAK) +INCLUDE(Source/CMakeVersion.cmake) +# Releases define a small tweak level. +IF("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000) SET(CMake_VERSION_IS_RELEASE 1) SET(CMake_VERSION_SOURCE "") ELSE() SET(CMake_VERSION_IS_RELEASE 0) - - # Use the date as the tweak level. - INCLUDE(${CMake_SOURCE_DIR}/Source/kwsys/kwsysDateStamp.cmake) - SET(CMake_VERSION_TWEAK - "${KWSYS_DATE_STAMP_YEAR}${KWSYS_DATE_STAMP_MONTH}${KWSYS_DATE_STAMP_DAY}" - ) - INCLUDE(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake) ENDIF() @@ -633,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/ChangeLog.manual b/ChangeLog.manual index 54428be..691ff94 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,22 @@ +Changes in CMake 2.8.8 (since 2.8.8-rc2) +---------------------------------------- +Brad King (1): + CheckIncludeFiles: Shorten check description message + +David Cole (3): + CPackNSIS: Rewrite variable documentation to make it more readable. + OS X: Use correct extra path when searching for applicaton bundles (#13066) + OS X: Mark find_program results as advanced + +Eric NOULARD (1): + Fix some doc typo and add an undocumented var. + +Kashif Rasul (1): + OS X: Use OSX_DEVELOPER_ROOT for app search path (#13066) + +Rolf Eike Beer (1): + FindBoost: add support for 1.49 and 1.50 + Changes in CMake 2.8.8-rc2 (since 2.8.8-rc1) -------------------------------------------- Alex Neundorf (4): 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/BasicConfigVersion-AnyNewerVersion.cmake.in b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in index cf53db8..9f7f03e 100644 --- a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in +++ b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in @@ -18,6 +18,11 @@ else() endif() endif() +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") + return() +endif() + # check that the installed version has the same 32/64bit-ness as the one which is currently searching: if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") diff --git a/Modules/BasicConfigVersion-ExactVersion.cmake.in b/Modules/BasicConfigVersion-ExactVersion.cmake.in index c610baa..63f3f03 100644 --- a/Modules/BasicConfigVersion-ExactVersion.cmake.in +++ b/Modules/BasicConfigVersion-ExactVersion.cmake.in @@ -34,6 +34,11 @@ if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") endif() +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") + return() +endif() + # check that the installed version has the same 32/64bit-ness as the one which is currently searching: if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") diff --git a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in index 2317fdb..7bcea88 100644 --- a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in +++ b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in @@ -33,6 +33,11 @@ else() endif() +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") + return() +endif() + # check that the installed version has the same 32/64bit-ness as the one which is currently searching: if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in index b14cf34..ded8cf6 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -48,3 +48,6 @@ SET(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@") SET(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@") SET(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@") + +@SET_CMAKE_CMCLDEPS_EXECUTABLE@ +@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@ diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake index 6b5efba..afac7a4 100644 --- a/Modules/CMakeCInformation.cmake +++ b/Modules/CMakeCInformation.cmake @@ -164,7 +164,7 @@ INCLUDE(CMakeCommonLanguageInclude) # create a C shared library IF(NOT CMAKE_C_CREATE_SHARED_LIBRARY) SET(CMAKE_C_CREATE_SHARED_LIBRARY - "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") ENDIF(NOT CMAKE_C_CREATE_SHARED_LIBRARY) # create a C shared module just copy the shared library rule diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index bc3bc2e..5b6376a 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -49,3 +49,6 @@ SET(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@") SET(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@") SET(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@") + +@SET_CMAKE_CMCLDEPS_EXECUTABLE@ +@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@ diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake index 25abb8c..9dc9cbd 100644 --- a/Modules/CMakeCXXInformation.cmake +++ b/Modules/CMakeCXXInformation.cmake @@ -100,6 +100,18 @@ IF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS) SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS) +IF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC) + SET(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC}) +ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC) + +IF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE) + SET(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE}) +ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE) + +IF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL) + SET(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL}) +ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL) + IF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS) SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) ENDIF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS) @@ -242,7 +254,7 @@ INCLUDE(CMakeCommonLanguageInclude) # create a shared C++ library IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") ENDIF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) # create a c++ shared module copy the shared library rule by default diff --git a/Modules/CMakeClDeps.cmake b/Modules/CMakeClDeps.cmake new file mode 100644 index 0000000..6815e2b --- /dev/null +++ b/Modules/CMakeClDeps.cmake @@ -0,0 +1,37 @@ + +#============================================================================= +# Copyright 2012 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# +# When using Ninja cl.exe is wrapped by cmcldeps to extract the included +# headers for dependency tracking. +# +# cmcldeps path is set, and cmcldeps needs to know the localized string +# in front of each include path, so it can remove it. +# + +IF(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND) + STRING(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND}) + SET(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes) + FILE(WRITE ${showdir}/foo.h "\n") + FILE(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n") + EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c + WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE showOut) + STRING(REPLACE main.c "" showOut1 ${showOut}) + STRING(REPLACE "/" "\\" header1 ${showdir}/foo.h) + STRING(TOLOWER ${header1} header2) + STRING(REPLACE ${header2} "" showOut2 ${showOut1}) + STRING(REPLACE "\n" "" showOut3 ${showOut2}) + SET(SET_CMAKE_CMCLDEPS_EXECUTABLE "SET(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")") + SET(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "SET(CMAKE_CL_SHOWINCLUDE_PREFIX \"${showOut3}\")") +ENDIF() diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index e2e268f..9028e8e 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -32,7 +32,7 @@ # _CMAKE_TOOLCHAIN_PREFIX IF(NOT CMAKE_C_COMPILER) - SET(CMAKE_CXX_COMPILER_INIT NOTFOUND) + SET(CMAKE_C_COMPILER_INIT NOTFOUND) # prefer the environment variable CC IF($ENV{CC} MATCHES ".+") @@ -165,9 +165,7 @@ ENDIF (CMAKE_CROSSCOMPILING AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _CMAKE_TOOLCHAIN_PREFIX) - - - +INCLUDE(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake) INCLUDE(CMakeFindBinUtils) IF(MSVC_C_ARCHITECTURE_ID) SET(SET_MSVC_C_ARCHITECTURE_ID diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 8298369..7f8f3ec 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -173,6 +173,7 @@ ENDIF (CMAKE_CROSSCOMPILING AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _CMAKE_TOOLCHAIN_PREFIX) +INCLUDE(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake) INCLUDE(CMakeFindBinUtils) IF(MSVC_CXX_ARCHITECTURE_ID) SET(SET_MSVC_CXX_ARCHITECTURE_ID diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 686cc9b..67f5a59 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -302,12 +302,6 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang) TIMEOUT 10 ) - IF("${lang}" STREQUAL "ASM") - MESSAGE(STATUS "Checked for ${vendor}") - MESSAGE(STATUS " Output: -${output}-") - MESSAGE(STATUS " Result: -${result}-") - ENDIF("${lang}" STREQUAL "ASM") - IF("${output}" MATCHES "${regex}") FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" " diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake index 1b4532d..455f95f 100644 --- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake +++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake @@ -80,15 +80,10 @@ ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang) SET(_orig_lc_all $ENV{LC_ALL}) SET(_orig_lc_messages $ENV{LC_MESSAGES}) SET(_orig_lang $ENV{LANG}) -IF(_orig_lc_all) - SET(ENV{LC_ALL} C) -ENDIF() -IF(_orig_lc_messages) - SET(ENV{LC_MESSAGES} C) -ENDIF() -IF(_orig_lang) - SET(ENV{LANG} C) -ENDIF() + +SET(ENV{LC_ALL} C) +SET(ENV{LC_MESSAGES} C) +SET(ENV{LANG} C) # Now check for C, works for gcc and Intel compiler at least IF (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS) @@ -109,12 +104,6 @@ IF (NOT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS) ENDIF () # Restore original LC_ALL, LC_MESSAGES, and LANG -IF(_orig_lc_all) - SET(ENV{LC_ALL} ${_orig_lc_all}) -ENDIF() -IF(_orig_lc_messages) - SET(ENV{LC_MESSAGES} ${_orig_lc_messages}) -ENDIF() -IF(_orig_lang) - SET(ENV{LANG} ${_orig_lang}) -ENDIF() +SET(ENV{LC_ALL} ${_orig_lc_all}) +SET(ENV{LC_MESSAGES} ${_orig_lc_messages}) +SET(ENV{LANG} ${_orig_lang}) diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake index 76cf34e..d962f4c 100644 --- a/Modules/CMakeFortranInformation.cmake +++ b/Modules/CMakeFortranInformation.cmake @@ -74,6 +74,18 @@ ENDIF() # catch any modules SET(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1) +IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC) + SET(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC}) +ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC) + +IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE) + SET(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE}) +ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE) + +IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL) + SET(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL}) +ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL) + # Create a set of shared library variable specific to Fortran # For 90% of the systems, these are the same flags as the C versions # so if these are not set just copy the flags from the c version @@ -171,7 +183,7 @@ INCLUDE(CMakeCommonLanguageInclude) # create a Fortran shared library IF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY) SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY - "<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + "<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY) # create a Fortran shared module just copy the shared library rule diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake index ee8040e..0ccbfac 100644 --- a/Modules/CMakeGenericSystem.cmake +++ b/Modules/CMakeGenericSystem.cmake @@ -12,7 +12,7 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") # -rpath @@ -42,7 +42,7 @@ SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL SET (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL "If set, runtime paths are not added when installing shared libraries, but are added when building.") -SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.") +SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.") IF(CMAKE_GENERATOR MATCHES "Makefiles") SET(CMAKE_COLOR_MAKEFILE ON CACHE BOOL @@ -60,6 +60,12 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") ENDIF(CMAKE_GENERATOR MATCHES "Unix Makefiles") ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") +IF(CMAKE_GENERATOR MATCHES "Ninja") + SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL + "Enable/Disable output of compile commands during generation." + ) + MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS) +ENDIF(CMAKE_GENERATOR MATCHES "Ninja") # GetDefaultWindowsPrefixBase # @@ -77,6 +83,8 @@ function(GetDefaultWindowsPrefixBase var) # if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)") set(arch_hint "x64") + elseif("${CMAKE_GENERATOR}" MATCHES "ARM") + set(arch_hint "ARM") elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") set(arch_hint "x64") elseif("$ENV{LIB}" MATCHES "(amd64|ia64)") @@ -168,6 +176,10 @@ ELSE(CMAKE_HOST_UNIX) SET(CMAKE_GENERIC_PROGRAM_FILES) ENDIF(CMAKE_HOST_UNIX) +# Set a variable which will be used as component name in install() commands +# where no COMPONENT has been given: +SET(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "Unspecified") + MARK_AS_ADVANCED( CMAKE_SKIP_RPATH CMAKE_SKIP_INSTALL_RPATH diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in index b69bf63..6341dca 100644 --- a/Modules/CMakePlatformId.h.in +++ b/Modules/CMakePlatformId.h.in @@ -97,6 +97,9 @@ # elif defined(_M_IX86) # define ARCHITECTURE_ID "X86" +# elif defined(_M_ARM) +# define ARCHITECTURE_ID "ARM" + # else /* unknown architecture */ # define ARCHITECTURE_ID "" # endif diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 571770e..6575957 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -63,6 +63,14 @@ ##end # ##variable +# CPACK_PACKAGE_DIRECTORY - The directory in which CPack is doing its +# packaging. If it is not set then this will default (internally) to the +# build dir. This variable may be defined in CPack config file or from +# the cpack command line option "-B". If set the command line option +# override the value found in the config file. +##end +# +##variable # CPACK_PACKAGE_VERSION_MAJOR - Package major Version ##end # @@ -89,6 +97,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 +350,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/CPackDeb.cmake b/Modules/CPackDeb.cmake index fe81dc9..bd3b94d 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -68,7 +68,11 @@ # CPACK_DEBIAN_PACKAGE_HOMEPAGE # Mandatory : NO # Default : - -# The URL of the web site for this package +# The URL of the web site for this package, preferably (when applicable) the +# site from which the original source can be obtained and any additional +# upstream documentation or information may be found. +# The content of this field is a simple URL without any surrounding +# characters such as <>. ##end ##variable # CPACK_DEBIAN_PACKAGE_SHLIBDEPS @@ -137,6 +141,30 @@ # Packages can declare in their control file that they should overwrite # files in certain other packages, or completely replace other packages. ##end +##variable +# CPACK_DEBIAN_PACKAGE_RECOMMENDS +# Mandatory : NO +# Default : - +# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps +# Allows packages to declare a strong, but not absolute, dependency on other packages. +##end +##variable +# CPACK_DEBIAN_PACKAGE_SUGGESTS +# Mandatory : NO +# Default : - +# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps +# Allows packages to declare a suggested package install grouping. +##end +##variable +# CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA +# Mandatory : NO +# Default : - +# This variable allow advanced user to add custom script to the control.tar.gz +# Typical usage is for conffiles, postinst, postrm, prerm. +# Usage: SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA +# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm") +##end + #============================================================================= # Copyright 2007-2009 Kitware, Inc. 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/CPackRPM.cmake b/Modules/CPackRPM.cmake index cba746f..ae93512 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -488,7 +488,10 @@ FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLIC MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}") ENDIF(CPACK_RPM_PACKAGE_DEBUG) SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}") -ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) + ELSE(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) + # Do not forget to unset previously set header (from previous component) + UNSET(TMP_RPM_${_RPM_SPEC_HEADER}) + ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) ENDFOREACH(_RPM_SPEC_HEADER) # CPACK_RPM_SPEC_INSTALL_POST 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/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index c74c179..6aecf90 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -21,6 +21,10 @@ set(__COMPILER_GNU 1) macro(__compiler_gnu lang) # Feature flags. set(CMAKE_${lang}_VERBOSE_FLAG "-v") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") + if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4) + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") + endif() set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") diff --git a/Modules/Compiler/SCO.cmake b/Modules/Compiler/SCO.cmake index d3deeb1..f673c8f 100644 --- a/Modules/Compiler/SCO.cmake +++ b/Modules/Compiler/SCO.cmake @@ -20,6 +20,9 @@ set(__COMPILER_SCO 1) macro(__compiler_sco lang) # Feature flags. + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC -Kpic) + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE -Kpie) + set(CMAKE_${lang}_COMPILE_OPTIONS_DLL -belf) set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-Kpic -belf") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-belf -Wl,-Bexport") endmacro() diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake index 656eea6..a1a3ae1 100644 --- a/Modules/Compiler/SunPro-C.cmake +++ b/Modules/Compiler/SunPro-C.cmake @@ -1,5 +1,7 @@ SET(CMAKE_C_VERBOSE_FLAG "-#") +SET(CMAKE_C_COMPILE_OPTIONS_PIC -KPIC) +SET(CMAKE_C_COMPILE_OPTIONS_PIE -KPIE) SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-KPIC") SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G") SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-R") diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake index 3e07e8e..702e424 100644 --- a/Modules/Compiler/SunPro-CXX.cmake +++ b/Modules/Compiler/SunPro-CXX.cmake @@ -1,5 +1,7 @@ SET(CMAKE_CXX_VERBOSE_FLAG "-v") +SET(CMAKE_CXX_COMPILE_OPTIONS_PIC -KPIC) +SET(CMAKE_CXX_COMPILE_OPTIONS_PIE -KPIE) SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-KPIC") SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G") SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-R") diff --git a/Modules/Compiler/XL.cmake b/Modules/Compiler/XL.cmake index d2567d5..d293610 100644 --- a/Modules/Compiler/XL.cmake +++ b/Modules/Compiler/XL.cmake @@ -47,7 +47,7 @@ macro(__compiler_xl lang) # files so that we export only the symbols actually provided by the sources. set(CMAKE_${lang}_CREATE_SHARED_LIBRARY "${CMAKE_XL_CreateExportList} <OBJECT_DIR>/objects.exp <OBJECTS>" - "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" + "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" ) endif() endmacro() diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake index b37695d..edf4b4e 100644 --- a/Modules/DeployQt4.cmake +++ b/Modules/DeployQt4.cmake @@ -290,7 +290,7 @@ function(install_qt4_executable executable) endforeach() endif() - resolve_qt4_paths(libs) + resolve_qt4_paths(libs "") install(CODE "INCLUDE(\"${DeployQt4_cmake_dir}/DeployQt4.cmake\") diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index b6fe190..a0a9aea 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -252,12 +252,23 @@ define_property(DIRECTORY PROPERTY "EP_STEP_TARGETS" INHERITED ) -function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag src_name work_dir) +function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag src_name work_dir gitclone_infofile gitclone_stampfile) file(WRITE ${script_filename} "if(\"${git_tag}\" STREQUAL \"\") message(FATAL_ERROR \"Tag for git checkout should not be empty.\") endif() +set(run 0) + +if(\"${gitclone_infofile}\" IS_NEWER_THAN \"${gitclone_stampfile}\") + set(run 1) +endif() + +if(NOT run) + message(STATUS \"Avoiding repeated git clone, stamp file is up to date: '${gitclone_stampfile}'\") + return() +endif() + execute_process( COMMAND \${CMAKE_COMMAND} -E remove_directory \"${source_dir}\" RESULT_VARIABLE error_code @@ -302,6 +313,19 @@ if(error_code) message(FATAL_ERROR \"Failed to update submodules in: '${work_dir}/${src_name}'\") endif() +# Complete success, update the script-last-run stamp file: +# +execute_process( + COMMAND \${CMAKE_COMMAND} -E copy + \"${gitclone_infofile}\" + \"${gitclone_stampfile}\" + WORKING_DIRECTORY \"${work_dir}/${src_name}\" + RESULT_VARIABLE error_code + ) +if(error_code) + message(FATAL_ERROR \"Failed to copy script-last-run stamp file: '${gitclone_stampfile}'\") +endif() + " ) @@ -688,8 +712,12 @@ function(_ep_get_build_command name step cmd_var) endif() else() # if(cfg_cmd_id STREQUAL "configure") # Non-CMake project. Guess "make" and "make install" and "make test". - # But use "$(MAKE)" to get recursive parallel make. - set(cmd "$(MAKE)") + if("${CMAKE_GENERATOR}" MATCHES "Makefiles") + # Try to get the parallel arguments + set(cmd "$(MAKE)") + else() + set(cmd "make") + endif() if(step STREQUAL "INSTALL") set(args install) endif() @@ -824,15 +852,23 @@ function(_ep_get_configuration_subdir_suffix suffix_var) endfunction(_ep_get_configuration_subdir_suffix) -function(ExternalProject_Add_StepTargets name) - set(steps ${ARGN}) +function(_ep_get_step_stampfile name step stampfile_var) + ExternalProject_Get_Property(${name} stamp_dir) _ep_get_configuration_subdir_suffix(cfgdir) - ExternalProject_Get_Property(${name} stamp_dir) + set(stampfile "${stamp_dir}${cfgdir}/${name}-${step}") + + set(${stampfile_var} "${stampfile}" PARENT_SCOPE) +endfunction() + + +function(ExternalProject_Add_StepTargets name) + set(steps ${ARGN}) foreach(step ${steps}) + _ep_get_step_stampfile(${name} ${step} stamp_file) add_custom_target(${name}-${step} - DEPENDS ${stamp_dir}${cfgdir}/${name}-${step}) + DEPENDS ${stamp_file}) # Depend on other external projects (target-level). get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS) @@ -845,23 +881,26 @@ endfunction(ExternalProject_Add_StepTargets) function(ExternalProject_Add_Step name step) set(cmf_dir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles) - ExternalProject_Get_Property(${name} stamp_dir) - _ep_get_configuration_subdir_suffix(cfgdir) + set(complete_stamp_file "${cmf_dir}${cfgdir}/${name}-complete") + _ep_get_step_stampfile(${name} ${step} stamp_file) + add_custom_command(APPEND - OUTPUT ${cmf_dir}${cfgdir}/${name}-complete - DEPENDS ${stamp_dir}${cfgdir}/${name}-${step} + OUTPUT ${complete_stamp_file} + DEPENDS ${stamp_file} ) + _ep_parse_arguments(ExternalProject_Add_Step - ${name} _EP_${step}_ "${ARGN}") + ${name} _EP_${step}_ "${ARGN}") # Steps depending on this step. get_property(dependers TARGET ${name} PROPERTY _EP_${step}_DEPENDERS) foreach(depender IN LISTS dependers) + _ep_get_step_stampfile(${name} ${depender} depender_stamp_file) add_custom_command(APPEND - OUTPUT ${stamp_dir}${cfgdir}/${name}-${depender} - DEPENDS ${stamp_dir}${cfgdir}/${name}-${step} + OUTPUT ${depender_stamp_file} + DEPENDS ${stamp_file} ) endforeach() @@ -871,7 +910,8 @@ function(ExternalProject_Add_Step name step) # Dependencies on steps. get_property(dependees TARGET ${name} PROPERTY _EP_${step}_DEPENDEES) foreach(dependee IN LISTS dependees) - list(APPEND depends ${stamp_dir}${cfgdir}/${name}-${dependee}) + _ep_get_step_stampfile(${name} ${dependee} dependee_stamp_file) + list(APPEND depends ${dependee_stamp_file}) endforeach() # The command to run. @@ -901,10 +941,10 @@ function(ExternalProject_Add_Step name step) # Run every time? get_property(always TARGET ${name} PROPERTY _EP_${step}_ALWAYS) if(always) - set_property(SOURCE ${stamp_dir}${cfgdir}/${name}-${step} PROPERTY SYMBOLIC 1) + set_property(SOURCE ${stamp_file} PROPERTY SYMBOLIC 1) set(touch) else() - set(touch ${CMAKE_COMMAND} -E touch ${stamp_dir}${cfgdir}/${name}-${step}) + set(touch ${CMAKE_COMMAND} -E touch ${stamp_file}) endif() # Wrap with log script? @@ -914,7 +954,7 @@ function(ExternalProject_Add_Step name step) endif() add_custom_command( - OUTPUT ${stamp_dir}${cfgdir}/${name}-${step} + OUTPUT ${stamp_file} COMMENT ${comment} COMMAND ${command} COMMAND ${touch} @@ -1079,9 +1119,15 @@ function(_ep_add_download_command name) set(git_tag "master") endif() + # For the download step, and the git clone operation, only the repository + # should be recorded in a configured RepositoryInfo file. If the repo + # changes, the clone script should be run again. But if only the tag + # changes, avoid running the clone script again. Let the 'always' running + # update step checkout the new tag. + # set(repository ${git_repository}) set(module) - set(tag ${git_tag}) + set(tag) configure_file( "${CMAKE_ROOT}/Modules/RepositoryInfo.txt.in" "${stamp_dir}/${name}-gitinfo.txt" @@ -1097,6 +1143,7 @@ function(_ep_add_download_command name) # _ep_write_gitclone_script(${tmp_dir}/${name}-gitclone.cmake ${source_dir} ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${src_name} ${work_dir} + ${stamp_dir}/${name}-gitinfo.txt ${stamp_dir}/${name}-gitclone-lastrun.txt ) set(comment "Performing download step (git clone) for '${name}'") set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitclone.cmake) @@ -1141,7 +1188,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() @@ -1276,14 +1324,12 @@ endfunction(_ep_add_patch_command) function(_ep_add_configure_command name) ExternalProject_Get_Property(${name} source_dir binary_dir tmp_dir) - _ep_get_configuration_subdir_suffix(cfgdir) - # Depend on other external projects (file-level). set(file_deps) get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS) foreach(dep IN LISTS deps) - get_property(dep_stamp_dir TARGET ${dep} PROPERTY _EP_STAMP_DIR) - list(APPEND file_deps ${dep_stamp_dir}${cfgdir}/${dep}-done) + _ep_get_step_stampfile(${dep} "done" done_stamp_file) + list(APPEND file_deps ${done_stamp_file}) endforeach() get_property(cmd_set TARGET ${name} PROPERTY _EP_CONFIGURE_COMMAND SET) @@ -1446,11 +1492,14 @@ function(ExternalProject_Add name) # Add a custom target for the external project. set(cmf_dir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles) - add_custom_target(${name} ALL DEPENDS ${cmf_dir}${cfgdir}/${name}-complete) + set(complete_stamp_file "${cmf_dir}${cfgdir}/${name}-complete") + + add_custom_target(${name} ALL DEPENDS ${complete_stamp_file}) set_property(TARGET ${name} PROPERTY _EP_IS_EXTERNAL_PROJECT 1) _ep_parse_arguments(ExternalProject_Add ${name} _EP_ "${ARGN}") _ep_set_directories(${name}) - ExternalProject_Get_Property(${name} stamp_dir) + _ep_get_step_stampfile(${name} "done" done_stamp_file) + _ep_get_step_stampfile(${name} "install" install_stamp_file) # The 'complete' step depends on all other steps and creates a # 'done' mark. A dependent external project's 'configure' step @@ -1461,19 +1510,18 @@ function(ExternalProject_Add name) # parallel builds. However, the Ninja generator needs to see the entire # dependency graph, and can cope with custom commands belonging to # multiple targets, so we add the 'done' mark as an output for Ninja only. - set(complete_outputs ${cmf_dir}${cfgdir}/${name}-complete) + set(complete_outputs ${complete_stamp_file}) if(${CMAKE_GENERATOR} MATCHES "Ninja") - set(complete_outputs - ${complete_outputs} ${stamp_dir}${cfgdir}/${name}-done) + set(complete_outputs ${complete_outputs} ${done_stamp_file}) endif() add_custom_command( OUTPUT ${complete_outputs} COMMENT "Completed '${name}'" COMMAND ${CMAKE_COMMAND} -E make_directory ${cmf_dir}${cfgdir} - COMMAND ${CMAKE_COMMAND} -E touch ${cmf_dir}${cfgdir}/${name}-complete - COMMAND ${CMAKE_COMMAND} -E touch ${stamp_dir}${cfgdir}/${name}-done - DEPENDS ${stamp_dir}${cfgdir}/${name}-install + COMMAND ${CMAKE_COMMAND} -E touch ${complete_stamp_file} + COMMAND ${CMAKE_COMMAND} -E touch ${done_stamp_file} + DEPENDS ${install_stamp_file} VERBATIM ) diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index cef647e..a5b94d1 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -318,7 +318,7 @@ FUNCTION(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet) GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE) FOREACH(_purpose ${_info}) - SET(_currentFeatureText "${_currentFeatureText}\n * ${_purpose}") + SET(_currentFeatureText "${_currentFeatureText}\n ${_purpose}") ENDFOREACH() ENDIF(includeThisOne) @@ -399,7 +399,7 @@ FUNCTION(FEATURE_SUMMARY) SET(_tmp) _FS_GET_FEATURE_SUMMARY( ${part} _tmp ${_FS_INCLUDE_QUIET_PACKAGES}) IF(_tmp) - SET(_fullText "${_fullText}\n\n-- ${title_${part}}\n${_tmp}") + SET(_fullText "${_fullText}\n-- ${title_${part}}\n${_tmp}\n") IF("${part}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND") SET(requiredPackagesNotFound TRUE) ENDIF() diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake index 50eb787..84ed3ca 100644 --- a/Modules/FindArmadillo.cmake +++ b/Modules/FindArmadillo.cmake @@ -74,7 +74,7 @@ endif (ARMADILLO_INCLUDE_DIR) #====================== -# Checks 'RECQUIRED', 'QUIET' and versions. +# Checks 'REQUIRED', 'QUIET' and versions. include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Armadillo REQUIRED_VARS ARMADILLO_LIBRARY ARMADILLO_INCLUDE_DIR diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake index 7130192..ce7f255 100644 --- a/Modules/FindBZip2.cmake +++ b/Modules/FindBZip2.cmake @@ -22,11 +22,15 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h ) +SET(_BZIP2_PATHS PATHS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Bzip2;InstallPath]" + ) + +FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h ${_BZIP2_PATHS} PATH_SUFFIXES include) IF (NOT BZIP2_LIBRARIES) - FIND_LIBRARY(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 ) - FIND_LIBRARY(BZIP2_LIBRARY_DEBUG NAMES bzip2d ) + FIND_LIBRARY(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 ${_BZIP2_PATHS} PATH_SUFFIXES lib) + FIND_LIBRARY(BZIP2_LIBRARY_DEBUG NAMES bzip2d ${_BZIP2_PATHS} PATH_SUFFIXES lib) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) SELECT_LIBRARY_CONFIGURATIONS(BZIP2) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 7504ea4..ad6b159 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -66,7 +66,8 @@ # 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0, # 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0, 1.44, 1.44.0, # 1.45, 1.45.0, 1.46, 1.46.0, 1.46.1, 1.47, 1.47.0, 1.48, 1.48.0, -# 1.49, 1.49.0, 1.50, 1.50.0 +# 1.49, 1.49.0, 1.50, 1.50.0, 1.51, 1.51.0, 1.52, 1.52.0, +# 1.53, 1.53.0, 1.54, 1.54.0, 1.55, 1.55.0, 1.56, 1.56.0 # # NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should # add both 1.x and 1.x.0 as shown above. Official Boost include directories @@ -246,7 +247,7 @@ # Copyright 2007 Wengo # Copyright 2007 Mike Jackson # Copyright 2008 Andreas Pakulat <apaku@gmx.de> -# Copyright 2008-2010 Philip Lowman <philip@yhbt.com> +# Copyright 2008-2012 Philip Lowman <philip@yhbt.com> # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -298,6 +299,7 @@ endif() #------------------------------------------------------------------------------- # FindBoost functions & macros # + ############################################ # # Check the existence of the libraries. @@ -428,18 +430,95 @@ function(_Boost_CHECK_SPELLING _var) endif() endfunction() +# Guesses Boost's compiler prefix used in built library names +# Returns the guess by setting the variable pointed to by _ret +function(_Boost_GUESS_COMPILER_PREFIX _ret) + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" + OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" + OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") + if(WIN32) + set (_boost_COMPILER "-iw") + else() + set (_boost_COMPILER "-il") + endif() + elseif (MSVC11) + set(_boost_COMPILER "-vc110") + elseif (MSVC10) + set(_boost_COMPILER "-vc100") + elseif (MSVC90) + set(_boost_COMPILER "-vc90") + elseif (MSVC80) + set(_boost_COMPILER "-vc80") + elseif (MSVC71) + set(_boost_COMPILER "-vc71") + elseif (MSVC70) # Good luck! + set(_boost_COMPILER "-vc7") # yes, this is correct + elseif (MSVC60) # Good luck! + set(_boost_COMPILER "-vc6") # yes, this is correct + elseif (BORLAND) + set(_boost_COMPILER "-bcb") + elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "SunPro") + set(_boost_COMPILER "-sw") + elseif (MINGW) + if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) + set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34 + else() + _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) + set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}") + endif() + elseif (UNIX) + if (CMAKE_COMPILER_IS_GNUCXX) + if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) + set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34 + else() + _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) + # Determine which version of GCC we have. + if(APPLE) + if(Boost_MINOR_VERSION) + if(${Boost_MINOR_VERSION} GREATER 35) + # In Boost 1.36.0 and newer, the mangled compiler name used + # on Mac OS X/Darwin is "xgcc". + set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}") + else(${Boost_MINOR_VERSION} GREATER 35) + # In Boost <= 1.35.0, there is no mangled compiler name for + # the Mac OS X/Darwin version of GCC. + set(_boost_COMPILER "") + endif(${Boost_MINOR_VERSION} GREATER 35) + else(Boost_MINOR_VERSION) + # We don't know the Boost version, so assume it's + # pre-1.36.0. + set(_boost_COMPILER "") + endif(Boost_MINOR_VERSION) + else() + set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") + endif() + endif() + endif (CMAKE_COMPILER_IS_GNUCXX) + else() + # TODO at least Boost_DEBUG here? + set(_boost_COMPILER "") + endif() + set(${_ret} ${_boost_COMPILER} PARENT_SCOPE) +endfunction() + # # End functions/macros # #------------------------------------------------------------------------------- - - +#------------------------------------------------------------------------------- +# main. +#------------------------------------------------------------------------------- if(NOT DEFINED Boost_USE_MULTITHREADED) set(Boost_USE_MULTITHREADED TRUE) endif() +# Check the version of Boost against the requested version. +if(Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) + message(SEND_ERROR "When requesting a specific version of Boost, you must provide at least the major and minor version numbers, e.g., 1.34") +endif() + if(Boost_FIND_VERSION_EXACT) # The version may appear in a directory with or without the patch # level, even when the patch level is non-zero. @@ -450,6 +529,8 @@ else(Boost_FIND_VERSION_EXACT) # The user has not requested an exact version. Among known # versions, find those that are acceptable to the user request. set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} + "1.56.0" "1.56" "1.55.0" "1.55" "1.54.0" "1.54" + "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51" "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1" "1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42" "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" @@ -480,51 +561,7 @@ endif(Boost_FIND_VERSION_EXACT) # Boost. set(Boost_ERROR_REASON) -set( _boost_IN_CACHE TRUE) -if(Boost_INCLUDE_DIR) - - # On versions < 1.35, remove the System library from the considered list - # since it wasn't added until 1.35. - if(Boost_VERSION AND Boost_FIND_COMPONENTS) - if(Boost_VERSION LESS 103500) - list(REMOVE_ITEM Boost_FIND_COMPONENTS system) - endif() - endif() - - foreach(COMPONENT ${Boost_FIND_COMPONENTS}) - string(TOUPPER ${COMPONENT} COMPONENT) - if(NOT Boost_${COMPONENT}_FOUND) - set( _boost_IN_CACHE FALSE) - endif(NOT Boost_${COMPONENT}_FOUND) - endforeach(COMPONENT) -else(Boost_INCLUDE_DIR) - set( _boost_IN_CACHE FALSE) -endif(Boost_INCLUDE_DIR) - -if(_boost_IN_CACHE) - # in cache already - set(Boost_FOUND TRUE) - foreach(COMPONENT ${Boost_FIND_COMPONENTS}) - string(TOUPPER ${COMPONENT} COMPONENT) - _Boost_ADJUST_LIB_VARS( ${COMPONENT} ) - set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${COMPONENT}_LIBRARY}) - endforeach(COMPONENT) - set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) - if(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") - math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") - math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") - math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") - endif(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} " - "is already in the cache. To view debugging messages, please clear the cache.") - endif() -else(_boost_IN_CACHE) - # Need to search for boost - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost not in cache") # Output some of their choices message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") @@ -738,78 +775,17 @@ else(_boost_IN_CACHE) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "using user-specified Boost_COMPILER = ${_boost_COMPILER}") endif() - else(Boost_COMPILER) + else() # Attempt to guess the compiler suffix # NOTE: this is not perfect yet, if you experience any issues # please report them and use the Boost_COMPILER variable # to work around the problems. - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" - OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" - OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") - if(WIN32) - set (_boost_COMPILER "-iw") - else() - set (_boost_COMPILER "-il") - endif() - elseif (MSVC11) - set(_boost_COMPILER "-vc110") - elseif (MSVC10) - set(_boost_COMPILER "-vc100") - elseif (MSVC90) - set(_boost_COMPILER "-vc90") - elseif (MSVC80) - set(_boost_COMPILER "-vc80") - elseif (MSVC71) - set(_boost_COMPILER "-vc71") - elseif (MSVC70) # Good luck! - set(_boost_COMPILER "-vc7") # yes, this is correct - elseif (MSVC60) # Good luck! - set(_boost_COMPILER "-vc6") # yes, this is correct - elseif (BORLAND) - set(_boost_COMPILER "-bcb") - elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "SunPro") - set(_boost_COMPILER "-sw") - elseif (MINGW) - if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) - set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34 - else() - _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) - set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}") - endif() - elseif (UNIX) - if (CMAKE_COMPILER_IS_GNUCXX) - if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) - set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34 - else() - _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) - # Determine which version of GCC we have. - if(APPLE) - if(Boost_MINOR_VERSION) - if(${Boost_MINOR_VERSION} GREATER 35) - # In Boost 1.36.0 and newer, the mangled compiler name used - # on Mac OS X/Darwin is "xgcc". - set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}") - else(${Boost_MINOR_VERSION} GREATER 35) - # In Boost <= 1.35.0, there is no mangled compiler name for - # the Mac OS X/Darwin version of GCC. - set(_boost_COMPILER "") - endif(${Boost_MINOR_VERSION} GREATER 35) - else(Boost_MINOR_VERSION) - # We don't know the Boost version, so assume it's - # pre-1.36.0. - set(_boost_COMPILER "") - endif(Boost_MINOR_VERSION) - else() - set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") - endif() - endif() - endif (CMAKE_COMPILER_IS_GNUCXX) - endif() + _Boost_GUESS_COMPILER_PREFIX(_boost_COMPILER) if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "guessed _boost_COMPILER = ${_boost_COMPILER}") endif() - endif(Boost_COMPILER) + endif() set (_boost_MULTITHREADED "-mt") if( NOT Boost_USE_MULTITHREADED ) @@ -944,6 +920,13 @@ else(_boost_IN_CACHE) endif() endif() + # On versions < 1.35, remove the System library from the considered list + # since it wasn't added until 1.35. + if(Boost_VERSION AND Boost_FIND_COMPONENTS) + if(Boost_VERSION LESS 103500) + list(REMOVE_ITEM Boost_FIND_COMPONENTS system) + endif() + endif() foreach(COMPONENT ${Boost_FIND_COMPONENTS}) string(TOUPPER ${COMPONENT} UPPERCOMPONENT) @@ -1030,10 +1013,18 @@ else(_boost_IN_CACHE) if( Boost_USE_STATIC_LIBS ) set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) endif() + # ------------------------------------------------------------------------ # End finding boost libraries # ------------------------------------------------------------------------ + # ------------------------------------------------------------------------ + # Begin long process of determining Boost_FOUND, starting with version + # number checks, followed by + # TODO: Ideally the version check logic should happen prior to searching + # for libraries... + # ------------------------------------------------------------------------ + set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR} ) @@ -1042,10 +1033,6 @@ else(_boost_IN_CACHE) if(Boost_INCLUDE_DIR) set( Boost_FOUND TRUE ) - # Check the version of Boost against the requested version. - if (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) - message(SEND_ERROR "When requesting a specific version of Boost, you must provide at least the major and minor version numbers, e.g., 1.34") - endif (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) if(Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" ) set( Boost_FOUND FALSE ) set(_Boost_VERSION_AGE "old") @@ -1147,7 +1134,7 @@ else(_boost_IN_CACHE) # Look for the boost library path. # Note that the user may not have installed any libraries - # so it is quite possible the Boost_LIBRARY_PATH may not exist. + # so it is quite possible the Boost_LIBRARY_DIRS may not exist. set(_boost_LIB_DIR ${Boost_INCLUDE_DIR}) if("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+") @@ -1179,6 +1166,10 @@ else(_boost_IN_CACHE) set( Boost_FOUND FALSE) endif(Boost_INCLUDE_DIR) + # ------------------------------------------------------------------------ + # Notification to end user about what was found + # ------------------------------------------------------------------------ + if(Boost_FOUND) if(NOT Boost_FIND_QUIETLY) message(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") @@ -1201,7 +1192,7 @@ else(_boost_IN_CACHE) else() if(NOT Boost_FIND_QUIETLY) # we opt not to automatically output Boost_ERROR_REASON here as - # it could be quite lengthy and somewhat imposing in it's requests + # it could be quite lengthy and somewhat imposing in its requests # Since Boost is not always a required dependency we'll leave this # up to the end-user. if(Boost_DEBUG OR Boost_DETAILED_FAILURE_MSG) @@ -1218,4 +1209,3 @@ else(_boost_IN_CACHE) Boost_INCLUDE_DIRS Boost_LIBRARY_DIRS ) -endif(_boost_IN_CACHE) diff --git a/Modules/FindBullet.cmake b/Modules/FindBullet.cmake index aea9158..c96755f 100644 --- a/Modules/FindBullet.cmake +++ b/Modules/FindBullet.cmake @@ -63,7 +63,7 @@ _FIND_BULLET_LIBRARY(BULLET_DYNAMICS_LIBRARY_DEBUG BulletDynamics_Debug BulletD _FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY BulletCollision) _FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY_DEBUG BulletCollision_Debug BulletCollision_d) _FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY BulletMath LinearMath) -_FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY_DEBUG BulletMath_Debug BulletMath_d LinearMath_d) +_FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY_DEBUG BulletMath_Debug BulletMath_d LinearMath_Debug LinearMath_d) _FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY BulletSoftBody) _FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY_DEBUG BulletSoftBody_Debug BulletSoftBody_d) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 9f8d575..56a92c1 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -540,7 +540,7 @@ set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE}) macro(FIND_LIBRARY_LOCAL_FIRST _var _names _doc) if(CMAKE_SIZEOF_VOID_P EQUAL 8) - # CUDA 3.2+ on Windows moved the library directoryies, so we need the new + # CUDA 3.2+ on Windows moved the library directories, so we need the new # and old paths. set(_cuda_64bit_lib_dir "lib/x64" "lib64" ) endif() diff --git a/Modules/FindDevIL.cmake b/Modules/FindDevIL.cmake index 0e21284..4a0fbe0 100644 --- a/Modules/FindDevIL.cmake +++ b/Modules/FindDevIL.cmake @@ -2,11 +2,22 @@ # http://openil.sourceforge.net/ # # This module sets: -# IL_LIBRARIES the name of the IL library. These include the full path to the core DevIL library. This one has to be linked into the application. -# ILU_LIBRARIES the name of the ILU library. Again, the full path. This library is for filters and effects, not actual loading. It doesn't have to be linked if the functionality it provides is not used. -# ILUT_LIBRARIES the name of the ILUT library. Full path. This part of the library interfaces with OpenGL. It is not strictly needed in applications. -# IL_INCLUDE_DIR where to find the il.h, ilu.h and ilut.h files. -# IL_FOUND this is set to TRUE if all the above variables were set. This will be set to false if ILU or ILUT are not found, even if they are not needed. In most systems, if one library is found all the others are as well. That's the way the DevIL developers release it. +# IL_LIBRARIES - the name of the IL library. These include the full path to +# the core DevIL library. This one has to be linked into the +# application. +# ILU_LIBRARIES - the name of the ILU library. Again, the full path. This +# library is for filters and effects, not actual loading. It +# doesn't have to be linked if the functionality it provides +# is not used. +# ILUT_LIBRARIES - the name of the ILUT library. Full path. This part of the +# library interfaces with OpenGL. It is not strictly needed +# in applications. +# IL_INCLUDE_DIR - where to find the il.h, ilu.h and ilut.h files. +# IL_FOUND - this is set to TRUE if all the above variables were set. +# This will be set to false if ILU or ILUT are not found, +# even if they are not needed. In most systems, if one +# library is found all the others are as well. That's the +# way the DevIL developers release it. #============================================================================= # Copyright 2008-2009 Kitware, Inc. diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake index bb18a2e..bdea95b 100644 --- a/Modules/FindFLTK.cmake +++ b/Modules/FindFLTK.cmake @@ -79,18 +79,14 @@ SET(FLTK_DIR_STRING "directory containing FLTKConfig.cmake. This is either the # Search only if the location is not already known. IF(NOT FLTK_DIR) # Get the system search path as a list. - IF(UNIX) - STRING(REGEX MATCHALL "[^:]+" FLTK_DIR_SEARCH1 "$ENV{PATH}") - ELSE(UNIX) - STRING(REGEX REPLACE "\\\\" "/" FLTK_DIR_SEARCH1 "$ENV{PATH}") - ENDIF(UNIX) - STRING(REGEX REPLACE "/;" ";" FLTK_DIR_SEARCH2 ${FLTK_DIR_SEARCH1}) + FILE(TO_CMAKE_PATH "$ENV{PATH}" FLTK_DIR_SEARCH2) # Construct a set of paths relative to the system search path. SET(FLTK_DIR_SEARCH "") FOREACH(dir ${FLTK_DIR_SEARCH2}) SET(FLTK_DIR_SEARCH ${FLTK_DIR_SEARCH} "${dir}/../lib/fltk") ENDFOREACH(dir) + STRING(REPLACE "//" "/" FLTK_DIR_SEARCH "${FLTK_DIR_SEARCH}") # # Look for an installation or build tree. @@ -105,8 +101,6 @@ IF(NOT FLTK_DIR) # Look in standard UNIX install locations. /usr/local/lib/fltk /usr/lib/fltk - /usr/local/include - /usr/include /usr/local/fltk /usr/X11R6/include diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake index 436e280..9164745 100644 --- a/Modules/FindFLTK2.cmake +++ b/Modules/FindFLTK2.cmake @@ -59,18 +59,14 @@ SET(FLTK2_DIR_STRING "directory containing FLTK2Config.cmake. This is either th # Search only if the location is not already known. IF(NOT FLTK2_DIR) # Get the system search path as a list. - IF(UNIX) - STRING(REGEX MATCHALL "[^:]+" FLTK2_DIR_SEARCH1 "$ENV{PATH}") - ELSE(UNIX) - STRING(REGEX REPLACE "\\\\" "/" FLTK2_DIR_SEARCH1 "$ENV{PATH}") - ENDIF(UNIX) - STRING(REGEX REPLACE "/;" ";" FLTK2_DIR_SEARCH2 ${FLTK2_DIR_SEARCH1}) + FILE(TO_CMAKE_PATH "$ENV{PATH}" FLTK2_DIR_SEARCH2) # Construct a set of paths relative to the system search path. SET(FLTK2_DIR_SEARCH "") FOREACH(dir ${FLTK2_DIR_SEARCH2}) SET(FLTK2_DIR_SEARCH ${FLTK2_DIR_SEARCH} "${dir}/../lib/fltk") ENDFOREACH(dir) + STRING(REPLACE "//" "/" FLTK2_DIR_SEARCH "${FLTK2_DIR_SEARCH}") # # Look for an installation or build tree. @@ -85,8 +81,6 @@ IF(NOT FLTK2_DIR) # Look in standard UNIX install locations. /usr/local/lib/fltk2 /usr/lib/fltk2 - /usr/local/include - /usr/include /usr/local/fltk2 /usr/X11R6/include @@ -193,8 +187,6 @@ IF(FLTK2_DIR) ENDIF(FLTK2_FLUID_EXECUTABLE) SET(FLTK2_INCLUDE_SEARCH_PATH ${FLTK2_INCLUDE_SEARCH_PATH} - /usr/local/include - /usr/include /usr/local/fltk2 /usr/X11R6/include ) @@ -202,8 +194,6 @@ IF(FLTK2_DIR) FIND_PATH(FLTK2_INCLUDE_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH}) SET(FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_LIBRARY_SEARCH_PATH} - /usr/lib - /usr/local/lib /usr/local/fltk2/lib /usr/X11R6/lib ${FLTK2_INCLUDE_DIR}/lib diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake index 34a7077..3457021 100644 --- a/Modules/FindJava.cmake +++ b/Modules/FindJava.cmake @@ -107,9 +107,9 @@ IF(Java_JAVA_EXECUTABLE) # 2. OpenJDK 1.6 # 3. GCJ 1.5 # 4. Kaffe 1.4.2 - IF(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+[oem-]*\".*") + IF(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+.*\".*") # This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer - STRING( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+)[oem-]*\".*" + STRING( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\".*" "\\1" Java_VERSION_STRING "${var}" ) ELSEIF(var MATCHES "java full version \"kaffe-[0-9]+\\.[0-9]+\\.[0-9_]+\".*") # Kaffe style @@ -124,7 +124,7 @@ IF(Java_JAVA_EXECUTABLE) STRING( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" ) STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_PATCH "${Java_VERSION_STRING}" ) # warning tweak version can be empty: - STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+\\_?\\.?([0-9]*)$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" ) + STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+[_\\.]?([0-9]*).*$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" ) if( Java_VERSION_TWEAK STREQUAL "" ) # check case where tweak is not defined set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH}) else( ) diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake new file mode 100644 index 0000000..729f5ce --- /dev/null +++ b/Modules/FindLibLZMA.cmake @@ -0,0 +1,69 @@ +# - Find LibLZMA +# Find LibLZMA headers and library +# +# LIBLZMA_FOUND - True if liblzma is found. +# LIBLZMA_INCLUDE_DIRS - Directory where liblzma headers are located. +# LIBLZMA_LIBRARIES - Lzma libraries to link against. +# LIBLZMA_HAS_AUTO_DECODER - True if lzma_auto_decoder() is found (required). +# LIBLZMA_HAS_EASY_ENCODER - True if lzma_easy_encoder() is found (required). +# LIBLZMA_HAS_LZMA_PRESET - True if lzma_lzma_preset() is found (required). +# LIBLZMA_VERSION_MAJOR - The major version of lzma +# LIBLZMA_VERSION_MINOR - The minor version of lzma +# LIBLZMA_VERSION_PATCH - The patch version of lzma +# LIBLZMA_VERSION_STRING - version number as a string (ex: "5.0.3") + +#============================================================================= +# Copyright 2008 Per Øyvind Karlsen <peroyvind@mandriva.org> +# Copyright 2009 Alexander Neundorf <neundorf@kde.org> +# Copyright 2009 Helio Chissini de Castro <helio@kde.org> +# Copyright 2012 Mario Bensi <mbensi@ipsquad.net> +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + + +FIND_PATH(LIBLZMA_INCLUDE_DIR lzma.h ) +FIND_LIBRARY(LIBLZMA_LIBRARY lzma) + +IF(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h") + FILE(READ "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" LIBLZMA_HEADER_CONTENTS) + + STRING(REGEX REPLACE ".*#define LZMA_VERSION_MAJOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MAJOR "${LIBLZMA_HEADER_CONTENTS}") + STRING(REGEX REPLACE ".*#define LZMA_VERSION_MINOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MINOR "${LIBLZMA_HEADER_CONTENTS}") + STRING(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}") + + SET(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}") +ENDIF(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h") + +# We're using new code known now as XZ, even library still been called LZMA +# it can be found in http://tukaani.org/xz/ +# Avoid using old codebase +IF (LIBLZMA_LIBRARY) + INCLUDE(CheckLibraryExists) + CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER) + CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER) + CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET) +ENDIF (LIBLZMA_LIBRARY) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA REQUIRED_VARS LIBLZMA_INCLUDE_DIR + LIBLZMA_LIBRARY + LIBLZMA_HAS_AUTO_DECODER + LIBLZMA_HAS_EASY_ENCODER + LIBLZMA_HAS_LZMA_PRESET + VERSION_VAR LIBLZMA_VERSION_STRING + ) + +IF (LIBLZMA_FOUND) + SET(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY}) + SET(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR}) +ENDIF (LIBLZMA_FOUND) + +MARK_AS_ADVANCED( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY ) diff --git a/Modules/FindLua50.cmake b/Modules/FindLua50.cmake index ee8b84e..9a5cc17 100644 --- a/Modules/FindLua50.cmake +++ b/Modules/FindLua50.cmake @@ -31,8 +31,6 @@ FIND_PATH(LUA_INCLUDE_DIR lua.h PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave @@ -47,8 +45,6 @@ FIND_LIBRARY(LUA_LIBRARY_lua PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw @@ -67,8 +63,6 @@ ELSE(${LUA_LIBRARY_lua} MATCHES "framework") $ENV{LUA_DIR} PATH_SUFFIXES lib64 lib PATHS - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake index b67dd4c..e111d36 100644 --- a/Modules/FindLua51.cmake +++ b/Modules/FindLua51.cmake @@ -32,8 +32,6 @@ FIND_PATH(LUA_INCLUDE_DIR lua.h PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave @@ -48,8 +46,6 @@ FIND_LIBRARY(LUA_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake index bcba6e2..cb3ce48 100644 --- a/Modules/FindOpenAL.cmake +++ b/Modules/FindOpenAL.cmake @@ -68,8 +68,6 @@ FIND_PATH(OPENAL_INCLUDE_DIR al.h PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave @@ -85,8 +83,6 @@ FIND_LIBRARY(OPENAL_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake index 80dfd51..2e3ac14 100644 --- a/Modules/FindPhysFS.cmake +++ b/Modules/FindPhysFS.cmake @@ -30,8 +30,6 @@ FIND_PATH(PHYSFS_INCLUDE_DIR physfs.h PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave @@ -46,8 +44,6 @@ FIND_LIBRARY(PHYSFS_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw 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/FindProducer.cmake b/Modules/FindProducer.cmake index 39a9436..26c804a 100644 --- a/Modules/FindProducer.cmake +++ b/Modules/FindProducer.cmake @@ -51,8 +51,6 @@ FIND_PATH(PRODUCER_INCLUDE_DIR Producer/CameraGroup PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local/include - /usr/include /sw/include # Fink /opt/local/include # DarwinPorts /opt/csw/include # Blastwave @@ -69,8 +67,6 @@ FIND_LIBRARY(PRODUCER_LIBRARY $ENV{OSGDIR} PATH_SUFFIXES lib64 lib PATHS - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index fcd0838..11ff196 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -13,6 +13,11 @@ # The Python_ADDITIONAL_VERSIONS variable can be used to specify a list of # version numbers that should be taken into account when searching for Python. # You need to set this variable before calling find_package(PythonLibs). +# +# If you'd like to specify the installation of Python to use, you should modify +# the following cache variables: +# PYTHON_LIBRARY - path to the python library +# PYTHON_INCLUDE_DIR - path to where Python.h is found #============================================================================= # Copyright 2001-2009 Kitware, Inc. @@ -40,13 +45,19 @@ IF(PythonLibs_FIND_VERSION) STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION}") STRING(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}") UNSET(_PYTHON_FIND_OTHER_VERSIONS) - IF(NOT PythonLibs_FIND_VERSION_EXACT) + IF(PythonLibs_FIND_VERSION_EXACT) + IF(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) + SET(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}") + ELSE(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) + SET(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}") + ENDIF(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) + ELSE(PythonLibs_FIND_VERSION_EXACT) FOREACH(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS}) IF(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN) LIST(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V}) ENDIF() ENDFOREACH() - ENDIF(NOT PythonLibs_FIND_VERSION_EXACT) + ENDIF(PythonLibs_FIND_VERSION_EXACT) UNSET(_PYTHON_FIND_MAJ_MIN) UNSET(_PYTHON_FIND_MAJ) ELSE(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") @@ -82,7 +93,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 +136,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/FindQt4.cmake b/Modules/FindQt4.cmake index 9b646b4..2f1708d 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -102,15 +102,28 @@ # accompanying header file foo.h. # If a source file has the SKIP_AUTOMOC property set it will be ignored by this macro. # +# You should have a look on the AUTOMOC property for targets to achieve the same results. +# # macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename) -# create a the interface header and implementation files with the +# Create a the interface header and implementation files with the # given basename from the given interface xml file and add it to -# the list of sources +# the list of sources. +# +# You can pass additional parameters to the qdbusxml2cpp call by setting +# properties on the input file: +# +# INCLUDE the given file will be included in the generate interface header +# +# CLASSNAME the generated class is named accordingly +# +# NO_NAMESPACE the generated class is not wrapped in a namespace # # macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... ) -# create the interface header and implementation files -# for all listed interface xml files -# the name will be automatically determined from the name of the xml file +# Create the interface header and implementation files +# for all listed interface xml files. +# The basename will be automatically determined from the name of the xml file. +# +# The source file properties described for QT4_ADD_DBUS_INTERFACE also apply here. # # macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] [classname]) # create a dbus adaptor (header and implementation file) from the xml file @@ -217,7 +230,7 @@ # QT_QAXCONTAINER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only) # QT_QAXSERVER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only) # QT_QTCORE_INCLUDE_DIR Path to "include/QtCore" -# QT_QTDBUS_INCLUDE_DIR Path to "include/QtDBus" +# QT_QTDBUS_INCLUDE_DIR Path to "include/QtDBus" # QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner" # QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR Path to "include/QtDesigner" # QT_QTGUI_INCLUDE_DIR Path to "include/QtGui" @@ -1059,7 +1072,11 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) SET( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff ) SET( QT_INPUTMETHODS_PLUGINS qimsw_multi ) SET( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler ) - SET( QT_PHONON_BACKEND_PLUGINS phonon_qt7 ) + IF(APPLE) + SET( QT_PHONON_BACKEND_PLUGINS phonon_qt7 ) + ELSEIF(WIN32) + SET( QT_PHONON_BACKEND_PLUGINS phonon_ds9 ) + ENDIF() SET( QT_SCRIPT_PLUGINS qtscriptdbus ) SET( QT_SQLDRIVERS_PLUGINS qsqldb2 qsqlibase qsqlite qsqlite2 qsqlmysql qsqloci qsqlodbc qsqlpsql qsqltds ) @@ -1169,10 +1186,22 @@ ELSE( Qt4_FIND_COMPONENTS ) ENDIF( Qt4_FIND_COMPONENTS ) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4 - REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} - VERSION_VAR QTVERSION - ) +if (QT_VERSION_MAJOR GREATER 4) + SET(VERSION_MSG "Found unsuitable Qt version \"${QTVERSION}\" from ${QT_QMAKE_EXECUTABLE}") + SET(QT4_FOUND FALSE) + IF(Qt4_FIND_REQUIRED) + MESSAGE( FATAL_ERROR "${VERSION_MSG}, this code requires Qt 4.x") + ELSE(Qt4_FIND_REQUIRED) + IF(NOT Qt4_FIND_QUIETLY) + MESSAGE( STATUS "${VERSION_MSG}") + ENDIF(NOT Qt4_FIND_QUIETLY) + ENDIF(Qt4_FIND_REQUIRED) +else() + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4 + REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} + VERSION_VAR QTVERSION + ) +endif() ####################################### # diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake index 9a130fa..f215bda 100644 --- a/Modules/FindSDL_image.cmake +++ b/Modules/FindSDL_image.cmake @@ -39,8 +39,6 @@ FIND_PATH(SDLIMAGE_INCLUDE_DIR SDL_image.h /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /usr/local/include - /usr/include /sw/include/SDL # Fink /sw/include /opt/local/include/SDL # DarwinPorts @@ -60,8 +58,6 @@ FIND_LIBRARY(SDLIMAGE_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake index ce1ae9e..7cc1a6b 100644 --- a/Modules/FindSDL_mixer.cmake +++ b/Modules/FindSDL_mixer.cmake @@ -39,8 +39,6 @@ FIND_PATH(SDLMIXER_INCLUDE_DIR SDL_mixer.h /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /usr/local/include - /usr/include /sw/include/SDL # Fink /sw/include /opt/local/include/SDL # DarwinPorts @@ -60,8 +58,6 @@ FIND_LIBRARY(SDLMIXER_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake index b5ada54..ca1de79 100644 --- a/Modules/FindSDL_net.cmake +++ b/Modules/FindSDL_net.cmake @@ -39,8 +39,6 @@ FIND_PATH(SDLNET_INCLUDE_DIR SDL_net.h /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /usr/local/include - /usr/include /sw/include/SDL # Fink /sw/include /opt/local/include/SDL # DarwinPorts @@ -59,8 +57,6 @@ FIND_LIBRARY(SDLNET_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake index 8edf6ca..35294a5 100644 --- a/Modules/FindSDL_sound.cmake +++ b/Modules/FindSDL_sound.cmake @@ -86,8 +86,6 @@ FIND_PATH(SDL_SOUND_INCLUDE_DIR SDL_sound.h /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /usr/local/include - /usr/include /sw/include/SDL # Fink /sw/include /opt/local/include/SDL # DarwinPorts @@ -106,8 +104,6 @@ FIND_LIBRARY(SDL_SOUND_LIBRARY $ENV{SDLDIR}/lib $ENV{SDLDIR} PATHS - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -222,8 +218,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -245,8 +239,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -271,8 +263,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -293,8 +283,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -317,8 +305,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -341,8 +327,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -368,8 +352,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -395,8 +377,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake index 3d07ab7..184b6c3 100644 --- a/Modules/FindSDL_ttf.cmake +++ b/Modules/FindSDL_ttf.cmake @@ -39,8 +39,6 @@ FIND_PATH(SDLTTF_INCLUDE_DIR SDL_ttf.h /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /usr/local/include - /usr/include /sw/include/SDL # Fink /sw/include /opt/local/include/SDL # DarwinPorts @@ -59,8 +57,6 @@ FIND_LIBRARY(SDLTTF_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake index b0b6b2f..48d195a 100644 --- a/Modules/FindSquish.cmake +++ b/Modules/FindSquish.cmake @@ -43,18 +43,14 @@ SET(SQUISH_CLIENT_EXECUTABLE_STRING "The squishclient executable program.") # Search only if the location is not already known. IF(NOT SQUISH_INSTALL_DIR) # Get the system search path as a list. - IF(UNIX) - STRING(REGEX MATCHALL "[^:]+" SQUISH_INSTALL_DIR_SEARCH1 "$ENV{PATH}") - ELSE(UNIX) - STRING(REGEX REPLACE "\\\\" "/" SQUISH_INSTALL_DIR_SEARCH1 "$ENV{PATH}") - ENDIF(UNIX) - STRING(REGEX REPLACE "/;" ";" SQUISH_INSTALL_DIR_SEARCH2 ${SQUISH_INSTALL_DIR_SEARCH1}) + FILE(TO_CMAKE_PATH "$ENV{PATH}" SQUISH_INSTALL_DIR_SEARCH2) # Construct a set of paths relative to the system search path. SET(SQUISH_INSTALL_DIR_SEARCH "") FOREACH(dir ${SQUISH_INSTALL_DIR_SEARCH2}) SET(SQUISH_INSTALL_DIR_SEARCH ${SQUISH_INSTALL_DIR_SEARCH} "${dir}/../lib/fltk") ENDFOREACH(dir) + STRING(REPLACE "//" "/" SQUISH_INSTALL_DIR_SEARCH "${SQUISH_INSTALL_DIR_SEARCH}") # Look for an installation FIND_PATH(SQUISH_INSTALL_DIR bin/squishrunner diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake index f2c776f..7f6d3a7 100644 --- a/Modules/FindTCL.cmake +++ b/Modules/FindTCL.cmake @@ -82,8 +82,6 @@ SET(TCLTK_POSSIBLE_LIB_PATHS "${TK_LIBRARY_PATH}" "${TCL_TCLSH_PATH_PARENT}/lib" "${TK_WISH_PATH_PARENT}/lib" - /usr/lib - /usr/local/lib ) IF(WIN32) @@ -162,8 +160,6 @@ SET(TCLTK_POSSIBLE_INCLUDE_PATHS ${TK_FRAMEWORK_INCLUDES} "${TCL_TCLSH_PATH_PARENT}/include" "${TK_WISH_PATH_PARENT}/include" - /usr/include - /usr/local/include /usr/include/tcl${TK_LIBRARY_VERSION} /usr/include/tcl${TCL_LIBRARY_VERSION} /usr/include/tcl8.6 diff --git a/Modules/FindTclStub.cmake b/Modules/FindTclStub.cmake index 4db2716..79d14ae 100644 --- a/Modules/FindTclStub.cmake +++ b/Modules/FindTclStub.cmake @@ -66,8 +66,6 @@ SET(TCLTK_POSSIBLE_LIB_PATHS "${TK_LIBRARY_PATH}" "${TCL_TCLSH_PATH_PARENT}/lib" "${TK_WISH_PATH_PARENT}/lib" - /usr/lib - /usr/local/lib ) IF(WIN32) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 0bc6172..865a6c5 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -167,9 +167,9 @@ SET(wxWidgets_CXX_FLAGS "") # http://www.cmake.org/pipermail/cmake/2008-April/021115.html # http://www.cmake.org/pipermail/cmake/2008-April/021146.html # -IF(APPLE) +IF(APPLE OR CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") SET(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1) -ENDIF(APPLE) +ENDIF() # DEPRECATED: This is a patch to support the DEPRECATED use of # wxWidgets_USE_LIBS. diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake index f55cf00..dfb28ff 100644 --- a/Modules/FindwxWindows.cmake +++ b/Modules/FindwxWindows.cmake @@ -139,7 +139,7 @@ IF(WIN32_STYLE_FIND) ## find libs for combination of static/shared with release/debug ## be careful if you add something here, ## avoid mixing of headers and libs of different wx versions, - ## there may be multiple WX version s installed. + ## there may be multiple WX versions installed. SET (WXWINDOWS_POSSIBLE_LIB_PATHS "${WXWINDOWS_ROOT_DIR}/lib" ) diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 8761f40..d215685 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -195,6 +195,14 @@ function(is_file_executable file result_var) return() endif("${file_ov}" MATCHES "text") endif("${file_ov}" MATCHES "executable") + + # Also detect position independent executables on Linux, + # where "file" gives "shared object ... (uses shared libraries)" + if("${file_ov}" MATCHES "shared object.*\(uses shared libs\)") + set(${result_var} 1 PARENT_SCOPE) + return() + endif() + else(file_cmd) message(STATUS "warning: No 'file' command, skipping execute_process...") endif(file_cmd) 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/AIX-GNU-ASM.cmake b/Modules/Platform/AIX-GNU-ASM.cmake new file mode 100644 index 0000000..c256df6 --- /dev/null +++ b/Modules/Platform/AIX-GNU-ASM.cmake @@ -0,0 +1,2 @@ +include(Platform/AIX-GNU) +__aix_compiler_gnu(ASM) diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake index 543f3e8..81ba365 100644 --- a/Modules/Platform/AIX-GNU.cmake +++ b/Modules/Platform/AIX-GNU.cmake @@ -21,5 +21,6 @@ set(__AIX_COMPILER_GNU 1) macro(__aix_compiler_gnu lang) set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:") set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") - set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,-G") + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,-G,-brtl,-bnoipath") + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib endmacro() diff --git a/Modules/Platform/BeOS.cmake b/Modules/Platform/BeOS.cmake index 41aa8f7..3ffb67c 100644 --- a/Modules/Platform/BeOS.cmake +++ b/Modules/Platform/BeOS.cmake @@ -1,6 +1,8 @@ SET(BEOS 1) SET(CMAKE_DL_LIBS root be) +SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC") +SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE") SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostart") SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") diff --git a/Modules/Platform/BlueGeneP-base.cmake b/Modules/Platform/BlueGeneP-base.cmake index 926dbc0..c0241e1 100644 --- a/Modules/Platform/BlueGeneP-base.cmake +++ b/Modules/Platform/BlueGeneP-base.cmake @@ -85,11 +85,15 @@ set(CMAKE_DL_LIBS "dl") macro(__BlueGeneP_set_dynamic_flags compiler_id lang) if (${compiler_id} STREQUAL XL) # Flags for XL compilers if we explicitly detected XL + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-qpic") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-qpie") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-qpic") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-qmkshrobj -qnostaticlink") set(BGP_${lang}_DYNAMIC_EXE_FLAGS "-qnostaticlink -qnostaticlink=libgcc") else() # Assume flags for GNU compilers (if the ID is GNU *or* anything else). + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") set(BGP_${lang}_DYNAMIC_EXE_FLAGS "-dynamic") diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake index 5aad45b..eae313a 100644 --- a/Modules/Platform/CYGWIN-GNU.cmake +++ b/Modules/Platform/CYGWIN-GNU.cmake @@ -35,7 +35,10 @@ macro(__cygwin_compiler_gnu lang) set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>") - set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on cygwin + # No -fPIC on cygwin + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "") + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # Initialize C link type selection flags. These flags are used when # building a shared library, shared module, or executable that links diff --git a/Modules/Platform/Darwin-icc.cmake b/Modules/Platform/Darwin-icc.cmake index b62036c..b592e5f 100644 --- a/Modules/Platform/Darwin-icc.cmake +++ b/Modules/Platform/Darwin-icc.cmake @@ -84,11 +84,11 @@ ENDIF(XCODE) SET(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>") SET(CMAKE_C_CREATE_SHARED_LIBRARY - "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> -install_name <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") + "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> -install_name <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") + "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY - "<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> -install_name <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") + "<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") SET(CMAKE_CXX_CREATE_SHARED_MODULE "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") @@ -106,7 +106,9 @@ SET(CMAKE_Fortran_CREATE_SHARED_MODULE # default to searching for frameworks first -SET(CMAKE_FIND_FRAMEWORK FIRST) +IF(NOT DEFINED CMAKE_FIND_FRAMEWORK) + SET(CMAKE_FIND_FRAMEWORK FIRST) +ENDIF() # set up the default search directories for frameworks SET(CMAKE_SYSTEM_FRAMEWORK_PATH ~/Library/Frameworks @@ -115,7 +117,9 @@ SET(CMAKE_SYSTEM_FRAMEWORK_PATH /System/Library/Frameworks) # default to searching for application bundles first -SET(CMAKE_FIND_APPBUNDLE FIRST) +IF(NOT DEFINED CMAKE_FIND_APPBUNDLE) + SET(CMAKE_FIND_APPBUNDLE FIRST) +ENDIF() # set up the default search directories for application bundles SET(CMAKE_SYSTEM_APPBUNDLE_PATH ~/Applications @@ -125,4 +129,3 @@ SET(CMAKE_SYSTEM_APPBUNDLE_PATH INCLUDE(Platform/UnixPaths) SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} /sw/include) SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} /sw/lib) - diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index f9d37c3..eff07b2 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -207,11 +207,11 @@ ENDIF() SET(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w) SET(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w) SET(CMAKE_C_CREATE_SHARED_LIBRARY - "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> -install_name <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") + "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> -install_name <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") + "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY - "<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> -install_name <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") + "<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") SET(CMAKE_CXX_CREATE_SHARED_MODULE "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") @@ -223,14 +223,15 @@ SET(CMAKE_Fortran_CREATE_SHARED_MODULE "<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") SET(CMAKE_C_CREATE_MACOSX_FRAMEWORK - "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> -install_name <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") + "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") SET(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK - "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> -install_name <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") + "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") - # default to searching for frameworks first -SET(CMAKE_FIND_FRAMEWORK FIRST) +IF(NOT DEFINED CMAKE_FIND_FRAMEWORK) + SET(CMAKE_FIND_FRAMEWORK FIRST) +ENDIF() # set up the default search directories for frameworks SET(CMAKE_SYSTEM_FRAMEWORK_PATH ~/Library/Frameworks @@ -239,7 +240,9 @@ SET(CMAKE_SYSTEM_FRAMEWORK_PATH /System/Library/Frameworks) # default to searching for application bundles first -SET(CMAKE_FIND_APPBUNDLE FIRST) +IF(NOT DEFINED CMAKE_FIND_APPBUNDLE) + SET(CMAKE_FIND_APPBUNDLE FIRST) +ENDIF() # set up the default search directories for application bundles SET(_apps_paths) FOREACH(_path diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake index 033db06..82fe961 100644 --- a/Modules/Platform/FreeBSD.cmake +++ b/Modules/Platform/FreeBSD.cmake @@ -1,6 +1,8 @@ IF(EXISTS /usr/include/dlfcn.h) SET(CMAKE_DL_LIBS "") - SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic + SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC") + SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE") + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath diff --git a/Modules/Platform/HP-UX-HP.cmake b/Modules/Platform/HP-UX-HP.cmake index bce0a8b..871ea13 100644 --- a/Modules/Platform/HP-UX-HP.cmake +++ b/Modules/Platform/HP-UX-HP.cmake @@ -19,6 +19,7 @@ endif() set(__HPUX_COMPILER_HP 1) macro(__hpux_compiler_hp lang) + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "+Z") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "+Z") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-Wl,-E,+nodefaultrpath -b -L/usr/lib") set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,+s,-E,+nodefaultrpath") diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake index 8277a24..9dda3c5 100644 --- a/Modules/Platform/Haiku.cmake +++ b/Modules/Platform/Haiku.cmake @@ -1,6 +1,8 @@ SET(BEOS 1) SET(CMAKE_DL_LIBS root be) +SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC") +SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE") SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostart") SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") diff --git a/Modules/Platform/Linux-Intel.cmake b/Modules/Platform/Linux-Intel.cmake index dea8b90..47bf246 100644 --- a/Modules/Platform/Linux-Intel.cmake +++ b/Modules/Platform/Linux-Intel.cmake @@ -31,6 +31,8 @@ if(NOT XIAR) endif(NOT XIAR) macro(__linux_compiler_intel lang) + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") diff --git a/Modules/Platform/Linux-PGI.cmake b/Modules/Platform/Linux-PGI.cmake index ef06acd..3cbb35c 100644 --- a/Modules/Platform/Linux-PGI.cmake +++ b/Modules/Platform/Linux-PGI.cmake @@ -20,6 +20,8 @@ set(__LINUX_COMPILER_PGI 1) macro(__linux_compiler_pgi lang) # Shared library compile and link flags. + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") endmacro() diff --git a/Modules/Platform/Linux-PathScale.cmake b/Modules/Platform/Linux-PathScale.cmake index c131af2..d230ab2 100644 --- a/Modules/Platform/Linux-PathScale.cmake +++ b/Modules/Platform/Linux-PathScale.cmake @@ -20,6 +20,8 @@ set(__LINUX_COMPILER_PATHSCALE 1) macro(__linux_compiler_pathscale lang) # Shared library compile and link flags. + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") endmacro() diff --git a/Modules/Platform/MP-RAS.cmake b/Modules/Platform/MP-RAS.cmake index 1e3e239..ff22a4f 100644 --- a/Modules/Platform/MP-RAS.cmake +++ b/Modules/Platform/MP-RAS.cmake @@ -1,6 +1,10 @@ IF(CMAKE_SYSTEM MATCHES "MP-RAS-02*.") + SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC) + SET(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE) SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") ELSE(CMAKE_SYSTEM MATCHES "MP-RAS-02*.") + SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC) + SET(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE) SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Bexport") ENDIF(CMAKE_SYSTEM MATCHES "MP-RAS-02*.") diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake index 0fb8636..e1b66b8 100644 --- a/Modules/Platform/NetBSD.cmake +++ b/Modules/Platform/NetBSD.cmake @@ -1,6 +1,8 @@ IF(EXISTS /usr/include/dlfcn.h) SET(CMAKE_DL_LIBS "") - SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic + SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC") + SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE") + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake index 076410a..49a30e9 100644 --- a/Modules/Platform/OSF1.cmake +++ b/Modules/Platform/OSF1.cmake @@ -4,7 +4,9 @@ IF(CMAKE_SYSTEM MATCHES "OSF1-1.[012]") ENDIF(CMAKE_SYSTEM MATCHES "OSF1-1.[012]") IF(CMAKE_SYSTEM MATCHES "OSF1-1.*") # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fpic") # -pic + SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fpic") + SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fpie") + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fpic") # -pic SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fpic") # -pic ENDIF(CMAKE_SYSTEM MATCHES "OSF1-1.*") diff --git a/Modules/Platform/SINIX.cmake b/Modules/Platform/SINIX.cmake index 4592fdd..e0809f8 100644 --- a/Modules/Platform/SINIX.cmake +++ b/Modules/Platform/SINIX.cmake @@ -1,2 +1,4 @@ +SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC) +SET(CMAKE_C_COMPILE_OPTIONS_PIE "") SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") INCLUDE(Platform/UnixPaths) diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake index 9f2ee2e..de287aa 100644 --- a/Modules/Platform/SunOS.cmake +++ b/Modules/Platform/SunOS.cmake @@ -1,6 +1,8 @@ IF(CMAKE_SYSTEM MATCHES "SunOS-4.*") - SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-PIC") - SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-r") + SET(CMAKE_C_COMPILE_OPTIONS_PIC "-PIC") + SET(CMAKE_C_COMPILE_OPTIONS_PIE "-PIE") + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-PIC") + SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-r") SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-R") SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") ENDIF(CMAKE_SYSTEM MATCHES "SunOS-4.*") @@ -8,7 +10,7 @@ ENDIF(CMAKE_SYSTEM MATCHES "SunOS-4.*") IF(CMAKE_COMPILER_IS_GNUCXX) IF(CMAKE_COMPILER_IS_GNUCC) SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") ELSE(CMAKE_COMPILER_IS_GNUCC) # Take default rule from CMakeDefaultMakeRuleVariables.cmake. ENDIF(CMAKE_COMPILER_IS_GNUCC) diff --git a/Modules/Platform/UNIX_SV.cmake b/Modules/Platform/UNIX_SV.cmake index 3b50e0a..869b3a6 100644 --- a/Modules/Platform/UNIX_SV.cmake +++ b/Modules/Platform/UNIX_SV.cmake @@ -1,3 +1,5 @@ +SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC) +SET(CMAKE_C_COMPILE_OPTIONS_PIE "") SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Bexport") INCLUDE(Platform/UnixPaths) diff --git a/Modules/Platform/UnixWare.cmake b/Modules/Platform/UnixWare.cmake index c324bc8..3112ee1 100644 --- a/Modules/Platform/UnixWare.cmake +++ b/Modules/Platform/UnixWare.cmake @@ -1,3 +1,5 @@ +SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC) +SET(CMAKE_C_COMPILE_OPTIONS_PIE "") SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-Wl,-Bexport") INCLUDE(Platform/UnixPaths) diff --git a/Modules/Platform/Windows-Embarcadero.cmake b/Modules/Platform/Windows-Embarcadero.cmake index 87b3767..62e8eb7 100644 --- a/Modules/Platform/Windows-Embarcadero.cmake +++ b/Modules/Platform/Windows-Embarcadero.cmake @@ -76,7 +76,8 @@ SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_R macro(__embarcadero_language lang) - set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "${_tD}") + set(CMAKE_${lang}_COMPILE_OPTIONS_DLL "${_tD}") # Note: This variable is a ';' separated list + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "${_tD}") # ... while this is a space separated string. # compile a source file into an object file # place <DEFINES> outside the response file because Borland refuses diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index dd47692..4a37eca 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -77,7 +77,11 @@ macro(__windows_compiler_gnu lang) endforeach(type) endif() - set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows + # No -fPIC on Windows + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "") + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS ${__WINDOWS_GNU_LD_RESPONSE}) set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1) @@ -111,7 +115,9 @@ macro(__windows_compiler_gnu lang) list(APPEND CMAKE_${lang}_ABI_FILES "Platform/Windows-GNU-${lang}-ABI") # Support very long lists of object files. - if("${CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG}" STREQUAL "@") + # TODO: check for which gcc versions this is still needed, not needed for gcc >= 4.4. + # Ninja generator doesn't support this work around. + if("${CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG}" STREQUAL "@" AND NOT CMAKE_GENERATOR MATCHES "Ninja") foreach(rule CREATE_SHARED_MODULE CREATE_SHARED_LIBRARY LINK_EXECUTABLE) # The gcc/collect2/ld toolchain does not use response files # internally so we cannot pass long object lists. Instead pass 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/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake index e7462ba..2a54a98 100644 --- a/Modules/Platform/Windows-Intel.cmake +++ b/Modules/Platform/Windows-Intel.cmake @@ -92,7 +92,7 @@ macro(__windows_compiler_intel lang) set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link /implib:<TARGET_IMPLIB> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000${_FLAGS_${lang}}") - set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Od /GZ") + set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Od /RTC1") set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/DNDEBUG /MD /O1") set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/DNDEBUG /MD /O2") set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/DNDEBUG /MD /Zi /O2") diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake index e1140df..14b3b81 100644 --- a/Modules/Platform/Windows-wcl386.cmake +++ b/Modules/Platform/Windows-wcl386.cmake @@ -20,7 +20,8 @@ SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "debug all" ) SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" ) SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" ) -set (CMAKE_SHARED_LIBRARY_C_FLAGS "-bd" ) +set(CMAKE_C_COMPILE_OPTIONS_DLL "-bd") # Note: This variable is a ';' separated list +set(CMAKE_SHARED_LIBRARY_C_FLAGS "-bd") # ... while this is a space separated string. SET(CMAKE_RC_COMPILER "rc" ) diff --git a/Modules/Platform/syllable.cmake b/Modules/Platform/syllable.cmake index 3ce42f6..2d11d08 100644 --- a/Modules/Platform/syllable.cmake +++ b/Modules/Platform/syllable.cmake @@ -10,7 +10,9 @@ SET(CMAKE_DL_LIBS "dl") -SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic +SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC") +SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE") +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,") diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index f327125..68f3c80 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -182,23 +182,31 @@ MACRO (QT4_ADD_RESOURCES outfiles ) GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE) GET_FILENAME_COMPONENT(rc_path ${infile} PATH) SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx) - # parse file for dependencies - # all files are absolute paths or relative to the location of the qrc file - FILE(READ "${infile}" _RC_FILE_CONTENTS) - STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}") + SET(_RC_DEPENDS) - FOREACH(_RC_FILE ${_RC_FILES}) - STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}") - IF(NOT IS_ABSOLUTE "${_RC_FILE}") - SET(_RC_FILE "${rc_path}/${_RC_FILE}") - ENDIF(NOT IS_ABSOLUTE "${_RC_FILE}") - SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}") - ENDFOREACH(_RC_FILE) - # Since this cmake macro is doing the dependency scanning for these files, - # let's make a configured file and add it as a dependency so cmake is run - # again when dependencies need to be recomputed. - QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends) - CONFIGURE_FILE("${infile}" "${out_depends}" COPY_ONLY) + IF(EXISTS "${infile}") + # parse file for dependencies + # all files are absolute paths or relative to the location of the qrc file + FILE(READ "${infile}" _RC_FILE_CONTENTS) + STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}") + FOREACH(_RC_FILE ${_RC_FILES}) + STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}") + IF(NOT IS_ABSOLUTE "${_RC_FILE}") + SET(_RC_FILE "${rc_path}/${_RC_FILE}") + ENDIF(NOT IS_ABSOLUTE "${_RC_FILE}") + SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}") + ENDFOREACH(_RC_FILE) + # Since this cmake macro is doing the dependency scanning for these files, + # let's make a configured file and add it as a dependency so cmake is run + # again when dependencies need to be recomputed. + QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends) + CONFIGURE_FILE("${infile}" "${out_depends}" COPY_ONLY) + ELSE(EXISTS "${infile}") + # The .qrc file does not exist (yet). Let's add a dependency and hope + # that it will be generated later + SET(out_depends) + ENDIF(EXISTS "${infile}") + ADD_CUSTOM_COMMAND(OUTPUT ${outfile} COMMAND ${QT_RCC_EXECUTABLE} ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile} @@ -212,9 +220,9 @@ ENDMACRO (QT4_ADD_RESOURCES) MACRO(QT4_ADD_DBUS_INTERFACE _sources _interface _basename) GET_FILENAME_COMPONENT(_infile ${_interface} ABSOLUTE) - SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h) - SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp) - SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc) + SET(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h") + SET(_impl "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp") + SET(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc") GET_SOURCE_FILE_PROPERTY(_nonamespace ${_interface} NO_NAMESPACE) IF(_nonamespace) @@ -233,16 +241,16 @@ MACRO(QT4_ADD_DBUS_INTERFACE _sources _interface _basename) SET(_params ${_params} -i ${_include}) ENDIF(_include) - ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header} + ADD_CUSTOM_COMMAND(OUTPUT "${_impl}" "${_header}" COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} -p ${_basename} ${_infile} DEPENDS ${_infile} VERBATIM) - SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE) + SET_SOURCE_FILES_PROPERTIES("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE) - QT4_GENERATE_MOC(${_header} ${_moc}) + QT4_GENERATE_MOC("${_header}" "${_moc}") - SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc}) - MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc}) + LIST(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}") + MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}") ENDMACRO(QT4_ADD_DBUS_INTERFACE) @@ -250,9 +258,10 @@ ENDMACRO(QT4_ADD_DBUS_INTERFACE) MACRO(QT4_ADD_DBUS_INTERFACES _sources) FOREACH (_current_FILE ${ARGN}) GET_FILENAME_COMPONENT(_infile ${_current_FILE} ABSOLUTE) + GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME) # get the part before the ".xml" suffix - STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2" _basename ${_current_FILE}) STRING(TOLOWER ${_basename} _basename) + STRING(REGEX REPLACE "(.*\\.)?([^\\.]+)\\.xml" "\\2" _basename ${_basename}) QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface) ENDFOREACH (_current_FILE) ENDMACRO(QT4_ADD_DBUS_INTERFACES) @@ -297,27 +306,27 @@ MACRO(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optional ENDIF (_optionalBasename) SET(_optionalClassName "${ARGV5}") - SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h) - SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp) - SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc) + SET(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h") + SET(_impl "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp") + SET(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc") IF(_optionalClassName) - ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header} + ADD_CUSTOM_COMMAND(OUTPUT "${_impl}" "${_header}" COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile} DEPENDS ${_infile} VERBATIM ) ELSE(_optionalClassName) - ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header} + ADD_CUSTOM_COMMAND(OUTPUT "${_impl}" "${_header}" COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile} DEPENDS ${_infile} VERBATIM ) ENDIF(_optionalClassName) - QT4_GENERATE_MOC(${_header} ${_moc}) - SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE) - MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc}) + QT4_GENERATE_MOC("${_header}" "${_moc}") + SET_SOURCE_FILES_PROPERTIES("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE) + MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}") - SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc}) + LIST(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}") ENDMACRO(QT4_ADD_DBUS_ADAPTOR) diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake index 84d0afd..0b2d1b8 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>" @@ -533,9 +533,9 @@ function (find_jar VARIABLE) endif (${_state} STREQUAL "name") endforeach (arg ${ARGN}) - if (${_jar_names} STREQUAL "") + if (NOT _jar_names) message(FATAL_ERROR "find_jar: No name to search for given") - endif (${_jar_names} STREQUAL "") + endif (NOT _jar_names) foreach (jar_name ${_jar_names}) foreach (version ${_jar_versions}) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index f9d1c03..14af796 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -337,6 +337,8 @@ IF (WIN32) cmGlobalVisualStudio11Generator.cxx cmGlobalVisualStudio11Win64Generator.h cmGlobalVisualStudio11Win64Generator.cxx + cmGlobalVisualStudio11ARMGenerator.h + cmGlobalVisualStudio11ARMGenerator.cxx cmGlobalVisualStudioGenerator.cxx cmGlobalVisualStudioGenerator.h cmGlobalWatcomWMakeGenerator.cxx @@ -355,18 +357,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) +if(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. When enabled, some CMake tests still fail on OSX") 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 @@ -381,8 +383,14 @@ IF(CMAKE_ENABLE_NINJA) cmNinjaUtilityTargetGenerator.h ) ADD_DEFINITIONS(-DCMAKE_USE_NINJA) + IF(WIN32 AND NOT CYGWIN AND NOT BORLAND) + SET_SOURCE_FILES_PROPERTIES(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501) + ADD_EXECUTABLE(cmcldeps cmcldeps.cxx) + TARGET_LINK_LIBRARIES(cmcldeps CMakeLib) + INSTALL_TARGETS(/bin cmcldeps) + ENDIF() ELSE() - MESSAGE(STATUS "Disable ninja generator.") + MESSAGE(STATUS "Ninja generator disabled, enable it with -DCMAKE_ENABLE_NINJA=ON") ENDIF() # create a library used by the command line and the GUI @@ -423,6 +431,9 @@ SET(CTEST_SRCS cmCTest.cxx CTest/cmCTestConfigureHandler.cxx CTest/cmCTestCoverageCommand.cxx CTest/cmCTestCoverageHandler.cxx + CTest/cmParseMumpsCoverage.cxx + CTest/cmParseCacheCoverage.cxx + CTest/cmParseGTMCoverage.cxx CTest/cmParsePHPCoverage.cxx CTest/cmCTestEmptyBinaryDirectoryCommand.cxx CTest/cmCTestGenericHandler.cxx diff --git a/Source/CMakeVersion.bash b/Source/CMakeVersion.bash new file mode 100755 index 0000000..126adba --- /dev/null +++ b/Source/CMakeVersion.bash @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Update the version component if it looks like a date or -f is given. +if test "x$1" = "x-f"; then shift ; n='*' ; else n='\{8\}' ; fi +if test "$#" -gt 0; then echo 1>&2 "usage: CMakeVersion.bash [-f]"; exit 1; fi +sed -i -e ' +s/\(^SET(CMake_VERSION_TWEAK\) [0-9]'"$n"'\(.*\)/\1 '"$(date +%Y%m%d)"'\2/ +' "${BASH_SOURCE%/*}/CMakeVersion.cmake" diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake new file mode 100644 index 0000000..73f86b8 --- /dev/null +++ b/Source/CMakeVersion.cmake @@ -0,0 +1,6 @@ +# CMake version number components. +SET(CMake_VERSION_MAJOR 2) +SET(CMake_VERSION_MINOR 8) +SET(CMake_VERSION_PATCH 8) +SET(CMake_VERSION_TWEAK 20120724) +#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/CPack/cmCPackDebGenerator.h b/Source/CPack/cmCPackDebGenerator.h index f536c47..7f2352f 100644 --- a/Source/CPack/cmCPackDebGenerator.h +++ b/Source/CPack/cmCPackDebGenerator.h @@ -31,6 +31,17 @@ public: cmCPackDebGenerator(); virtual ~cmCPackDebGenerator(); + static bool CanGenerate() + { +#ifdef __APPLE__ + // on MacOS enable CPackDeb iff dpkg is found + return cmSystemTools::FindProgram("dpkg") != "" ? true : false; +#else + // legacy behavior on other systems + return true; +#endif + } + protected: virtual int InitializeInternal(); /** diff --git a/Source/CPack/cmCPackDocumentVariables.cxx b/Source/CPack/cmCPackDocumentVariables.cxx index d2e3802..edbef45 100644 --- a/Source/CPack/cmCPackDocumentVariables.cxx +++ b/Source/CPack/cmCPackDocumentVariables.cxx @@ -77,4 +77,35 @@ void cmCPackDocumentVariables::DefineVariables(cmake* cm) "which is done right before packaging the files." " The script is not called by e.g.: make install.", false, "Variables common to all CPack generators"); + + cm->DefineProperty + ("CPACK_ABSOLUTE_DESTINATION_FILES", cmProperty::VARIABLE, + "List of files which have been installed using " + " an ABSOLUTE DESTINATION path.", + "This variable is a Read-Only variable which is set internally" + " by CPack during installation and before packaging using" + " CMAKE_ABSOLUTE_DESTINATION_FILES defined in cmake_install.cmake " + "scripts. The value can be used within CPack project configuration" + " file and/or CPack<GEN>.cmake file of <GEN> generator.", false, + "Variables common to all CPack generators"); + + cm->DefineProperty + ("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE, + "Ask CPack to warn each time a file with absolute INSTALL" + " DESTINATION is encountered.", + "This variable triggers the definition of " + "CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION when CPack runs" + " cmake_install.cmake scripts.", false, + "Variables common to all CPack generators"); + + cm->DefineProperty + ("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE, + "Ask CPack to error out as soon as a file with absolute INSTALL" + " DESTINATION is encountered.", + "The fatal error is emitted before the installation of " + "the offending file takes place. Some CPack generators, like NSIS," + "enforce this internally. " + "This variable triggers the definition of" + "CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION when CPack runs" + "Variables common to all CPack generators"); } diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 0f832b3..0177653 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -62,10 +62,31 @@ void cmCPackGenerator::DisplayVerboseOutput(const char* msg, //---------------------------------------------------------------------- int cmCPackGenerator::PrepareNames() -{ +{ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Create temp directory." << std::endl); + // checks CPACK_SET_DESTDIR support + if (IsOn("CPACK_SET_DESTDIR")) + { + if (SETDESTDIR_UNSUPPORTED==SupportsSetDestdir()) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "CPACK_SET_DESTDIR is set to ON but the '" + << Name << "' generator does NOT support it." + << std::endl); + return 0; + } + else if (SETDESTDIR_SHOULD_NOT_BE_USED==SupportsSetDestdir()) + { + cmCPackLogger(cmCPackLog::LOG_WARNING, + "CPACK_SET_DESTDIR is set to ON but it is " + << "usually a bad idea to do that with '" + << Name << "' generator. Use at your own risk." + << std::endl); + } + } + std::string tempDirectory = this->GetOption("CPACK_PACKAGE_DIRECTORY"); tempDirectory += "/_CPack_Packages/"; const char* toplevelTag = this->GetOption("CPACK_TOPLEVEL_TAG"); @@ -388,8 +409,11 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( std::string>(targetFile,inFileRelative)); } /* If it is not a symlink then do a plain copy */ - else if ( !cmSystemTools::CopyFileIfDifferent(inFile.c_str(), - filePath.c_str()) ) + else if (!( + cmSystemTools::CopyFileIfDifferent(inFile.c_str(),filePath.c_str()) + && + cmSystemTools::CopyFileTime(inFile.c_str(),filePath.c_str()) + ) ) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying file: " << inFile.c_str() << " -> " << filePath.c_str() << std::endl); @@ -828,8 +852,35 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( filesBefore = glB.GetFiles(); std::sort(filesBefore.begin(),filesBefore.end()); } + + // If CPack was asked to warn on ABSOLUTE INSTALL DESTINATION + // then forward request to cmake_install.cmake script + if (this->GetOption("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION")) + { + mf->AddDefinition("CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION", + "1"); + } + // If current CPack generator does support + // ABSOLUTE INSTALL DESTINATION or CPack has been asked for + // then ask cmake_install.cmake script to error out + // as soon as it occurs (before installing file) + if (!SupportsAbsoluteDestination() || + this->GetOption("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION")) + { + mf->AddDefinition("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", + "1"); + } // do installation int res = mf->ReadListFile(0, installFile.c_str()); + // forward definition of CMAKE_ABSOLUTE_DESTINATION_FILES + // to CPack (may be used by generators like CPack RPM or DEB) + // in order to transparently handle ABSOLUTE PATH + if (mf->GetDefinition("CMAKE_ABSOLUTE_DESTINATION_FILES")) + { + mf->AddDefinition("CPACK_ABSOLUTE_DESTINATION_FILES", + mf->GetDefinition("CMAKE_ABSOLUTE_DESTINATION_FILES")); + } + // Now rebuild the list of files after installation // of the current component (if we are in component install) if (componentInstall) @@ -953,6 +1004,8 @@ int cmCPackGenerator::DoPackage() cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Create package using " << this->Name.c_str() << std::endl); + // Prepare CPack internal name and check + // values for many CPACK_xxx vars if ( !this->PrepareNames() ) { return 0; @@ -1431,6 +1484,19 @@ std::string cmCPackGenerator::GetComponentPackageFileName( } //---------------------------------------------------------------------- +enum cmCPackGenerator::CPackSetDestdirSupport +cmCPackGenerator::SupportsSetDestdir() const +{ + return cmCPackGenerator::SETDESTDIR_SUPPORTED; +} + +//---------------------------------------------------------------------- +bool cmCPackGenerator::SupportsAbsoluteDestination() const +{ + return true; +} + +//---------------------------------------------------------------------- bool cmCPackGenerator::SupportsComponentInstallation() const { return false; diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 55afb44..6748512 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -63,6 +63,16 @@ public: cmSystemTools::OUTPUT_MERGE : cmSystemTools::OUTPUT_NONE; } /** + * Returns true if the generator may work on this system. + * Rational: + * Some CPack generator may run on some host and may not on others + * (with the same system) because some tools are missing. If the tool + * is missing then CPack won't activate (in the CPackGeneratorFactory) + * this particular generator. + */ + static bool CanGenerate() { return true; } + + /** * Do the actual whole package processing. * Subclass may redefine it but its usually enough * to redefine @ref PackageFiles, because in fact @@ -190,6 +200,38 @@ protected: bool setDestDir, const char* tempInstallDirectory); /** + * The various level of support of + * CPACK_SET_DESTDIR used by the generator. + */ + enum CPackSetDestdirSupport { + /* the generator works with or without it */ + SETDESTDIR_SUPPORTED, + /* the generator works best if automatically handled */ + SETDESTDIR_INTERNALLY_SUPPORTED, + /* no official support, use at your own risk */ + SETDESTDIR_SHOULD_NOT_BE_USED, + /* officially NOT supported */ + SETDESTDIR_UNSUPPORTED + }; + + /** + * Does the CPack generator support CPACK_SET_DESTDIR? + * The default legacy value is 'SETDESTDIR_SUPPORTED' generator + * have to override it in order change this. + * @return CPackSetDestdirSupport + */ + virtual enum CPackSetDestdirSupport SupportsSetDestdir() const; + + /** + * Does the CPack generator support absolute path + * in INSTALL DESTINATION? + * The default legacy value is 'true' generator + * have to override it in order change this. + * @return true if supported false otherwise + */ + virtual bool SupportsAbsoluteDestination() const; + + /** * Does the CPack generator support component installation?. * Some Generators requires the user to set * CPACK_<GENNAME>_COMPONENT_INSTALL in order to make this diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index a04b403..37ff460 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -31,7 +31,7 @@ # include "cmCPackCygwinSourceGenerator.h" #endif -#if !defined(_WIN32) && !defined(__APPLE__) \ +#if !defined(_WIN32) \ && !defined(__QNXNTO__) && !defined(__BEOS__) # include "cmCPackDebGenerator.h" # include "cmCPackRPMGenerator.h" @@ -40,44 +40,90 @@ #include "cmCPackLog.h" +#if defined(__BORLANDC__) +# pragma warn -8008 /* condition is always true */ +#endif + //---------------------------------------------------------------------- cmCPackGeneratorFactory::cmCPackGeneratorFactory() { - this->RegisterGenerator("TGZ", "Tar GZip compression", - cmCPackTGZGenerator::CreateGenerator); - this->RegisterGenerator("STGZ", "Self extracting Tar GZip compression", - cmCPackSTGZGenerator::CreateGenerator); - this->RegisterGenerator("NSIS", "Null Soft Installer", - cmCPackNSISGenerator::CreateGenerator); + if (cmCPackTGZGenerator::CanGenerate()) + { + this->RegisterGenerator("TGZ", "Tar GZip compression", + cmCPackTGZGenerator::CreateGenerator); + } + if (cmCPackSTGZGenerator::CanGenerate()) + { + this->RegisterGenerator("STGZ", "Self extracting Tar GZip compression", + cmCPackSTGZGenerator::CreateGenerator); + } + if (cmCPackNSISGenerator::CanGenerate()) + { + this->RegisterGenerator("NSIS", "Null Soft Installer", + cmCPackNSISGenerator::CreateGenerator); + } #ifdef __CYGWIN__ - this->RegisterGenerator("CygwinBinary", "Cygwin Binary Installer", - cmCPackCygwinBinaryGenerator::CreateGenerator); - this->RegisterGenerator("CygwinSource", "Cygwin Source Installer", - cmCPackCygwinSourceGenerator::CreateGenerator); + if (cmCPackCygwinBinaryGenerator::CanGenerate()) + { + this->RegisterGenerator("CygwinBinary", "Cygwin Binary Installer", + cmCPackCygwinBinaryGenerator::CreateGenerator); + } + if (cmCPackCygwinSourceGenerator::CanGenerate()) + { + this->RegisterGenerator("CygwinSource", "Cygwin Source Installer", + cmCPackCygwinSourceGenerator::CreateGenerator); + } #endif - this->RegisterGenerator("ZIP", "ZIP file format", - cmCPackZIPGenerator::CreateGenerator); - this->RegisterGenerator("TBZ2", "Tar BZip2 compression", - cmCPackTarBZip2Generator::CreateGenerator); - this->RegisterGenerator("TZ", "Tar Compress compression", - cmCPackTarCompressGenerator::CreateGenerator); + if (cmCPackZIPGenerator::CanGenerate()) + { + this->RegisterGenerator("ZIP", "ZIP file format", + cmCPackZIPGenerator::CreateGenerator); + } + if (cmCPackTarBZip2Generator::CanGenerate()) + { + this->RegisterGenerator("TBZ2", "Tar BZip2 compression", + cmCPackTarBZip2Generator::CreateGenerator); + } + if (cmCPackTarCompressGenerator::CanGenerate()) + { + this->RegisterGenerator("TZ", "Tar Compress compression", + cmCPackTarCompressGenerator::CreateGenerator); + } #ifdef __APPLE__ - this->RegisterGenerator("DragNDrop", "Mac OSX Drag And Drop", - cmCPackDragNDropGenerator::CreateGenerator); - this->RegisterGenerator("Bundle", "Mac OSX bundle", - cmCPackBundleGenerator::CreateGenerator); - this->RegisterGenerator("PackageMaker", "Mac OSX Package Maker installer", - cmCPackPackageMakerGenerator::CreateGenerator); - this->RegisterGenerator("OSXX11", "Mac OSX X11 bundle", - cmCPackOSXX11Generator::CreateGenerator); + if (cmCPackDragNDropGenerator::CanGenerate()) + { + this->RegisterGenerator("DragNDrop", "Mac OSX Drag And Drop", + cmCPackDragNDropGenerator::CreateGenerator); + } + if (cmCPackBundleGenerator::CanGenerate()) + { + this->RegisterGenerator("Bundle", "Mac OSX bundle", + cmCPackBundleGenerator::CreateGenerator); + } + if (cmCPackPackageMakerGenerator::CanGenerate()) + { + this->RegisterGenerator("PackageMaker", "Mac OSX Package Maker installer", + cmCPackPackageMakerGenerator::CreateGenerator); + } + if (cmCPackOSXX11Generator::CanGenerate()) + { + this->RegisterGenerator("OSXX11", "Mac OSX X11 bundle", + cmCPackOSXX11Generator::CreateGenerator); + } #endif -#if !defined(_WIN32) && !defined(__APPLE__) \ +#if !defined(_WIN32) \ && !defined(__QNXNTO__) && !defined(__BEOS__) - this->RegisterGenerator("DEB", "Debian packages", - cmCPackDebGenerator::CreateGenerator); - this->RegisterGenerator("RPM", "RPM packages", - cmCPackRPMGenerator::CreateGenerator); + if (cmCPackDebGenerator::CanGenerate()) + { + this->RegisterGenerator("DEB", "Debian packages", + cmCPackDebGenerator::CreateGenerator); + } + if (cmCPackRPMGenerator::CanGenerate()) + { + this->RegisterGenerator("RPM", "RPM packages", + cmCPackRPMGenerator::CreateGenerator); + } #endif } diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 0787ef9..7b52511 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -64,6 +64,7 @@ int cmCPackNSISGenerator::PackageFiles() << std::endl); return false; } + std::string nsisFileName = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string tmpFile = nsisFileName; tmpFile += "/NSISOutput.log"; @@ -542,8 +543,8 @@ void cmCPackNSISGenerator::CreateMenuLinks( cmOStringStream& str, { cmCPackLogger( cmCPackLog::LOG_ERROR, - "CPACK_PACKAGE_EXECUTABLES should contain pairs of <executable> and " - "<icon name>." << std::endl); + "CPACK_NSIS_MENU_LINKS should contain pairs of <shortcut target> and " + "<shortcut label>." << std::endl); return; } @@ -631,6 +632,19 @@ bool cmCPackNSISGenerator::GetListOfSubdirectories(const char* topdir, } //---------------------------------------------------------------------- +enum cmCPackGenerator::CPackSetDestdirSupport +cmCPackNSISGenerator::SupportsSetDestdir() const +{ + return cmCPackGenerator::SETDESTDIR_SHOULD_NOT_BE_USED; +} + +//---------------------------------------------------------------------- +bool cmCPackNSISGenerator::SupportsAbsoluteDestination() const +{ + return false; +} + +//---------------------------------------------------------------------- bool cmCPackNSISGenerator::SupportsComponentInstallation() const { return true; diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h index 7bccb89..8224854 100644 --- a/Source/CPack/cmCPackNSISGenerator.h +++ b/Source/CPack/cmCPackNSISGenerator.h @@ -44,6 +44,8 @@ protected: bool GetListOfSubdirectories(const char* dir, std::vector<std::string>& dirs); + enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const; + virtual bool SupportsAbsoluteDestination() const; virtual bool SupportsComponentInstallation() const; /// Produce a string that contains the NSIS code to describe a diff --git a/Source/CPack/cmCPackRPMGenerator.h b/Source/CPack/cmCPackRPMGenerator.h index 4883a0d..eec8204 100644 --- a/Source/CPack/cmCPackRPMGenerator.h +++ b/Source/CPack/cmCPackRPMGenerator.h @@ -35,6 +35,17 @@ public: cmCPackRPMGenerator(); virtual ~cmCPackRPMGenerator(); + static bool CanGenerate() + { +#ifdef __APPLE__ + // on MacOS enable CPackRPM iff rpmbuild is found + return cmSystemTools::FindProgram("rpmbuild") != "" ? true : false; +#else + // legacy behavior on other systems + return true; +#endif + } + protected: virtual int InitializeInternal(); virtual int PackageFiles(); diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 6f5055c..b603585 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -207,8 +207,7 @@ int main (int argc, char *argv[]) std::string helpHTML; std::string cpackProjectName; - std::string cpackProjectDirectory - = cmsys::SystemTools::GetCurrentWorkingDirectory(); + std::string cpackProjectDirectory; std::string cpackBuildConfig; std::string cpackProjectVersion; std::string cpackProjectPatch; @@ -294,8 +293,12 @@ int main (int argc, char *argv[]) cmDocumentation doc; doc.addCPackStandardDocSections(); - /* Were we invoked to display doc or to do some work ? */ - if(doc.CheckOptions(argc, argv,"-G") || nocwd) + /* Were we invoked to display doc or to do some work ? + * Unlike cmake launching cpack with zero argument + * should launch cpack using "cpackConfigFile" if it exists + * in the current directory. + */ + if((doc.CheckOptions(argc, argv,"-G") || nocwd) && !(argc==1)) { help = true; } @@ -370,10 +373,24 @@ int main (int argc, char *argv[]) globalMF->AddDefinition("CPACK_PACKAGE_VENDOR", cpackProjectVendor.c_str()); } + // if this is not empty it has been set on the command line + // go for it. Command line override values set in config file. if ( !cpackProjectDirectory.empty() ) { globalMF->AddDefinition("CPACK_PACKAGE_DIRECTORY", - cpackProjectDirectory.c_str()); + cpackProjectDirectory.c_str()); + } + // The value has not been set on the command line + else + { + // get a default value (current working directory) + cpackProjectDirectory = cmsys::SystemTools::GetCurrentWorkingDirectory(); + // use default value iff no value has been provided by the config file + if (!globalMF->IsSet("CPACK_PACKAGE_DIRECTORY")) + { + globalMF->AddDefinition("CPACK_PACKAGE_DIRECTORY", + cpackProjectDirectory.c_str()); + } } if ( !cpackBuildConfig.empty() ) { diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index 36302df..381c70c 100644 --- a/Source/CTest/cmCTestBZR.cxx +++ b/Source/CTest/cmCTestBZR.cxx @@ -128,13 +128,12 @@ class cmCTestBZR::RevnoParser: public cmCTestVC::LineParser { public: RevnoParser(cmCTestBZR* bzr, const char* prefix, std::string& rev): - BZR(bzr), Rev(rev) + Rev(rev) { this->SetLog(&bzr->Log, prefix); this->RegexRevno.compile("^([0-9]+)$"); } private: - cmCTestBZR* BZR; std::string& Rev; cmsys::RegularExpression RegexRevno; virtual bool ProcessLine() diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 309abb1..81d3669 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -11,6 +11,8 @@ ============================================================================*/ #include "cmCTestCoverageHandler.h" #include "cmParsePHPCoverage.h" +#include "cmParseGTMCoverage.h" +#include "cmParseCacheCoverage.h" #include "cmCTest.h" #include "cmake.h" #include "cmMakefile.h" @@ -373,21 +375,29 @@ int cmCTestCoverageHandler::ProcessHandler() } int file_count = 0; file_count += this->HandleGCovCoverage(&cont); + error = cont.Error; if ( file_count < 0 ) { return error; } file_count += this->HandleTracePyCoverage(&cont); + error = cont.Error; if ( file_count < 0 ) { return error; } file_count += this->HandlePHPCoverage(&cont); + error = cont.Error; if ( file_count < 0 ) { return error; } + file_count += this->HandleMumpsCoverage(&cont); error = cont.Error; + if ( file_count < 0 ) + { + return error; + } std::set<std::string> uncovered = this->FindUncoveredFiles(&cont); @@ -751,6 +761,73 @@ int cmCTestCoverageHandler::HandlePHPCoverage( } return static_cast<int>(cont->TotalCoverage.size()); } +//---------------------------------------------------------------------- +int cmCTestCoverageHandler::HandleMumpsCoverage( + cmCTestCoverageHandlerContainer* cont) +{ + // try gtm coverage + cmParseGTMCoverage cov(*cont, this->CTest); + std::string coverageFile = this->CTest->GetBinaryDir() + + "/gtm_coverage.mcov"; + if(cmSystemTools::FileExists(coverageFile.c_str())) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Parsing Cache Coverage: " << coverageFile + << std::endl); + cov.ReadCoverageFile(coverageFile.c_str()); + return static_cast<int>(cont->TotalCoverage.size()); + } + else + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " Cannot find foobar GTM coverage file: " << coverageFile + << std::endl); + } + cmParseCacheCoverage ccov(*cont, this->CTest); + coverageFile = this->CTest->GetBinaryDir() + + "/cache_coverage.cmcov"; + if(cmSystemTools::FileExists(coverageFile.c_str())) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Parsing Cache Coverage: " << coverageFile + << std::endl); + ccov.ReadCoverageFile(coverageFile.c_str()); + } + else + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " Cannot find Cache coverage file: " << coverageFile + << std::endl); + } + 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( @@ -773,7 +850,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( std::string st2gcovOutputRex1 = "^File *[`'](.*)'$"; std::string st2gcovOutputRex2 = "Lines executed: *[0-9]+\\.[0-9]+% of [0-9]+$"; - std::string st2gcovOutputRex3 = "^(.*):creating [`'](.*\\.gcov)'"; + std::string st2gcovOutputRex3 = "^(.*)reating [`'](.*\\.gcov)'"; std::string st2gcovOutputRex4 = "^(.*):unexpected EOF *$"; std::string st2gcovOutputRex5 = "^(.*):cannot open source file*$"; std::string st2gcovOutputRex6 @@ -815,7 +892,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 @@ -1778,7 +1856,7 @@ int cmCTestCoverageHandler::HandleBullseyeCoverage( cmCTestCoverageHandlerContainer* cont) { const char* covfile = cmSystemTools::GetEnv("COVFILE"); - if(!covfile) + if(!covfile || strlen(covfile) == 0) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " COVFILE environment variable not found, not running " diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h index d3e8503..92b0b22 100644 --- a/Source/CTest/cmCTestCoverageHandler.h +++ b/Source/CTest/cmCTestCoverageHandler.h @@ -70,6 +70,8 @@ private: //! Handle coverage using xdebug php coverage int HandlePHPCoverage(cmCTestCoverageHandlerContainer* cont); + //! Handle coverage for mumps + int HandleMumpsCoverage(cmCTestCoverageHandlerContainer* cont); //! Handle coverage using Bullseye int HandleBullseyeCoverage(cmCTestCoverageHandlerContainer* cont); 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/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 81f18b0..c3de5dc 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -671,7 +671,7 @@ bool cmCTestRunTest::ForkProcess(double testTimeOut, bool explicitTimeout, if (environment && environment->size()>0) { - cmSystemTools::AppendEnv(environment); + cmSystemTools::AppendEnv(*environment); } return this->TestProcess->StartProcess(); diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 5841b8d..8643cb3 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -435,6 +435,15 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) return 2; } + // Add definitions of variables passed in on the command line: + const std::map<std::string, std::string> &defs = + this->CTest->GetDefinitions(); + for (std::map<std::string, std::string>::const_iterator it = defs.begin(); + it != defs.end(); ++it) + { + this->Makefile->AddDefinition(it->first.c_str(), it->second.c_str()); + } + // finally read in the script if (!this->Makefile->ReadListFile(0, script.c_str()) || cmSystemTools::GetErrorOccuredFlag()) @@ -643,11 +652,7 @@ int cmCTestScriptHandler::RunCurrentScript() { std::vector<std::string> envArgs; cmSystemTools::ExpandListArgument(this->CTestEnv.c_str(),envArgs); - // for each variable/argument do a putenv - for (unsigned i = 0; i < envArgs.size(); ++i) - { - cmSystemTools::PutEnv(envArgs[i].c_str()); - } + cmSystemTools::AppendEnv(envArgs); } // now that we have done most of the error checking finally run the diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx new file mode 100644 index 0000000..137f344 --- /dev/null +++ b/Source/CTest/cmParseCacheCoverage.cxx @@ -0,0 +1,220 @@ +#include "cmStandardIncludes.h" +#include <stdio.h> +#include <stdlib.h> +#include "cmSystemTools.h" +#include "cmParseCacheCoverage.h" +#include <cmsys/Directory.hxx> +#include <cmsys/Glob.hxx> + + +cmParseCacheCoverage::cmParseCacheCoverage( + cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest) + :cmParseMumpsCoverage(cont, ctest) +{ +} + + +bool cmParseCacheCoverage::LoadCoverageData(const char* d) +{ + // load all the .mcov files in the specified directory + cmsys::Directory dir; + if(!dir.Load(d)) + { + return false; + } + size_t numf; + unsigned int i; + numf = dir.GetNumberOfFiles(); + for (i = 0; i < numf; i++) + { + std::string file = dir.GetFile(i); + if(file != "." && file != ".." + && !cmSystemTools::FileIsDirectory(file.c_str())) + { + std::string path = d; + path += "/"; + path += file; + if(cmSystemTools::GetFilenameLastExtension(path) == ".cmcov") + { + if(!this->ReadCMCovFile(path.c_str())) + { + return false; + } + } + } + } + return true; +} + +// not currently used, but leave it in case we want it in the future +void cmParseCacheCoverage::RemoveUnCoveredFiles() +{ + // loop over the coverage data computed and remove all files + // that only have -1 or 0 for the lines. + cmCTestCoverageHandlerContainer::TotalCoverageMap::iterator ci = + this->Coverage.TotalCoverage.begin(); + while(ci != this->Coverage.TotalCoverage.end()) + { + cmCTestCoverageHandlerContainer::SingleFileCoverageVector& v = + ci->second; + bool nothing = true; + for(cmCTestCoverageHandlerContainer::SingleFileCoverageVector::iterator i= + v.begin(); i != v.end(); ++i) + { + if(*i > 0) + { + nothing = false; + break; + } + } + if(nothing) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "No coverage found in: " << ci->first + << std::endl); + this->Coverage.TotalCoverage.erase(ci++); + } + else + { + ++ci; + } + } +} + +bool cmParseCacheCoverage::SplitString(std::vector<std::string>& args, + std::string const& line) +{ + std::string::size_type pos1 = 0; + std::string::size_type pos2 = line.find(',', 0); + if(pos2 == std::string::npos) + { + return false; + } + std::string arg; + while(pos2 != std::string::npos) + { + arg = line.substr(pos1, pos2-pos1); + args.push_back(arg); + pos1 = pos2+1; + pos2 = line.find(',',pos1); + } + arg = line.substr(pos1); + args.push_back(arg); + return true; +} + +bool cmParseCacheCoverage::ReadCMCovFile(const char* file) +{ + std::ifstream in(file); + if(!in) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Can not open : " + << file << "\n"); + return false; + } + std::string line; + std::vector<std::string> separateLine; + if(!cmSystemTools::GetLineFromStream(in, line)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Empty file : " + << file << " referenced in this line of cmcov data:\n" + "[" << line << "]\n"); + return false; + } + separateLine.clear(); + this->SplitString(separateLine, line); + if(separateLine.size() !=4 || separateLine[0] != "Routine" + || separateLine[1] != "Line" || separateLine[2] != "RtnLine" + || separateLine[3] != "Code") + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Bad first line of cmcov file : " + << file << " line:\n" + "[" << line << "]\n"); + } + std::string routine; + std::string filepath; + while(cmSystemTools::GetLineFromStream(in, line)) + { + // clear out line argument vector + separateLine.clear(); + // parse the comma separated line + this->SplitString(separateLine, line); + // might have more because code could have a quoted , in it + // but we only care about the first 3 args anyway + if(separateLine.size() < 4) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Bad line of cmcov file expected at least 4 found: " + << separateLine.size() << " " + << file << " line:\n" + "[" << line << "]\n"); + for(std::string::size_type i = 0; i < separateLine.size(); ++i) + { + cmCTestLog(this->CTest, ERROR_MESSAGE,"" + << separateLine[1] << " "); + } + cmCTestLog(this->CTest, ERROR_MESSAGE, "\n"); + return false; + } + // if we do not have a routine yet, then it should be + // the first argument in the vector + if(routine.size() == 0) + { + routine = separateLine[0]; + // Find the full path to the file + if(!this->FindMumpsFile(routine, filepath)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Could not find mumps file for routine: " + << routine << "\n"); + filepath = ""; + continue; // move to next line + } + } + // if we have a routine name, check for end of routine + else + { + // Totals in arg 0 marks the end of a routine + if(separateLine[0].substr(0, 6) == "Totals") + { + routine = ""; // at the end of this routine + filepath = ""; + continue; // move to next line + } + } + // if the file path was not found for the routine + // move to next line. We should have already warned + // after the call to FindMumpsFile that we did not find + // it, so don't report again to cut down on output + if(filepath.size() == 0) + { + continue; + } + // now we are ready to set the coverage from the line of data + cmCTestCoverageHandlerContainer::SingleFileCoverageVector& + coverageVector = this->Coverage.TotalCoverage[filepath]; + std::string::size_type linenumber = atoi(separateLine[1].c_str()) -1; + int count = atoi(separateLine[2].c_str()); + if(linenumber > coverageVector.size()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Parse error line is greater than number of lines in file: " + << linenumber << " " << filepath << "\n"); + continue; // skip setting count to avoid crash + } + // now add to count for linenumber + // for some reason the cache coverage adds extra lines to the + // end of the file in some cases. Since they do not exist, we will + // mark them as non executable + while(linenumber >= coverageVector.size()) + { + coverageVector.push_back(-1); + } + coverageVector[linenumber] += count; + } + return true; +} diff --git a/Source/CTest/cmParseCacheCoverage.h b/Source/CTest/cmParseCacheCoverage.h new file mode 100644 index 0000000..114eb92 --- /dev/null +++ b/Source/CTest/cmParseCacheCoverage.h @@ -0,0 +1,42 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc. + + 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 cmParseCacheCoverage_h +#define cmParseCacheCoverage_h + +#include "cmParseMumpsCoverage.h" + +/** \class cmParseCacheCoverage + * \brief Parse Cache coverage information + * + * This class is used to parse Cache coverage information for + * mumps. + */ +class cmParseCacheCoverage : public cmParseMumpsCoverage +{ +public: + cmParseCacheCoverage(cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest); +protected: + // implement virtual from parent + bool LoadCoverageData(const char* dir); + // remove files with no coverage + void RemoveUnCoveredFiles(); + // Read a single mcov file + bool ReadCMCovFile(const char* f); + // split a string based on , + bool SplitString(std::vector<std::string>& args, + std::string const& line); +}; + + +#endif diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx new file mode 100644 index 0000000..5dfcfe5 --- /dev/null +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -0,0 +1,272 @@ +#include "cmStandardIncludes.h" +#include <stdio.h> +#include <stdlib.h> +#include "cmSystemTools.h" +#include "cmParseGTMCoverage.h" +#include <cmsys/Directory.hxx> +#include <cmsys/Glob.hxx> + + +cmParseGTMCoverage::cmParseGTMCoverage(cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest) + :cmParseMumpsCoverage(cont, ctest) +{ +} + + +bool cmParseGTMCoverage::LoadCoverageData(const char* d) +{ + // load all the .mcov files in the specified directory + cmsys::Directory dir; + if(!dir.Load(d)) + { + return false; + } + size_t numf; + unsigned int i; + numf = dir.GetNumberOfFiles(); + for (i = 0; i < numf; i++) + { + std::string file = dir.GetFile(i); + if(file != "." && file != ".." + && !cmSystemTools::FileIsDirectory(file.c_str())) + { + std::string path = d; + path += "/"; + path += file; + if(cmSystemTools::GetFilenameLastExtension(path) == ".mcov") + { + if(!this->ReadMCovFile(path.c_str())) + { + return false; + } + } + } + } + return true; +} + +bool cmParseGTMCoverage::ReadMCovFile(const char* file) +{ + std::ifstream in(file); + if(!in) + { + return false; + } + std::string line; + std::string lastfunction; + std::string lastroutine; + std::string lastpath; + int lastoffset = 0; + while( cmSystemTools::GetLineFromStream(in, line)) + { + // only look at lines that have coverage data + if(line.find("^ZZCOVERAGE") == line.npos) + { + continue; + } + std::string filepath; + std::string function; + std::string routine; + int linenumber = 0; + int count = 0; + this->ParseMCOVLine(line, routine, function, linenumber, count); + // skip this one + if(routine == "RSEL") + { + continue; + } + // no need to search the file if we just did it + if(function == lastfunction && lastroutine == routine) + { + if(lastpath.size()) + { + this->Coverage.TotalCoverage[lastpath][lastoffset + linenumber] + += count; + } + else + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Can not find mumps file : " + << lastroutine << + " referenced in this line of mcov data:\n" + "[" << line << "]\n"); + } + continue; + } + // Find the full path to the file + bool found = this->FindMumpsFile(routine, filepath); + if(found) + { + int lineoffset; + if(this->FindFunctionInMumpsFile(filepath, + function, + lineoffset)) + { + cmCTestCoverageHandlerContainer::SingleFileCoverageVector& + coverageVector = this->Coverage.TotalCoverage[filepath]; + coverageVector[lineoffset + linenumber] += count; + } + lastoffset = lineoffset; + } + else + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Can not find mumps file : " + << routine << " referenced in this line of mcov data:\n" + "[" << line << "]\n"); + } + lastfunction = function; + lastroutine = routine; + lastpath = filepath; + } + return true; +} + +bool cmParseGTMCoverage::FindFunctionInMumpsFile(std::string const& filepath, + std::string const& function, + int& lineoffset) +{ + std::ifstream in(filepath.c_str()); + if(!in) + { + return false; + } + std::string line; + int linenum = 0; + while( cmSystemTools::GetLineFromStream(in, line)) + { + std::string::size_type pos = line.find(function.c_str()); + if(pos == 0) + { + char nextchar = line[function.size()]; + if(nextchar == ' ' || nextchar == '(') + { + lineoffset = linenum; + return true; + } + } + if(pos == 1) + { + char prevchar = line[0]; + char nextchar = line[function.size()+1]; + if(prevchar == '%' && (nextchar == ' ' || nextchar == '(')) + { + lineoffset = linenum; + return true; + } + } + linenum++; // move to next line count + } + lineoffset = 0; + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Could not find entry point : " + << function << " in " << filepath << "\n"); + return false; +} + +bool cmParseGTMCoverage::ParseMCOVLine(std::string const& line, + std::string& routine, + std::string& function, + int& linenumber, + int& count) +{ + // this method parses lines from the .mcov file + // each line has ^COVERAGE(...) in it, and there + // are several varients of coverage lines: + // + // ^COVERAGE("DIC11","PR1",0)="2:0:0:0" + // ( file , entry, line ) = "number_executed:timing_info" + // ^COVERAGE("%RSEL","SRC")="1:0:0:0" + // ( file , entry ) = "number_executed:timing_info" + // ^COVERAGE("%RSEL","init",8,"FOR_LOOP",1)=1 + // ( file , entry, line, IGNORE ) =number_executed + std::vector<cmStdString> args; + std::string::size_type pos = line.find('(', 0); + // if no ( is found, then return line has no coverage + if(pos == std::string::npos) + { + return false; + } + std::string arg; + bool done = false; + // separate out all of the comma separated arguments found + // in the COVERAGE(...) line + while(line[pos] && !done) + { + // save the char we are looking at + char cur = line[pos]; + // , or ) means end of argument + if(cur == ',' || cur == ')') + { + // save the argument into the argument vector + args.push_back(arg); + // start on a new argument + arg = ""; + // if we are at the end of the ), then finish while loop + if(cur == ')') + { + done = true; + } + } + else + { + // all chars except ", (, and % get stored in the arg string + if(cur != '\"' && cur != '(' && cur != '%') + { + arg.append(1, line[pos]); + } + } + // move to next char + pos++; + } + // now parse the right hand side of the = + pos = line.find('='); + // no = found, this is an error + if(pos == line.npos) + { + return false; + } + pos++; // move past = + + // if the next positing is not a ", then this is a + // COVERAGE(..)=count line and turn the rest of the string + // past the = into an integer and set it to count + if(line[pos] != '\"') + { + count = atoi(line.substr(pos).c_str()); + } + else + { + // this means line[pos] is a ", and we have a + // COVERAGE(...)="1:0:0:0" type of line + pos++; // move past " + // find the first : past the " + std::string::size_type pos2 = line.find(':', pos); + // turn the string between the " and the first : into an integer + // and set it to count + count = atoi(line.substr(pos, pos2-pos).c_str()); + } + // less then two arguments is an error + if(args.size() < 2) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error parsing mcov line: [" << line << "]\n"); + return false; + } + routine = args[0]; // the routine is the first argument + function = args[1]; // the function in the routine is the second + // in the two argument only format + // ^COVERAGE("%RSEL","SRC"), the line offset is 0 + if(args.size() == 2) + { + linenumber = 0; + } + else + { + // this is the format for this line + // ^COVERAGE("%RSEL","SRC",count) + linenumber = atoi(args[2].c_str()); + } + return true; +} diff --git a/Source/CTest/cmParseGTMCoverage.h b/Source/CTest/cmParseGTMCoverage.h new file mode 100644 index 0000000..c6d7ef9 --- /dev/null +++ b/Source/CTest/cmParseGTMCoverage.h @@ -0,0 +1,49 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc. + + 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 cmParseGTMCoverage_h +#define cmParseGTMCoverage_h + +#include "cmParseMumpsCoverage.h" + +/** \class cmParseGTMCoverage + * \brief Parse GTM coverage information + * + * This class is used to parse GTM coverage information for + * mumps. + */ +class cmParseGTMCoverage : public cmParseMumpsCoverage +{ +public: + cmParseGTMCoverage(cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest); +protected: + // implement virtual from parent + bool LoadCoverageData(const char* dir); + // Read a single mcov file + bool ReadMCovFile(const char* f); + // find out what line in a mumps file (filepath) the given entry point + // or function is. lineoffset is set by this method. + bool FindFunctionInMumpsFile(std::string const& filepath, + std::string const& function, + int& lineoffset); + // parse a line from a .mcov file, and fill in the + // routine, function, linenumber and coverage count + bool ParseMCOVLine(std::string const& line, + std::string& routine, + std::string& function, + int& linenumber, + int& count); +}; + + +#endif diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx new file mode 100644 index 0000000..37e8bd0 --- /dev/null +++ b/Source/CTest/cmParseMumpsCoverage.cxx @@ -0,0 +1,165 @@ +#include "cmStandardIncludes.h" +#include <stdio.h> +#include <stdlib.h> +#include "cmSystemTools.h" +#include "cmParseGTMCoverage.h" +#include <cmsys/Directory.hxx> +#include <cmsys/Glob.hxx> + + +cmParseMumpsCoverage::cmParseMumpsCoverage( + cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest) + :Coverage(cont), CTest(ctest) +{ +} + +cmParseMumpsCoverage::~cmParseMumpsCoverage() +{ +} + +bool cmParseMumpsCoverage::ReadCoverageFile(const char* file) +{ + // Read the gtm_coverage.mcov file, that has two lines of data: + // packages:/full/path/to/Vista/Packages + // coverage_dir:/full/path/to/dir/with/*.mcov + std::ifstream in(file); + if(!in) + { + return false; + } + std::string line; + while(cmSystemTools::GetLineFromStream(in, line)) + { + std::string::size_type pos = line.find(':', 0); + std::string packages; + if(pos != std::string::npos) + { + std::string type = line.substr(0, pos); + std::string path = line.substr(pos+1); + if(type == "packages") + { + this->LoadPackages(path.c_str()); + } + else if(type == "coverage_dir") + { + this->LoadCoverageData(path.c_str()); + } + else + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Parse Error in Mumps coverage file :\n" + << file << + "\ntype: [" << type << "]\npath:[" << path << "]\n" + "input line: [" << line << "]\n"); + } + } + } + return true; +} + +void cmParseMumpsCoverage::InitializeMumpsFile(std::string& file) +{ + // initialize the coverage information for a given mumps file + std::ifstream in(file.c_str()); + if(!in) + { + return; + } + std::string line; + cmCTestCoverageHandlerContainer::SingleFileCoverageVector& + coverageVector = this->Coverage.TotalCoverage[file]; + if(!cmSystemTools::GetLineFromStream(in, line)) + { + return; + } + // first line of a .m file can never be run + coverageVector.push_back(-1); + while( cmSystemTools::GetLineFromStream(in, line) ) + { + // putting in a 0 for a line means it is executable code + // putting in a -1 for a line means it is not executable code + int val = -1; // assume line is not executable + bool found = false; + std::string::size_type i = 0; + // (1) Search for the first whitespace or semicolon character on a line. + //This will skip over labels if the line starts with one, or will simply + //be the first character on the line for non-label lines. + for(; i < line.size(); ++i) + { + if(line[i] == ' ' || line[i] == '\t' || line[i] == ';') + { + found = true; + break; + } + } + if(found) + { + // (2) If the first character found above is whitespace then continue the + // search for the first following non-whitespace character. + if(line[i] == ' ' || line[i] == '\t') + { + while(i < line.size() && (line[i] == ' ' || line[i] == '\t')) + { + i++; + } + } + // (3) If the character found is not a semicolon then the line counts for + // coverage. + if(i < line.size() && line[i] != ';') + { + val = 0; + } + } + coverageVector.push_back(val); + } +} + +bool cmParseMumpsCoverage::LoadPackages(const char* d) +{ + cmsys::Glob glob; + glob.RecurseOn(); + std::string pat = d; + pat += "/*.m"; + glob.FindFiles(pat.c_str()); + std::vector<std::string>& files = glob.GetFiles(); + std::vector<std::string>::iterator fileIt; + for ( fileIt = files.begin(); fileIt != files.end(); + ++ fileIt ) + { + std::string name = cmSystemTools::GetFilenameName(*fileIt); + this->RoutineToDirectory[name.substr(0, name.size()-2)] = *fileIt; + // initialze each file, this is left out until CDash is fixed + // to handle large numbers of files + this->InitializeMumpsFile(*fileIt); + } + return true; +} + +bool cmParseMumpsCoverage::FindMumpsFile(std::string const& routine, + std::string& filepath) +{ + std::map<cmStdString, cmStdString>::iterator i = + this->RoutineToDirectory.find(routine); + if(i != this->RoutineToDirectory.end()) + { + filepath = i->second; + return true; + } + else + { + // try some alternate names + const char* tryname[] = {"GUX", "GTM", "ONT", 0}; + for(int k=0; tryname[k] != 0; k++) + { + std::string routine2 = routine + tryname[k]; + i = this->RoutineToDirectory.find(routine2); + if(i != this->RoutineToDirectory.end()) + { + filepath = i->second; + return true; + } + } + } + return false; +} diff --git a/Source/CTest/cmParseMumpsCoverage.h b/Source/CTest/cmParseMumpsCoverage.h new file mode 100644 index 0000000..c1effa7 --- /dev/null +++ b/Source/CTest/cmParseMumpsCoverage.h @@ -0,0 +1,52 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc. + + 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 cmParseMumpsCoverage_h +#define cmParseMumpsCoverage_h + +#include "cmStandardIncludes.h" +#include "cmCTestCoverageHandler.h" + +/** \class cmParseMumpsCoverage + * \brief Parse Mumps coverage information + * + * This class is used as the base class for Mumps coverage + * parsing. + */ +class cmParseMumpsCoverage +{ +public: + cmParseMumpsCoverage(cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest); + virtual ~cmParseMumpsCoverage(); + // This is the toplevel coverage file locating the coverage files + // and the mumps source code package tree. + bool ReadCoverageFile(const char* file); +protected: + // sub classes will use this to + // load all coverage files found in the given directory + virtual bool LoadCoverageData(const char* d) = 0; + // search the package directory for mumps files and fill + // in the RoutineToDirectory map + bool LoadPackages(const char* dir); + // initialize the coverage information for a single mumps file + void InitializeMumpsFile(std::string& file); + // Find mumps file for routine + bool FindMumpsFile(std::string const& routine, + std::string& filepath); +protected: + std::map<cmStdString, cmStdString> RoutineToDirectory; + cmCTestCoverageHandlerContainer& Coverage; + cmCTest* CTest; +}; + +#endif diff --git a/Source/CTest/cmParsePHPCoverage.h b/Source/CTest/cmParsePHPCoverage.h index ce5741d..d50a83c 100644 --- a/Source/CTest/cmParsePHPCoverage.h +++ b/Source/CTest/cmParsePHPCoverage.h @@ -37,9 +37,6 @@ private: bool ReadInt(std::ifstream& in, int& v); bool ReadCoverageArray(std::ifstream& in, cmStdString const&); bool ReadUntil(std::ifstream& in, char until); - typedef std::map<int, int> FileLineCoverage; - std::map<cmStdString, FileLineCoverage> FileToCoverage; - std::map<int, int> FileCoverage; cmCTestCoverageHandlerContainer& Coverage; cmCTest* CTest; }; diff --git a/Source/QtDialog/AddCacheEntry.cxx b/Source/QtDialog/AddCacheEntry.cxx index 00aaf69..e7fedc5 100644 --- a/Source/QtDialog/AddCacheEntry.cxx +++ b/Source/QtDialog/AddCacheEntry.cxx @@ -15,7 +15,7 @@ #include <QCompleter> static const int NumTypes = 4; -static const QString TypeStrings[NumTypes] = +static const QByteArray TypeStrings[NumTypes] = { "BOOL", "PATH", "FILEPATH", "STRING" }; static const QCMakeProperty::PropertyType Types[NumTypes] = { QCMakeProperty::BOOL, QCMakeProperty::PATH, diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index b4f3d72..c942bc4 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -125,7 +125,7 @@ int main(int argc, char** argv) // pick up translation files if they exists in the data directory QDir translationsDir = cmExecDir; - translationsDir.cd(".." CMAKE_DATA_DIR); + translationsDir.cd(QString::fromLocal8Bit(".." CMAKE_DATA_DIR)); translationsDir.cd("i18n"); QTranslator translator; QString transfile = QString("cmake_%1").arg(QLocale::system().name()); @@ -157,15 +157,15 @@ int main(int argc, char** argv) arg.Parse(); if(!sourceDirectory.empty() && !binaryDirectory.empty()) { - dialog.setSourceDirectory(sourceDirectory.c_str()); - dialog.setBinaryDirectory(binaryDirectory.c_str()); + dialog.setSourceDirectory(QString::fromLocal8Bit(sourceDirectory.c_str())); + dialog.setBinaryDirectory(QString::fromLocal8Bit(binaryDirectory.c_str())); } else { QStringList args = app.arguments(); if(args.count() == 2) { - cmsys_stl::string filePath = cmSystemTools::CollapseFullPath(args[1].toAscii().data()); + cmsys_stl::string filePath = cmSystemTools::CollapseFullPath(args[1].toLocal8Bit().data()); // check if argument is a directory containing CMakeCache.txt cmsys_stl::string buildFilePath = @@ -184,12 +184,18 @@ int main(int argc, char** argv) if(cmSystemTools::FileExists(buildFilePath.c_str())) { - dialog.setBinaryDirectory(cmSystemTools::GetFilenamePath(buildFilePath).c_str()); + dialog.setBinaryDirectory( + QString::fromLocal8Bit( + cmSystemTools::GetFilenamePath(buildFilePath).c_str() + ) + ); } else if(cmSystemTools::FileExists(srcFilePath.c_str())) { - dialog.setSourceDirectory(filePath.c_str()); - dialog.setBinaryDirectory(cmSystemTools::CollapseFullPath(".").c_str()); + dialog.setSourceDirectory(QString::fromLocal8Bit(filePath.c_str())); + dialog.setBinaryDirectory( + QString::fromLocal8Bit(cmSystemTools::CollapseFullPath(".").c_str()) + ); } } } diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 45b4cd3..c0dde1c 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -288,7 +288,7 @@ CMakeSetupDialog::~CMakeSetupDialog() // wait for thread to stop this->CMakeThread->quit(); - this->CMakeThread->wait(2000); + this->CMakeThread->wait(); } bool CMakeSetupDialog::prepareConfigure() @@ -299,9 +299,8 @@ bool CMakeSetupDialog::prepareConfigure() if(!dir.exists()) { QString msg = tr("Build directory does not exist, " - "should I create it?") - + "\n\n" - + tr("Directory: "); + "should I create it?\n\n" + "Directory: "); msg += bindir; QString title = tr("Create Directory"); QMessageBox::StandardButton btn; @@ -490,9 +489,9 @@ void CMakeSetupDialog::closeEvent(QCloseEvent* e) // don't close if we're busy, unless the user really wants to if(this->CurrentState == Configuring) { - QString msg = "You are in the middle of a Configure.\n" + QString msg = tr("You are in the middle of a Configure.\n" "If you Exit now the configure information will be lost.\n" - "Are you sure you want to Exit?"; + "Are you sure you want to Exit?"); QString title = tr("Confirm Exit"); QMessageBox::StandardButton btn; btn = QMessageBox::critical(this, title, msg, @@ -715,33 +714,33 @@ bool CMakeSetupDialog::setupFirstConfigure() QString mode = dialog.getCrossIncludeMode(); m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE", - "CMake Find Include Mode", mode, false); + tr("CMake Find Include Mode"), mode, false); mode = dialog.getCrossLibraryMode(); m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY", - "CMake Find Library Mode", mode, false); + tr("CMake Find Library Mode"), mode, false); mode = dialog.getCrossProgramMode(); m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM", - "CMake Find Program Mode", mode, false); + tr("CMake Find Program Mode"), mode, false); QString rootPath = dialog.getCrossRoot(); m->insertProperty(QCMakeProperty::PATH, "CMAKE_FIND_ROOT_PATH", - "CMake Find Root Path", rootPath, false); + tr("CMake Find Root Path"), rootPath, false); QString systemName = dialog.getSystemName(); m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_NAME", - "CMake System Name", systemName, false); + tr("CMake System Name"), systemName, false); QString cxxCompiler = dialog.getCXXCompiler(); m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER", - "CXX compiler.", cxxCompiler, false); + tr("CXX compiler."), cxxCompiler, false); QString cCompiler = dialog.getCCompiler(); m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER", - "C compiler.", cCompiler, false); + tr("C compiler."), cCompiler, false); } else if(dialog.crossCompilerToolChainFile()) { QString toolchainFile = dialog.getCrossCompilerToolChainFile(); m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE", - "Cross Compile ToolChain File", toolchainFile, false); + tr("Cross Compile ToolChain File"), toolchainFile, false); } return true; } @@ -772,7 +771,7 @@ void CMakeSetupDialog::doReloadCache() void CMakeSetupDialog::doDeleteCache() { QString title = tr("Delete Cache"); - QString msg = "Are you sure you want to delete the cache?"; + QString msg = tr("Are you sure you want to delete the cache?"); QMessageBox::StandardButton btn; btn = QMessageBox::information(this, title, msg, QMessageBox::Yes | QMessageBox::No); @@ -786,9 +785,9 @@ void CMakeSetupDialog::doDeleteCache() void CMakeSetupDialog::doAbout() { - QString msg = "CMake %1\n" + QString msg = tr("CMake %1\n" "Using Qt %2\n" - "www.cmake.org"; + "www.cmake.org"); msg = msg.arg(cmVersion::GetCMakeVersion()); msg = msg.arg(qVersion()); diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx index f522760..2a79877 100644 --- a/Source/QtDialog/FirstConfigure.cxx +++ b/Source/QtDialog/FirstConfigure.cxx @@ -17,10 +17,10 @@ StartCompilerSetup::StartCompilerSetup(QWidget* p) l->addWidget(this->GeneratorOptions); l->addSpacing(6); - this->CompilerSetupOptions[0] = new QRadioButton("Use default native compilers", this); - this->CompilerSetupOptions[1] = new QRadioButton("Specify native compilers", this); - this->CompilerSetupOptions[2] = new QRadioButton("Specify toolchain file for cross-compiling", this); - this->CompilerSetupOptions[3] = new QRadioButton("Specify options for cross-compiling", this); + this->CompilerSetupOptions[0] = new QRadioButton(tr("Use default native compilers"), this); + this->CompilerSetupOptions[1] = new QRadioButton(tr("Specify native compilers"), this); + this->CompilerSetupOptions[2] = new QRadioButton(tr("Specify toolchain file for cross-compiling"), this); + this->CompilerSetupOptions[3] = new QRadioButton(tr("Specify options for cross-compiling"), this); l->addWidget(this->CompilerSetupOptions[0]); l->addWidget(this->CompilerSetupOptions[1]); l->addWidget(this->CompilerSetupOptions[2]); @@ -159,9 +159,9 @@ CrossCompilerSetup::CrossCompilerSetup(QWidget* p) // fill in combo boxes QStringList modes; - modes << "Search in Target Root, then native system"; - modes << "Search only in Target Root"; - modes << "Search only in native system"; + modes << tr("Search in Target Root, then native system"); + modes << tr("Search only in Target Root"); + modes << tr("Search only in native system"); crossProgramMode->addItems(modes); crossLibraryMode->addItems(modes); crossIncludeMode->addItems(modes); diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 73050f3..8554ff8 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -46,16 +46,16 @@ QCMake::QCMake(QObject* p) } #endif - QString cmakeCommand = QString("cmake")+cmSystemTools::GetExecutableExtension(); + QString cmakeCommand = QString("cmake")+QString::fromLocal8Bit(cmSystemTools::GetExecutableExtension()); cmakeCommand = execDir.filePath(cmakeCommand); cmSystemTools::DisableRunCommandOutput(); cmSystemTools::SetRunCommandHideConsole(true); cmSystemTools::SetErrorCallback(QCMake::errorCallback, this); - cmSystemTools::FindExecutableDirectory(cmakeCommand.toAscii().data()); + cmSystemTools::FindExecutableDirectory(cmakeCommand.toLocal8Bit().data()); this->CMakeInstance = new cmake; - this->CMakeInstance->SetCMakeCommand(cmakeCommand.toAscii().data()); + this->CMakeInstance->SetCMakeCommand(cmakeCommand.toLocal8Bit().data()); #if defined(Q_OS_MAC) this->CMakeInstance->SetCMakeEditCommand("cmake-gui.app/Contents/MacOS/cmake-gui"); #else @@ -79,7 +79,7 @@ QCMake::QCMake(QObject* p) { continue; } - this->AvailableGenerators.append(iter->c_str()); + this->AvailableGenerators.append(QString::fromLocal8Bit(iter->c_str())); } } @@ -97,7 +97,7 @@ void QCMake::loadCache(const QString& dir) void QCMake::setSourceDirectory(const QString& _dir) { QString dir = - cmSystemTools::GetActualCaseForPath(_dir.toAscii().data()).c_str(); + QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str()); if(this->SourceDirectory != dir) { this->SourceDirectory = QDir::fromNativeSeparators(dir); @@ -108,7 +108,7 @@ void QCMake::setSourceDirectory(const QString& _dir) void QCMake::setBinaryDirectory(const QString& _dir) { QString dir = - cmSystemTools::GetActualCaseForPath(_dir.toAscii().data()).c_str(); + QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str()); if(this->BinaryDirectory != dir) { this->BinaryDirectory = QDir::fromNativeSeparators(dir); @@ -132,14 +132,14 @@ void QCMake::setBinaryDirectory(const QString& _dir) cmCacheManager::CacheIterator itm = cachem->NewIterator(); if ( itm.Find("CMAKE_HOME_DIRECTORY")) { - setSourceDirectory(itm.GetValue()); + setSourceDirectory(QString::fromLocal8Bit(itm.GetValue())); } if ( itm.Find("CMAKE_GENERATOR")) { const char* extraGen = cachem->GetCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: CreateFullGeneratorName(itm.GetValue(), extraGen); - this->setGenerator(curGen.c_str()); + this->setGenerator(QString::fromLocal8Bit(curGen.c_str())); } } } @@ -160,12 +160,12 @@ void QCMake::configure() UINT lastErrorMode = SetErrorMode(0); #endif - this->CMakeInstance->SetHomeDirectory(this->SourceDirectory.toAscii().data()); - this->CMakeInstance->SetStartDirectory(this->SourceDirectory.toAscii().data()); - this->CMakeInstance->SetHomeOutputDirectory(this->BinaryDirectory.toAscii().data()); - this->CMakeInstance->SetStartOutputDirectory(this->BinaryDirectory.toAscii().data()); + this->CMakeInstance->SetHomeDirectory(this->SourceDirectory.toLocal8Bit().data()); + this->CMakeInstance->SetStartDirectory(this->SourceDirectory.toLocal8Bit().data()); + this->CMakeInstance->SetHomeOutputDirectory(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->SetStartOutputDirectory(this->BinaryDirectory.toLocal8Bit().data()); this->CMakeInstance->SetGlobalGenerator( - this->CMakeInstance->CreateGlobalGenerator(this->Generator.toAscii().data())); + this->CMakeInstance->CreateGlobalGenerator(this->Generator.toLocal8Bit().data())); this->CMakeInstance->LoadCache(); this->CMakeInstance->SetSuppressDevWarnings(this->SuppressDevWarnings); this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode); @@ -222,11 +222,11 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) } QCMakeProperty prop; - prop.Key = i.GetName(); + prop.Key = QString::fromLocal8Bit(i.GetName()); int idx = props.indexOf(prop); if(idx == -1) { - toremove.append(i.GetName()); + toremove.append(QString::fromLocal8Bit(i.GetName())); } else { @@ -237,7 +237,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) } else { - i.SetValue(prop.Value.toString().toAscii().data()); + i.SetValue(prop.Value.toString().toLocal8Bit().data()); } props.removeAt(idx); } @@ -247,47 +247,47 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) // remove some properites foreach(QString s, toremove) { - this->CMakeInstance->UnwatchUnusedCli(s.toAscii().data()); + this->CMakeInstance->UnwatchUnusedCli(s.toLocal8Bit().data()); - cachem->RemoveCacheEntry(s.toAscii().data()); + cachem->RemoveCacheEntry(s.toLocal8Bit().data()); } // add some new properites foreach(QCMakeProperty s, props) { - this->CMakeInstance->WatchUnusedCli(s.Key.toAscii().data()); + this->CMakeInstance->WatchUnusedCli(s.Key.toLocal8Bit().data()); if(s.Type == QCMakeProperty::BOOL) { - this->CMakeInstance->AddCacheEntry(s.Key.toAscii().data(), + this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toBool() ? "ON" : "OFF", - s.Help.toAscii().data(), + s.Help.toLocal8Bit().data(), cmCacheManager::BOOL); } else if(s.Type == QCMakeProperty::STRING) { - this->CMakeInstance->AddCacheEntry(s.Key.toAscii().data(), - s.Value.toString().toAscii().data(), - s.Help.toAscii().data(), + this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), + s.Value.toString().toLocal8Bit().data(), + s.Help.toLocal8Bit().data(), cmCacheManager::STRING); } else if(s.Type == QCMakeProperty::PATH) { - this->CMakeInstance->AddCacheEntry(s.Key.toAscii().data(), - s.Value.toString().toAscii().data(), - s.Help.toAscii().data(), + this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), + s.Value.toString().toLocal8Bit().data(), + s.Help.toLocal8Bit().data(), cmCacheManager::PATH); } else if(s.Type == QCMakeProperty::FILEPATH) { - this->CMakeInstance->AddCacheEntry(s.Key.toAscii().data(), - s.Value.toString().toAscii().data(), - s.Help.toAscii().data(), + this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), + s.Value.toString().toLocal8Bit().data(), + s.Help.toLocal8Bit().data(), cmCacheManager::FILEPATH); } } - cachem->SaveCache(this->BinaryDirectory.toAscii().data()); + cachem->SaveCache(this->BinaryDirectory.toLocal8Bit().data()); } QCMakePropertyList QCMake::properties() const @@ -307,9 +307,9 @@ QCMakePropertyList QCMake::properties() const } QCMakeProperty prop; - prop.Key = i.GetName(); - prop.Help = i.GetProperty("HELPSTRING"); - prop.Value = i.GetValue(); + prop.Key = QString::fromLocal8Bit(i.GetName()); + prop.Help = QString::fromLocal8Bit(i.GetProperty("HELPSTRING")); + prop.Value = QString::fromLocal8Bit(i.GetValue()); prop.Advanced = i.GetPropertyAsBool("ADVANCED"); if(i.GetType() == cmCacheManager::BOOL) @@ -330,7 +330,7 @@ QCMakePropertyList QCMake::properties() const prop.Type = QCMakeProperty::STRING; if (i.PropertyExists("STRINGS")) { - prop.Strings = QString(i.GetProperty("STRINGS")).split(";"); + prop.Strings = QString::fromLocal8Bit(i.GetProperty("STRINGS")).split(";"); } } @@ -356,11 +356,11 @@ void QCMake::progressCallback(const char* msg, float percent, void* cd) QCMake* self = reinterpret_cast<QCMake*>(cd); if(percent >= 0) { - emit self->progressChanged(msg, percent); + emit self->progressChanged(QString::fromLocal8Bit(msg), percent); } else { - emit self->outputMessage(msg); + emit self->outputMessage(QString::fromLocal8Bit(msg)); } QCoreApplication::processEvents(); } @@ -369,7 +369,7 @@ void QCMake::errorCallback(const char* msg, const char* /*title*/, bool& /*stop*/, void* cd) { QCMake* self = reinterpret_cast<QCMake*>(cd); - emit self->errorMessage(msg); + emit self->errorMessage(QString::fromLocal8Bit(msg)); QCoreApplication::processEvents(); } @@ -396,9 +396,9 @@ QStringList QCMake::availableGenerators() const void QCMake::deleteCache() { // delete cache - this->CMakeInstance->GetCacheManager()->DeleteCache(this->BinaryDirectory.toAscii().data()); + this->CMakeInstance->GetCacheManager()->DeleteCache(this->BinaryDirectory.toLocal8Bit().data()); // reload to make our cache empty - this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toAscii().data()); + this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); // emit no generator and no properties this->setGenerator(QString()); QCMakePropertyList props = this->properties(); @@ -411,7 +411,7 @@ void QCMake::reloadCache() QCMakePropertyList props; emit this->propertiesChanged(props); // reload - this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toAscii().data()); + this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); // emit new cache properties props = this->properties(); emit this->propertiesChanged(props); diff --git a/Source/QtDialog/QMacInstallDialog.cxx b/Source/QtDialog/QMacInstallDialog.cxx index 3aa509d..6eb053b 100644 --- a/Source/QtDialog/QMacInstallDialog.cxx +++ b/Source/QtDialog/QMacInstallDialog.cxx @@ -34,12 +34,11 @@ void QMacInstallDialog::DoInstall() { QDir installDir(this->Internals->InstallPrefix->text()); QString installTo = installDir.path(); - if(!cmSystemTools::FileExists(installTo.toAscii().data())) + if(!cmSystemTools::FileExists(installTo.toLocal8Bit().data())) { QString message = tr("Build install does not exist, " - "should I create it?") - + "\n\n" - + tr("Directory: "); + "should I create it?\n\n" + "Directory: "); message += installDir.path(); QString title = tr("Create Directory"); QMessageBox::StandardButton btn; @@ -47,7 +46,7 @@ void QMacInstallDialog::DoInstall() QMessageBox::Yes | QMessageBox::No); if(btn == QMessageBox::Yes) { - cmSystemTools::MakeDirectory(installTo.toAscii().data()); + cmSystemTools::MakeDirectory(installTo.toLocal8Bit().data()); } } QDir cmExecDir(QApplication::applicationDirPath()); @@ -66,14 +65,14 @@ void QMacInstallDialog::DoInstall() newName += "/"; newName += filename; // Remove the old files - if(cmSystemTools::FileExists(newName.toAscii().data())) + if(cmSystemTools::FileExists(newName.toLocal8Bit().data())) { - std::cout << "rm [" << newName.toAscii().data() << "]\n"; - if(!cmSystemTools::RemoveFile(newName.toAscii().data())) + std::cout << "rm [" << newName.toLocal8Bit().data() << "]\n"; + if(!cmSystemTools::RemoveFile(newName.toLocal8Bit().data())) { QString message = tr("Failed to remove file " "installation may be incomplete: "); - message += newName.toAscii().data(); + message += newName; QString title = tr("Error Removing file"); QMessageBox::StandardButton btn = QMessageBox::critical(this, title, message, @@ -84,14 +83,14 @@ void QMacInstallDialog::DoInstall() } } } - std::cout << "ln -s [" << file.toAscii().data() << "] ["; - std::cout << newName.toAscii().data() << "]\n"; - if(!cmSystemTools::CreateSymlink(file.toAscii().data(), - newName.toAscii().data())) + std::cout << "ln -s [" << file.toLocal8Bit().data() << "] ["; + std::cout << newName.toLocal8Bit().data() << "]\n"; + if(!cmSystemTools::CreateSymlink(file.toLocal8Bit().data(), + newName.toLocal8Bit().data())) { QString message = tr("Failed create symlink " "installation may be incomplete: "); - message += newName.toAscii().data(); + message += newName; QString title = tr("Error Creating Symlink"); QMessageBox::StandardButton btn = QMessageBox::critical(this, title, message, diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index c1d0e9d..fd39eec 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -102,16 +102,17 @@ bool cmAddLibraryCommand STATIC. But at this point we know only the name of the target, but not yet its linker language. */ if ((type != cmTarget::STATIC_LIBRARY) && + (type != cmTarget::OBJECT_LIBRARY) && (this->Makefile->GetCMakeInstance()->GetPropertyAsBool( "TARGET_SUPPORTS_SHARED_LIBS") == false)) { - std::string msg = "ADD_LIBRARY for library "; - msg += args[0]; - msg += " is used with the "; - msg += type==cmTarget::SHARED_LIBRARY ? "SHARED" : "MODULE"; - msg += " option, but the target platform supports only STATIC libraries. " - "Building it STATIC instead. This may lead to problems."; - cmSystemTools::Message(msg.c_str() ,"Warning"); + cmOStringStream w; + w << + "ADD_LIBRARY called with " << + (type==cmTarget::SHARED_LIBRARY ? "SHARED" : "MODULE") << + " option but the target platform does not support dynamic linking. " + "Building a STATIC library instead. This may lead to problems."; + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); type = cmTarget::STATIC_LIBRARY; } diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index dc6b749..b410e44 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -240,6 +240,7 @@ bool cmArchiveWrite::AddFile(const char* file, // Clear acl and xattr fields not useful for distribution. archive_entry_acl_clear(e); archive_entry_xattr_clear(e); + archive_entry_set_fflags(e, 0, 0); if(archive_write_header(this->Archive, e) != ARCHIVE_OK) { this->Error = "archive_write_header: "; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 3f7fdc7..b5687e3 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -48,7 +48,7 @@ #include <float.h> #include <ctype.h> -#include <memory> // auto_ptr +#include <cmsys/auto_ptr.hxx> #include <cm_zlib.h> #include <cmsys/Base64.h> @@ -509,7 +509,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) cmake cm; cmGlobalGenerator gg; gg.SetCMakeInstance(&cm); - std::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator()); + cmsys::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator()); cmMakefile *mf = lg->GetMakefile(); if ( !this->ReadCustomConfigurationFileTree(this->BinaryDir.c_str(), mf) ) { @@ -1277,7 +1277,6 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::ostream* log, double testTimeOut, std::vector<std::string>* environment) { - std::vector<std::string> origEnv; bool modifyEnv = (environment && environment->size()>0); // determine how much time we have @@ -1334,9 +1333,11 @@ int cmCTest::RunTest(std::vector<const char*> argv, } std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory(); + cmsys::auto_ptr<cmSystemTools::SaveRestoreEnvironment> saveEnv; if (modifyEnv) { - origEnv = cmSystemTools::AppendEnv(environment); + saveEnv.reset(new cmSystemTools::SaveRestoreEnvironment); + cmSystemTools::AppendEnv(*environment); } *retVal = inst.Run(args, output); @@ -1351,11 +1352,6 @@ int cmCTest::RunTest(std::vector<const char*> argv, "Internal cmCTest object used to run test." << std::endl << *output << std::endl); - if (modifyEnv) - { - cmSystemTools::RestoreEnv(origEnv); - } - return cmsysProcess_State_Exited; } std::vector<char> tempOutput; @@ -1364,9 +1360,11 @@ int cmCTest::RunTest(std::vector<const char*> argv, *output = ""; } + cmsys::auto_ptr<cmSystemTools::SaveRestoreEnvironment> saveEnv; if (modifyEnv) { - origEnv = cmSystemTools::AppendEnv(environment); + saveEnv.reset(new cmSystemTools::SaveRestoreEnvironment); + cmSystemTools::AppendEnv(*environment); } cmsysProcess* cp = cmsysProcess_New(); @@ -1436,11 +1434,6 @@ int cmCTest::RunTest(std::vector<const char*> argv, } cmsysProcess_Delete(cp); - if (modifyEnv) - { - cmSystemTools::RestoreEnv(origEnv); - } - return result; } @@ -1951,29 +1944,6 @@ bool cmCTest::AddTestsForDashboardType(std::string &targ) } else { - cmCTestLog(this, ERROR_MESSAGE, - "CTest -D called with incorrect option: " - << targ << std::endl); - cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl - << " " << "ctest" << " -D Continuous" << std::endl - << " " << "ctest" - << " -D Continuous(Start|Update|Configure|Build)" << std::endl - << " " << "ctest" - << " -D Continuous(Test|Coverage|MemCheck|Submit)" - << std::endl - << " " << "ctest" << " -D Experimental" << std::endl - << " " << "ctest" - << " -D Experimental(Start|Update|Configure|Build)" - << std::endl - << " " << "ctest" - << " -D Experimental(Test|Coverage|MemCheck|Submit)" - << std::endl - << " " << "ctest" << " -D Nightly" << std::endl - << " " << "ctest" - << " -D Nightly(Start|Update|Configure|Build)" << std::endl - << " " << "ctest" - << " -D Nightly(Test|Coverage|MemCheck|Submit)" << std::endl - << " " << "ctest" << " -D NightlyMemoryCheck" << std::endl); return false; } return true; @@ -1981,6 +1951,27 @@ bool cmCTest::AddTestsForDashboardType(std::string &targ) //---------------------------------------------------------------------- +void cmCTest::ErrorMessageUnknownDashDValue(std::string &val) +{ + cmCTestLog(this, ERROR_MESSAGE, + "CTest -D called with incorrect option: " << val << std::endl); + + cmCTestLog(this, ERROR_MESSAGE, + "Available options are:" << std::endl + << " ctest -D Continuous" << std::endl + << " ctest -D Continuous(Start|Update|Configure|Build)" << std::endl + << " ctest -D Continuous(Test|Coverage|MemCheck|Submit)" << std::endl + << " ctest -D Experimental" << std::endl + << " ctest -D Experimental(Start|Update|Configure|Build)" << std::endl + << " ctest -D Experimental(Test|Coverage|MemCheck|Submit)" << std::endl + << " ctest -D Nightly" << std::endl + << " ctest -D Nightly(Start|Update|Configure|Build)" << std::endl + << " ctest -D Nightly(Test|Coverage|MemCheck|Submit)" << std::endl + << " ctest -D NightlyMemoryCheck" << std::endl); +} + + +//---------------------------------------------------------------------- bool cmCTest::CheckArgument(const std::string& arg, const char* varg1, const char* varg2) { @@ -2239,13 +2230,29 @@ void cmCTest::HandleScriptArguments(size_t &i, } //---------------------------------------------------------------------- +bool cmCTest::AddVariableDefinition(const std::string &arg) +{ + std::string name; + std::string value; + cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + + if (cmCacheManager::ParseEntry(arg.c_str(), name, value, type)) + { + this->Definitions[name] = value; + return true; + } + + return false; +} + +//---------------------------------------------------------------------- // the main entry point of ctest, called from main int cmCTest::Run(std::vector<std::string> &args, std::string* output) { this->FindRunningCMake(); const char* ctestExec = "ctest"; bool cmakeAndTest = false; - bool performSomeTest = true; + bool executeTests = true; bool SRArgumentSpecified = false; // copy the command line @@ -2270,14 +2277,29 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output) this->ProduceXML = true; i++; std::string targ = args[i]; - // AddTestsForDashboard parses the dashborad type and converts it + // AddTestsForDashboard parses the dashboard type and converts it // into the separate stages if (!this->AddTestsForDashboardType(targ)) { - performSomeTest = false; + if (!this->AddVariableDefinition(targ)) + { + this->ErrorMessageUnknownDashDValue(targ); + executeTests = false; + } } } + // If it's not exactly -D, but it starts with -D, then try to parse out + // a variable definition from it, same as CMake does. Unsuccessful + // attempts are simply ignored since previous ctest versions ignore + // this too. (As well as many other unknown command line args.) + // + if(arg != "-D" && cmSystemTools::StringStartsWith(arg.c_str(), "-D")) + { + std::string input = arg.substr(2); + this->AddVariableDefinition(input); + } + if(this->CheckArgument(arg, "-T", "--test-action") && (i < args.size() -1) ) { @@ -2285,7 +2307,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output) i++; if ( !this->SetTest(args[i].c_str(), false) ) { - performSomeTest = false; + executeTests = false; cmCTestLog(this, ERROR_MESSAGE, "CTest -T called with incorrect option: " << args[i].c_str() << std::endl); @@ -2323,7 +2345,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output) } else { - performSomeTest = false; + executeTests = false; cmCTestLog(this, ERROR_MESSAGE, "CTest -M called with incorrect option: " << str.c_str() << std::endl); @@ -2394,8 +2416,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output) return retv; } - // if some tests must be run - if(performSomeTest) + if(executeTests) { int res; // call process directory diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 7c71b00..beffe9e 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -417,6 +417,12 @@ public: bool GetLabelSummary() { return this->LabelSummary;} std::string GetCostDataFile(); + + const std::map<std::string, std::string> &GetDefinitions() + { + return this->Definitions; + } + private: std::string ConfigType; std::string ScheduleType; @@ -516,6 +522,12 @@ private: //! parse the option after -D and convert it into the appropriate steps bool AddTestsForDashboardType(std::string &targ); + //! read as "emit an error message for an unknown -D value" + void ErrorMessageUnknownDashDValue(std::string &val); + + //! add a variable definition from a command line -D value + bool AddVariableDefinition(const std::string &arg); + //! parse and process most common command line arguments void HandleCommandLineArguments(size_t &i, std::vector<std::string> &args); @@ -558,6 +570,8 @@ private: int OutputLogFileLastTag; bool OutputTestOutputOnTestFailure; + + std::map<std::string, std::string> Definitions; }; class cmCTestLogWrite diff --git a/Source/cmCommandArgumentsHelper.cxx b/Source/cmCommandArgumentsHelper.cxx index 1c906a6..d920137 100644 --- a/Source/cmCommandArgumentsHelper.cxx +++ b/Source/cmCommandArgumentsHelper.cxx @@ -178,7 +178,7 @@ bool cmCAString::DoConsume(const std::string& arg, unsigned int index) void cmCAString::DoReset() { - this->String = this->DefaultString; + this->String = ""; } cmCAEnabler::cmCAEnabler(cmCommandArgumentsHelper* args, diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h index cb33ccd..3b0b058 100644 --- a/Source/cmCommandArgumentsHelper.h +++ b/Source/cmCommandArgumentsHelper.h @@ -125,11 +125,8 @@ class cmCAString : public cmCommandArgument /// Return the string const std::string& GetString() const {return this->String;} const char* GetCString() const {return this->String.c_str();} - void SetDefaultString(const char* text) - {this->DefaultString = (text ? text : "");} private: std::string String; - std::string DefaultString; unsigned int DataStart; virtual bool DoConsume(const std::string& arg, unsigned int index); virtual void DoReset(); diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 48f644b..1ae7035 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -281,6 +281,10 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) flag += this->Makefile->GetSafeDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); cmakeFlags.push_back(flag); } + if(this->Makefile->GetDefinition("CMAKE_POSITION_INDEPENDENT_CODE")!=0) + { + fprintf(fout, "SET(CMAKE_POSITION_INDEPENDENT_CODE \"ON\")\n"); + } /* Use a random file name to avoid rapid creation and deletion of the same executable name (some filesystems fail on that). */ @@ -404,6 +408,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/cmDependsFortranLexer.cxx b/Source/cmDependsFortranLexer.cxx index 438af2d..b0d9a74 100644 --- a/Source/cmDependsFortranLexer.cxx +++ b/Source/cmDependsFortranLexer.cxx @@ -20,7 +20,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 34 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -65,7 +65,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -96,6 +95,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -169,7 +170,15 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -203,13 +212,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - * Given that the standard has decreed that size_t exists since 1989, - * I guess we can afford to depend on it. Manoj. - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; @@ -367,8 +369,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 43 -#define YY_END_OF_BUFFER 44 +#define YY_NUM_RULES 44 +#define YY_END_OF_BUFFER 45 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -376,25 +378,26 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[161] = +static yyconst flex_int16_t yy_accept[165] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 44, 38, 40, 39, 42, 1, 38, 31, 2, 33, - 38, 39, 36, 38, 37, 38, 37, 40, 38, 39, - 38, 37, 9, 8, 9, 4, 3, 38, 0, 10, - 0, 0, 0, 0, 0, 31, 31, 32, 34, 36, - 38, 37, 0, 41, 37, 0, 0, 0, 0, 0, - 0, 0, 0, 38, 0, 11, 37, 0, 0, 5, - 0, 0, 0, 27, 0, 0, 31, 31, 31, 31, - 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, + 45, 39, 41, 40, 43, 1, 39, 32, 2, 34, + 39, 40, 37, 39, 38, 39, 38, 41, 39, 40, + 39, 38, 9, 8, 9, 4, 3, 39, 0, 10, + 0, 0, 0, 0, 0, 32, 32, 33, 35, 37, + 39, 38, 0, 42, 38, 0, 0, 0, 0, 0, + 0, 0, 0, 39, 0, 11, 38, 0, 0, 5, + 0, 0, 0, 28, 0, 0, 32, 32, 32, 32, + 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 28, 29, 0, 0, 0, 0, 0, 0, - 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, - 0, 30, 25, 0, 0, 18, 0, 0, 24, 19, - 0, 0, 17, 0, 0, 16, 26, 0, 0, 15, - 20, 0, 7, 35, 7, 13, 0, 12, 14, 0 + 0, 0, 29, 30, 0, 0, 0, 0, 0, 0, + 0, 23, 24, 0, 0, 0, 0, 0, 0, 0, + 0, 31, 26, 0, 0, 19, 0, 0, 25, 20, + 0, 0, 18, 0, 0, 17, 27, 0, 0, 16, + 21, 0, 7, 36, 7, 14, 0, 13, 15, 0, + 0, 0, 12, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -404,15 +407,15 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6, 7, 8, 9, 1, 10, 11, 1, 1, 12, 1, 13, 1, 1, 1, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 15, 16, 1, - 17, 18, 19, 1, 20, 20, 21, 22, 23, 24, - 20, 20, 25, 20, 20, 26, 20, 27, 20, 20, - 20, 20, 28, 20, 29, 20, 20, 20, 20, 20, - 1, 30, 1, 1, 31, 1, 20, 20, 32, 33, - - 34, 35, 20, 20, 36, 20, 20, 37, 20, 38, - 20, 20, 20, 20, 39, 20, 40, 20, 20, 20, - 20, 20, 1, 1, 1, 1, 1, 1, 1, 1, + 14, 14, 14, 14, 14, 14, 14, 15, 16, 17, + 18, 19, 20, 1, 21, 21, 22, 23, 24, 25, + 21, 21, 26, 21, 21, 27, 21, 28, 21, 21, + 21, 21, 29, 21, 30, 21, 21, 21, 21, 21, + 1, 31, 1, 1, 32, 1, 21, 21, 33, 34, + + 35, 36, 21, 21, 37, 21, 21, 38, 21, 39, + 21, 21, 21, 21, 40, 21, 41, 21, 21, 21, + 21, 21, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -429,178 +432,187 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[41] = +static yyconst flex_int32_t yy_meta[42] = { 0, 1, 2, 2, 3, 4, 3, 3, 1, 1, 3, - 3, 1, 3, 5, 1, 3, 3, 1, 1, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, - 5, 6, 6, 6, 6, 6, 6, 6, 6, 6 + 3, 1, 3, 5, 1, 3, 1, 3, 6, 1, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 1, 5, 7, 7, 7, 7, 7, 7, 7, 7, + 7 } ; -static yyconst flex_int16_t yy_base[169] = +static yyconst flex_int16_t yy_base[174] = { 0, - 0, 39, 0, 40, 184, 47, 43, 53, 55, 63, - 186, 0, 476, 476, 164, 476, 79, 72, 476, 476, - 143, 476, 130, 126, 0, 83, 119, 85, 149, 139, - 189, 220, 476, 131, 89, 476, 476, 0, 132, 476, - 259, 37, 69, 76, 34, 119, 137, 476, 0, 476, - 121, 0, 150, 476, 0, 154, 298, 0, 75, 138, - 142, 72, 127, 338, 94, 476, 0, 84, 158, 186, - 81, 145, 108, 172, 147, 173, 260, 266, 284, 299, - 272, 173, 178, 286, 245, 258, 285, 285, 78, 71, - 207, 476, 288, 291, 296, 304, 310, 315, 317, 326, - - 330, 330, 335, 338, 338, 341, 343, 341, 348, 62, - 52, 346, 476, 476, 353, 355, 357, 352, 359, 359, - 359, 476, 476, 363, 365, 370, 366, 375, 46, 38, - 378, 476, 476, 378, 381, 476, 376, 384, 476, 476, - 384, 387, 476, 115, 0, 476, 476, 388, 393, 476, - 476, 394, 476, 476, 476, 476, 398, 476, 476, 476, - 432, 438, 443, 445, 451, 457, 463, 469 + 0, 40, 0, 41, 188, 48, 44, 54, 56, 65, + 186, 0, 505, 505, 171, 505, 81, 74, 505, 505, + 158, 505, 151, 137, 0, 85, 122, 87, 153, 145, + 194, 226, 505, 143, 91, 505, 505, 0, 142, 505, + 266, 34, 70, 74, 34, 122, 141, 505, 0, 505, + 112, 0, 98, 505, 0, 154, 306, 0, 43, 133, + 139, 46, 130, 347, 130, 505, 0, 121, 163, 179, + 104, 156, 129, 176, 147, 178, 214, 267, 273, 292, + 279, 179, 249, 280, 257, 265, 288, 289, 116, 107, + 317, 505, 287, 289, 291, 302, 307, 310, 307, 311, + + 316, 326, 329, 333, 332, 336, 347, 345, 349, 101, + 86, 346, 505, 505, 350, 351, 353, 350, 357, 362, + 362, 505, 505, 367, 369, 371, 366, 372, 56, 47, + 374, 505, 505, 374, 379, 505, 374, 387, 505, 505, + 387, 391, 505, 117, 0, 505, 505, 392, 394, 505, + 505, 394, 505, 505, 505, 505, 395, 419, 505, 429, + 0, 25, 505, 505, 446, 453, 459, 462, 469, 476, + 483, 490, 497 } ; -static yyconst flex_int16_t yy_def[169] = +static yyconst flex_int16_t yy_def[174] = { 0, - 160, 1, 1, 1, 1, 1, 161, 161, 161, 161, - 160, 162, 160, 160, 163, 160, 162, 160, 160, 160, - 162, 160, 160, 162, 164, 162, 164, 160, 162, 160, - 165, 160, 160, 160, 160, 160, 160, 162, 163, 160, - 160, 160, 160, 160, 160, 160, 166, 160, 162, 160, - 162, 164, 160, 160, 27, 160, 160, 57, 160, 160, - 160, 160, 160, 165, 165, 160, 32, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 166, 166, 166, 166, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 167, 168, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 0, - 160, 160, 160, 160, 160, 160, 160, 160 + 164, 1, 1, 1, 1, 1, 165, 165, 165, 165, + 164, 166, 164, 164, 167, 164, 166, 164, 164, 164, + 166, 164, 164, 166, 168, 166, 168, 164, 166, 164, + 169, 164, 164, 164, 164, 164, 164, 166, 167, 164, + 164, 164, 164, 164, 164, 164, 170, 164, 166, 164, + 166, 168, 164, 164, 27, 164, 164, 57, 164, 164, + 164, 164, 164, 169, 169, 164, 32, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 170, 170, 170, 170, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 171, 172, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 173, 173, 164, 0, 164, 164, 164, 164, 164, 164, + 164, 164, 164 } ; -static yyconst flex_int16_t yy_nxt[517] = +static yyconst flex_int16_t yy_nxt[547] = { 0, 12, 13, 14, 13, 13, 15, 16, 12, 17, 18, - 19, 12, 20, 12, 21, 22, 23, 12, 24, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, - 27, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 28, 28, 145, 28, 28, 34, 29, 29, 28, 30, - 144, 28, 35, 36, 29, 34, 130, 34, 31, 71, - 76, 37, 35, 36, 35, 34, 129, 32, 32, 37, - 71, 76, 35, 46, 46, 111, 46, 47, 32, 32, - 41, 48, 110, 41, 53, 54, 56, 53, 90, 56, - 69, 70, 57, 69, 72, 73, 66, 83, 88, 74, - - 42, 43, 75, 44, 93, 72, 73, 45, 83, 88, - 74, 42, 43, 75, 44, 93, 154, 154, 45, 38, - 46, 46, 81, 46, 47, 81, 38, 38, 48, 96, - 38, 89, 55, 38, 40, 68, 38, 38, 78, 46, - 96, 78, 79, 63, 51, 82, 80, 50, 38, 55, - 58, 53, 54, 58, 53, 56, 82, 49, 56, 69, - 70, 57, 69, 84, 85, 86, 40, 99, 87, 94, - 59, 60, 95, 61, 84, 85, 86, 62, 99, 87, - 94, 59, 60, 95, 61, 160, 30, 91, 62, 64, - 91, 66, 160, 97, 100, 92, 64, 64, 98, 101, - - 64, 102, 64, 64, 97, 100, 64, 64, 91, 98, - 101, 91, 102, 160, 160, 160, 92, 160, 64, 64, - 65, 65, 66, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 67, 65, 65, 65, 65, 65, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 65, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 41, 78, 46, 41, 78, 79, 105, 78, 46, 80, - 78, 79, 160, 81, 160, 80, 81, 105, 160, 106, - 42, 43, 160, 44, 107, 78, 46, 45, 78, 79, - 106, 42, 43, 80, 44, 107, 82, 160, 45, 58, - - 78, 46, 58, 78, 79, 108, 109, 82, 80, 160, - 103, 160, 112, 104, 113, 160, 108, 109, 114, 59, - 60, 103, 61, 112, 104, 113, 62, 160, 115, 114, - 59, 60, 116, 61, 160, 160, 117, 62, 64, 115, - 66, 160, 118, 116, 160, 64, 64, 117, 119, 64, - 120, 64, 64, 118, 121, 64, 64, 160, 122, 119, - 123, 120, 124, 125, 126, 121, 127, 64, 64, 122, - 128, 123, 131, 124, 125, 126, 132, 127, 133, 134, - 135, 128, 136, 131, 137, 138, 139, 132, 140, 133, - 134, 135, 141, 136, 142, 137, 138, 139, 143, 140, - - 146, 147, 148, 141, 149, 142, 150, 151, 152, 143, - 156, 146, 147, 148, 157, 149, 158, 150, 151, 152, - 159, 156, 160, 160, 160, 157, 160, 158, 160, 160, - 160, 159, 33, 33, 33, 33, 33, 33, 38, 160, - 160, 160, 38, 39, 39, 39, 39, 39, 39, 52, - 52, 65, 65, 65, 65, 65, 65, 77, 77, 77, - 77, 77, 77, 153, 153, 153, 160, 153, 153, 155, - 160, 155, 160, 155, 155, 11, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160 + 19, 12, 20, 12, 21, 22, 12, 23, 12, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 26, 27, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 28, 28, 163, 28, 28, 34, 29, 29, 28, + 30, 145, 28, 35, 36, 29, 34, 71, 34, 31, + 144, 76, 37, 35, 36, 35, 83, 34, 71, 32, + 32, 37, 76, 88, 35, 46, 46, 83, 46, 47, + 32, 32, 41, 48, 88, 41, 53, 54, 56, 53, + 130, 56, 69, 70, 57, 69, 72, 73, 74, 53, + + 54, 75, 53, 42, 43, 129, 44, 72, 73, 74, + 45, 111, 75, 81, 42, 43, 81, 44, 154, 154, + 110, 45, 38, 46, 46, 90, 46, 47, 93, 38, + 38, 48, 66, 38, 89, 55, 38, 82, 38, 93, + 38, 38, 78, 46, 40, 78, 79, 68, 82, 63, + 80, 96, 38, 55, 58, 56, 51, 58, 56, 84, + 85, 57, 96, 86, 69, 70, 87, 69, 99, 50, + 84, 85, 49, 40, 86, 59, 60, 87, 61, 99, + 91, 94, 62, 91, 95, 164, 59, 60, 92, 61, + 30, 164, 94, 62, 64, 95, 66, 164, 97, 164, + + 100, 64, 64, 98, 164, 64, 101, 64, 64, 97, + 64, 100, 64, 64, 98, 78, 46, 101, 78, 79, + 164, 164, 164, 80, 64, 64, 65, 65, 66, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 67, + 65, 65, 65, 65, 65, 65, 67, 67, 67, 67, + 67, 67, 67, 67, 67, 67, 65, 67, 67, 67, + 67, 67, 67, 67, 67, 67, 67, 41, 78, 46, + 41, 78, 79, 102, 78, 46, 80, 78, 79, 105, + 81, 164, 80, 81, 102, 164, 164, 106, 42, 43, + 105, 44, 107, 78, 46, 45, 78, 79, 106, 42, + + 43, 80, 44, 107, 82, 103, 45, 58, 104, 108, + 58, 109, 112, 113, 114, 82, 103, 164, 91, 104, + 108, 91, 109, 112, 113, 114, 92, 115, 59, 60, + 116, 61, 117, 118, 119, 62, 164, 120, 115, 59, + 60, 116, 61, 117, 118, 119, 62, 64, 120, 66, + 164, 121, 164, 122, 64, 64, 123, 124, 64, 125, + 64, 64, 121, 64, 122, 64, 64, 123, 124, 126, + 125, 127, 128, 131, 132, 133, 134, 64, 64, 135, + 126, 136, 127, 128, 131, 132, 133, 134, 137, 138, + 135, 139, 136, 140, 141, 142, 143, 146, 147, 137, + + 138, 148, 139, 149, 140, 141, 142, 143, 146, 147, + 150, 151, 148, 152, 149, 156, 157, 158, 159, 164, + 160, 150, 151, 160, 152, 164, 156, 157, 158, 159, + 160, 164, 164, 160, 164, 161, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 161, 33, 33, 33, 33, + 33, 33, 33, 38, 164, 164, 164, 38, 38, 39, + 39, 39, 39, 39, 39, 39, 52, 164, 52, 65, + 65, 65, 65, 65, 65, 65, 77, 77, 77, 77, + 77, 77, 77, 153, 153, 153, 164, 153, 153, 153, + 155, 164, 155, 164, 155, 155, 155, 162, 162, 162, + + 162, 162, 164, 162, 11, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164 } ; -static yyconst flex_int16_t yy_chk[517] = +static yyconst flex_int16_t yy_chk[547] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 4, 130, 2, 4, 7, 2, 4, 6, 6, - 129, 6, 7, 7, 6, 8, 111, 9, 6, 42, - 45, 9, 8, 8, 9, 10, 110, 6, 6, 10, - 42, 45, 10, 18, 18, 90, 18, 18, 6, 6, - 17, 18, 89, 17, 26, 26, 28, 26, 68, 28, - 35, 35, 28, 35, 43, 43, 65, 59, 62, 44, - - 17, 17, 44, 17, 71, 43, 43, 17, 59, 62, - 44, 17, 17, 44, 17, 71, 144, 144, 17, 27, - 46, 46, 51, 46, 46, 51, 27, 27, 46, 73, - 27, 63, 27, 27, 39, 34, 27, 27, 47, 47, - 73, 47, 47, 30, 24, 51, 47, 23, 27, 27, - 29, 53, 53, 29, 53, 56, 51, 21, 56, 69, - 69, 56, 69, 60, 60, 61, 15, 75, 61, 72, - 29, 29, 72, 29, 60, 60, 61, 29, 75, 61, - 72, 29, 29, 72, 29, 11, 5, 70, 29, 31, - 70, 31, 0, 74, 76, 70, 31, 31, 74, 82, - - 31, 83, 31, 31, 74, 76, 31, 31, 91, 74, - 82, 91, 83, 0, 0, 0, 91, 0, 31, 31, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 1, 2, 4, 162, 2, 4, 7, 2, 4, 6, + 6, 130, 6, 7, 7, 6, 8, 42, 9, 6, + 129, 45, 9, 8, 8, 9, 59, 10, 42, 6, + 6, 10, 45, 62, 10, 18, 18, 59, 18, 18, + 6, 6, 17, 18, 62, 17, 26, 26, 28, 26, + 111, 28, 35, 35, 28, 35, 43, 43, 44, 53, + + 53, 44, 53, 17, 17, 110, 17, 43, 43, 44, + 17, 90, 44, 51, 17, 17, 51, 17, 144, 144, + 89, 17, 27, 46, 46, 68, 46, 46, 71, 27, + 27, 46, 65, 27, 63, 27, 27, 51, 27, 71, + 27, 27, 47, 47, 39, 47, 47, 34, 51, 30, + 47, 73, 27, 27, 29, 56, 24, 29, 56, 60, + 60, 56, 73, 61, 69, 69, 61, 69, 75, 23, + 60, 60, 21, 15, 61, 29, 29, 61, 29, 75, + 70, 72, 29, 70, 72, 11, 29, 29, 70, 29, + 5, 0, 72, 29, 31, 72, 31, 0, 74, 0, + + 76, 31, 31, 74, 0, 31, 82, 31, 31, 74, + 31, 76, 31, 31, 74, 77, 77, 82, 77, 77, + 0, 0, 0, 77, 31, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 41, 77, 77, 41, 77, 77, 85, 78, 78, 77, - 78, 78, 0, 81, 0, 78, 81, 85, 0, 86, - 41, 41, 0, 41, 86, 79, 79, 41, 79, 79, - 86, 41, 41, 79, 41, 86, 81, 0, 41, 57, - - 80, 80, 57, 80, 80, 87, 88, 81, 80, 0, - 84, 0, 93, 84, 94, 0, 87, 88, 95, 57, - 57, 84, 57, 93, 84, 94, 57, 0, 96, 95, - 57, 57, 97, 57, 0, 0, 98, 57, 64, 96, - 64, 0, 99, 97, 0, 64, 64, 98, 100, 64, - 101, 64, 64, 99, 102, 64, 64, 0, 103, 100, - 104, 101, 105, 106, 107, 102, 108, 64, 64, 103, - 109, 104, 112, 105, 106, 107, 115, 108, 116, 117, - 118, 109, 119, 112, 120, 121, 124, 115, 125, 116, - 117, 118, 126, 119, 127, 120, 121, 124, 128, 125, - - 131, 134, 135, 126, 137, 127, 138, 141, 142, 128, - 148, 131, 134, 135, 149, 137, 152, 138, 141, 142, - 157, 148, 0, 0, 0, 149, 0, 152, 0, 0, - 0, 157, 161, 161, 161, 161, 161, 161, 162, 0, - 0, 0, 162, 163, 163, 163, 163, 163, 163, 164, - 164, 165, 165, 165, 165, 165, 165, 166, 166, 166, - 166, 166, 166, 167, 167, 167, 0, 167, 167, 168, - 0, 168, 0, 168, 168, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160 + 32, 32, 32, 32, 32, 32, 32, 41, 78, 78, + 41, 78, 78, 83, 79, 79, 78, 79, 79, 85, + 81, 0, 79, 81, 83, 0, 0, 86, 41, 41, + 85, 41, 86, 80, 80, 41, 80, 80, 86, 41, + + 41, 80, 41, 86, 81, 84, 41, 57, 84, 87, + 57, 88, 93, 94, 95, 81, 84, 0, 91, 84, + 87, 91, 88, 93, 94, 95, 91, 96, 57, 57, + 97, 57, 98, 99, 100, 57, 0, 101, 96, 57, + 57, 97, 57, 98, 99, 100, 57, 64, 101, 64, + 0, 102, 0, 103, 64, 64, 104, 105, 64, 106, + 64, 64, 102, 64, 103, 64, 64, 104, 105, 107, + 106, 108, 109, 112, 115, 116, 117, 64, 64, 118, + 107, 119, 108, 109, 112, 115, 116, 117, 120, 121, + 118, 124, 119, 125, 126, 127, 128, 131, 134, 120, + + 121, 135, 124, 137, 125, 126, 127, 128, 131, 134, + 138, 141, 135, 142, 137, 148, 149, 152, 157, 0, + 158, 138, 141, 158, 142, 0, 148, 149, 152, 157, + 160, 0, 0, 160, 0, 158, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 160, 165, 165, 165, 165, + 165, 165, 165, 166, 0, 0, 0, 166, 166, 167, + 167, 167, 167, 167, 167, 167, 168, 0, 168, 169, + 169, 169, 169, 169, 169, 169, 170, 170, 170, 170, + 170, 170, 170, 171, 171, 171, 0, 171, 171, 171, + 172, 0, 172, 0, 172, 172, 172, 173, 173, 173, + + 173, 173, 0, 173, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164 } ; /* The intent behind this definition is that it'll catch @@ -673,7 +685,7 @@ Modify cmDependsFortranLexer.h: /*--------------------------------------------------------------------------*/ -#line 670 "cmDependsFortranLexer.cxx" +#line 678 "cmDependsFortranLexer.cxx" #define INITIAL 0 #define free_fmt 1 @@ -796,7 +808,12 @@ static int input (yyscan_t yyscanner ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -804,7 +821,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -815,7 +832,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - int n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -901,10 +918,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 75 "cmDependsFortranLexer.in.l" +#line 71 "cmDependsFortranLexer.in.l" -#line 901 "cmDependsFortranLexer.cxx" +#line 914 "cmDependsFortranLexer.cxx" if ( !yyg->yy_init ) { @@ -958,13 +975,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 161 ) + if ( yy_current_state >= 165 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 476 ); + while ( yy_base[yy_current_state] != 505 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -990,7 +1007,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 77 "cmDependsFortranLexer.in.l" +#line 73 "cmDependsFortranLexer.in.l" { cmDependsFortranParser_StringStart(yyextra); cmDependsFortranParser_SetOldStartcond(yyextra, YY_START); @@ -999,7 +1016,7 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -#line 83 "cmDependsFortranLexer.in.l" +#line 79 "cmDependsFortranLexer.in.l" { cmDependsFortranParser_StringStart(yyextra); cmDependsFortranParser_SetOldStartcond(yyextra, YY_START); @@ -1007,10 +1024,10 @@ YY_RULE_SETUP } YY_BREAK case 3: -#line 90 "cmDependsFortranLexer.in.l" +#line 86 "cmDependsFortranLexer.in.l" case 4: YY_RULE_SETUP -#line 90 "cmDependsFortranLexer.in.l" +#line 86 "cmDependsFortranLexer.in.l" { BEGIN(cmDependsFortranParser_GetOldStartcond(yyextra) ); yylvalp->string = strdup(cmDependsFortranParser_StringEnd(yyextra)); @@ -1018,17 +1035,17 @@ YY_RULE_SETUP } case 5: /* rule 5 can match eol */ -#line 97 "cmDependsFortranLexer.in.l" +#line 93 "cmDependsFortranLexer.in.l" case 6: /* rule 6 can match eol */ YY_RULE_SETUP -#line 97 "cmDependsFortranLexer.in.l" +#line 93 "cmDependsFortranLexer.in.l" /* Ignore (continued strings, free fmt) */ YY_BREAK case 7: /* rule 7 can match eol */ YY_RULE_SETUP -#line 99 "cmDependsFortranLexer.in.l" +#line 95 "cmDependsFortranLexer.in.l" { if (cmDependsFortranParser_GetOldStartcond(yyextra) == fixed_fmt) ; /* Ignore (cont. strings, fixed fmt) */ @@ -1041,7 +1058,7 @@ YY_RULE_SETUP case 8: /* rule 8 can match eol */ YY_RULE_SETUP -#line 109 "cmDependsFortranLexer.in.l" +#line 105 "cmDependsFortranLexer.in.l" { unput ('\n'); BEGIN(INITIAL); @@ -1049,7 +1066,7 @@ YY_RULE_SETUP } case 9: YY_RULE_SETUP -#line 115 "cmDependsFortranLexer.in.l" +#line 111 "cmDependsFortranLexer.in.l" { cmDependsFortranParser_StringAppend(yyextra, yytext[0]); } @@ -1057,96 +1074,99 @@ YY_RULE_SETUP case 10: /* rule 10 can match eol */ YY_RULE_SETUP -#line 119 "cmDependsFortranLexer.in.l" +#line 115 "cmDependsFortranLexer.in.l" { return EOSTMT; } /* Treat comments like */ case 11: /* rule 11 can match eol */ YY_RULE_SETUP -#line 120 "cmDependsFortranLexer.in.l" +#line 116 "cmDependsFortranLexer.in.l" { return EOSTMT; } /* empty lines */ case 12: +/* rule 12 can match eol */ YY_RULE_SETUP -#line 122 "cmDependsFortranLexer.in.l" -{ return CPP_INCLUDE; } +#line 118 "cmDependsFortranLexer.in.l" +{ + yytext[yyleng-1] = 0; + yylvalp->string = strdup(strchr(yytext, '<')+1); + return CPP_INCLUDE_ANGLE; +} case 13: YY_RULE_SETUP #line 123 "cmDependsFortranLexer.in.l" -{ return F90PPR_INCLUDE; } +{ return CPP_INCLUDE; } case 14: YY_RULE_SETUP #line 124 "cmDependsFortranLexer.in.l" -{ return COCO_INCLUDE; } +{ return F90PPR_INCLUDE; } case 15: YY_RULE_SETUP -#line 126 "cmDependsFortranLexer.in.l" -{ return CPP_DEFINE; } +#line 125 "cmDependsFortranLexer.in.l" +{ return COCO_INCLUDE; } case 16: YY_RULE_SETUP #line 127 "cmDependsFortranLexer.in.l" -{ return F90PPR_DEFINE; } +{ return CPP_DEFINE; } case 17: YY_RULE_SETUP -#line 129 "cmDependsFortranLexer.in.l" -{ return CPP_UNDEF; } +#line 128 "cmDependsFortranLexer.in.l" +{ return F90PPR_DEFINE; } case 18: YY_RULE_SETUP #line 130 "cmDependsFortranLexer.in.l" -{ return F90PPR_UNDEF; } +{ return CPP_UNDEF; } case 19: YY_RULE_SETUP -#line 132 "cmDependsFortranLexer.in.l" -{ return CPP_IFDEF; } +#line 131 "cmDependsFortranLexer.in.l" +{ return F90PPR_UNDEF; } case 20: YY_RULE_SETUP #line 133 "cmDependsFortranLexer.in.l" -{ return CPP_IFNDEF; } +{ return CPP_IFDEF; } case 21: YY_RULE_SETUP #line 134 "cmDependsFortranLexer.in.l" -{ return CPP_IF; } +{ return CPP_IFNDEF; } case 22: YY_RULE_SETUP #line 135 "cmDependsFortranLexer.in.l" -{ return CPP_ELIF; } +{ return CPP_IF; } case 23: YY_RULE_SETUP #line 136 "cmDependsFortranLexer.in.l" -{ return CPP_ELSE; } +{ return CPP_ELIF; } case 24: YY_RULE_SETUP #line 137 "cmDependsFortranLexer.in.l" -{ return CPP_ENDIF; } +{ return CPP_ELSE; } case 25: YY_RULE_SETUP -#line 139 "cmDependsFortranLexer.in.l" -{ return F90PPR_IFDEF; } +#line 138 "cmDependsFortranLexer.in.l" +{ return CPP_ENDIF; } case 26: YY_RULE_SETUP #line 140 "cmDependsFortranLexer.in.l" -{ return F90PPR_IFNDEF; } +{ return F90PPR_IFDEF; } case 27: YY_RULE_SETUP #line 141 "cmDependsFortranLexer.in.l" -{ return F90PPR_IF; } +{ return F90PPR_IFNDEF; } case 28: YY_RULE_SETUP #line 142 "cmDependsFortranLexer.in.l" -{ return F90PPR_ELIF; } +{ return F90PPR_IF; } case 29: YY_RULE_SETUP #line 143 "cmDependsFortranLexer.in.l" -{ return F90PPR_ELSE; } +{ return F90PPR_ELIF; } case 30: YY_RULE_SETUP #line 144 "cmDependsFortranLexer.in.l" -{ return F90PPR_ENDIF; } -/* Line continuations, possible involving comments. */ +{ return F90PPR_ELSE; } case 31: -/* rule 31 can match eol */ YY_RULE_SETUP -#line 147 "cmDependsFortranLexer.in.l" - - YY_BREAK +#line 145 "cmDependsFortranLexer.in.l" +{ return F90PPR_ENDIF; } +/* Line continuations, possible involving comments. */ case 32: /* rule 32 can match eol */ YY_RULE_SETUP @@ -1154,59 +1174,65 @@ YY_RULE_SETUP YY_BREAK case 33: +/* rule 33 can match eol */ YY_RULE_SETUP -#line 150 "cmDependsFortranLexer.in.l" -{ return COMMA; } +#line 149 "cmDependsFortranLexer.in.l" + + YY_BREAK case 34: YY_RULE_SETUP -#line 152 "cmDependsFortranLexer.in.l" -{ return DCOLON; } +#line 151 "cmDependsFortranLexer.in.l" +{ return COMMA; } case 35: -/* rule 35 can match eol */ YY_RULE_SETUP -#line 154 "cmDependsFortranLexer.in.l" -{ return GARBAGE; } +#line 153 "cmDependsFortranLexer.in.l" +{ return DCOLON; } case 36: +/* rule 36 can match eol */ YY_RULE_SETUP -#line 156 "cmDependsFortranLexer.in.l" -{ return ASSIGNMENT_OP; } +#line 155 "cmDependsFortranLexer.in.l" +{ return GARBAGE; } case 37: YY_RULE_SETUP -#line 158 "cmDependsFortranLexer.in.l" +#line 157 "cmDependsFortranLexer.in.l" +{ return ASSIGNMENT_OP; } +case 38: +YY_RULE_SETUP +#line 159 "cmDependsFortranLexer.in.l" { yylvalp->string = strdup(yytext); return WORD; } -case 38: +case 39: YY_RULE_SETUP -#line 163 "cmDependsFortranLexer.in.l" +#line 164 "cmDependsFortranLexer.in.l" { return GARBAGE; } -case 39: -/* rule 39 can match eol */ +case 40: +/* rule 40 can match eol */ YY_RULE_SETUP -#line 165 "cmDependsFortranLexer.in.l" +#line 166 "cmDependsFortranLexer.in.l" { return EOSTMT; } -case 40: +case 41: YY_RULE_SETUP -#line 168 "cmDependsFortranLexer.in.l" +#line 169 "cmDependsFortranLexer.in.l" /* Ignore */ YY_BREAK -case 41: -/* rule 41 can match eol */ +case 42: +/* rule 42 can match eol */ YY_RULE_SETUP -#line 169 "cmDependsFortranLexer.in.l" +#line 170 "cmDependsFortranLexer.in.l" /* Ignore line-endings preceeded by \ */ YY_BREAK -case 42: +case 43: YY_RULE_SETUP -#line 171 "cmDependsFortranLexer.in.l" +#line 172 "cmDependsFortranLexer.in.l" { return *yytext; } case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(free_fmt): case YY_STATE_EOF(fixed_fmt): case YY_STATE_EOF(str_sq): case YY_STATE_EOF(str_dq): -#line 173 "cmDependsFortranLexer.in.l" +#line 174 "cmDependsFortranLexer.in.l" { if(!cmDependsFortranParser_FilePop(yyextra) ) { @@ -1214,12 +1240,12 @@ case YY_STATE_EOF(str_dq): } } YY_BREAK -case 43: +case 44: YY_RULE_SETUP -#line 180 "cmDependsFortranLexer.in.l" +#line 181 "cmDependsFortranLexer.in.l" ECHO; YY_BREAK -#line 1247 "cmDependsFortranLexer.cxx" +#line 1270 "cmDependsFortranLexer.cxx" case YY_END_OF_BUFFER: { @@ -1512,7 +1538,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 161 ) + if ( yy_current_state >= 165 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1541,11 +1567,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 161 ) + if ( yy_current_state >= 165 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 160); + yy_is_jam = (yy_current_state == 164); return yy_is_jam ? 0 : yy_current_state; } @@ -1991,7 +2017,7 @@ YY_BUFFER_STATE cmDependsFortran_yy_scan_string (yyconst char * yystr , yyscan_t } /** Setup the input buffer state to scan the given bytes. The next call to cmDependsFortran_yylex() will - * scan from a @e copy of @a yybytes. + * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. @@ -2154,7 +2180,7 @@ void cmDependsFortran_yyset_lineno (int line_number , yyscan_t yyscanner) } /** Set the current column. - * @param column_no + * @param line_number * @param yyscanner The scanner object. */ void cmDependsFortran_yyset_column (int column_no , yyscan_t yyscanner) @@ -2374,7 +2400,7 @@ void cmDependsFortran_yyfree (void * ptr , yyscan_t) #define YYTABLES_NAME "yytables" -#line 180 "cmDependsFortranLexer.in.l" +#line 181 "cmDependsFortranLexer.in.l" diff --git a/Source/cmDependsFortranLexer.h b/Source/cmDependsFortranLexer.h index 85e861d..8e24cfd 100644 --- a/Source/cmDependsFortranLexer.h +++ b/Source/cmDependsFortranLexer.h @@ -20,7 +20,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 34 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -65,7 +65,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -96,6 +95,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -138,7 +139,15 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif #ifndef YY_TYPEDEF_YY_BUFFER_STATE @@ -146,13 +155,6 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - * Given that the standard has decreed that size_t exists since 1989, - * I guess we can afford to depend on it. Manoj. - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; @@ -304,7 +306,12 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Number of entries by which start-condition stack grows. */ diff --git a/Source/cmDependsFortranLexer.in.l b/Source/cmDependsFortranLexer.in.l index af8e37d..40e80b7 100644 --- a/Source/cmDependsFortranLexer.in.l +++ b/Source/cmDependsFortranLexer.in.l @@ -115,6 +115,11 @@ Modify cmDependsFortranLexer.h: !.*\n { return EOSTMT; } /* Treat comments like */ <fixed_fmt>^[cC*dD].*\n { return EOSTMT; } /* empty lines */ +^[ \t]*#[ \t]*include[ \t]*<[^>]+> { + yytext[yyleng-1] = 0; + yylvalp->string = strdup(strchr(yytext, '<')+1); + return CPP_INCLUDE_ANGLE; +} ^[ \t]*#[ \t]*include { return CPP_INCLUDE; } \$[ \t]*include { return F90PPR_INCLUDE; } \?\?[ \t]*include { return COCO_INCLUDE; } diff --git a/Source/cmDependsFortranParser.cxx b/Source/cmDependsFortranParser.cxx index ea31d3a..7b49a9c 100644 --- a/Source/cmDependsFortranParser.cxx +++ b/Source/cmDependsFortranParser.cxx @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.1" +#define YYBISON_VERSION "2.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -74,7 +73,7 @@ /* Copy the first part of user declarations. */ -/* Line 189 of yacc.c */ +/* Line 268 of yacc.c */ #line 1 "cmDependsFortranParser.y" /*============================================================================ @@ -161,8 +160,8 @@ static bool cmDependsFortranParserIsKeyword(const char* word, #endif -/* Line 189 of yacc.c */ -#line 172 "cmDependsFortranParser.cxx" +/* Line 268 of yacc.c */ +#line 165 "cmDependsFortranParser.cxx" /* Enabling traces. */ #ifndef YYDEBUG @@ -216,7 +215,8 @@ static bool cmDependsFortranParserIsKeyword(const char* word, CPP_TOENDL = 282, UNTERMINATED_STRING = 283, STRING = 284, - WORD = 285 + WORD = 285, + CPP_INCLUDE_ANGLE = 286 }; #endif /* Tokens. */ @@ -248,6 +248,7 @@ static bool cmDependsFortranParserIsKeyword(const char* word, #define UNTERMINATED_STRING 283 #define STRING 284 #define WORD 285 +#define CPP_INCLUDE_ANGLE 286 @@ -256,15 +257,15 @@ static bool cmDependsFortranParserIsKeyword(const char* word, typedef union YYSTYPE { -/* Line 214 of yacc.c */ -#line 94 "cmDependsFortranParser.y" +/* Line 293 of yacc.c */ +#line 89 "cmDependsFortranParser.y" char* string; -/* Line 214 of yacc.c */ -#line 274 "cmDependsFortranParser.cxx" +/* Line 293 of yacc.c */ +#line 269 "cmDependsFortranParser.cxx" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -275,8 +276,8 @@ typedef union YYSTYPE /* Copy the second part of user declarations. */ -/* Line 264 of yacc.c */ -#line 286 "cmDependsFortranParser.cxx" +/* Line 343 of yacc.c */ +#line 281 "cmDependsFortranParser.cxx" #ifdef short # undef short @@ -326,7 +327,7 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if YYENABLE_NLS +# if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -379,11 +380,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -406,24 +407,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -452,23 +453,7 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -488,23 +473,43 @@ union yyalloc #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 271 +#define YYLAST 276 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 31 +#define YYNTOKENS 32 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 16 /* YYNRULES -- Number of rules. */ -#define YYNRULES 52 +#define YYNRULES 53 /* YYNRULES -- Number of states. */ -#define YYNSTATES 94 +#define YYNSTATES 97 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 285 +#define YYMAXUTOK 286 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -540,7 +545,7 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30 + 25, 26, 27, 28, 29, 30, 31 }; #if YYDEBUG @@ -549,43 +554,43 @@ static const yytype_uint8 yytranslate[] = static const yytype_uint8 yyprhs[] = { 0, 0, 3, 4, 7, 9, 11, 16, 19, 24, - 30, 38, 43, 48, 53, 58, 63, 68, 72, 76, - 80, 84, 89, 93, 95, 97, 99, 101, 103, 105, - 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, - 127, 129, 131, 133, 135, 136, 139, 141, 143, 145, - 147, 149, 151 + 30, 38, 43, 47, 52, 57, 62, 67, 72, 76, + 80, 84, 88, 93, 97, 99, 101, 103, 105, 107, + 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, + 129, 131, 133, 135, 137, 139, 140, 143, 145, 147, + 149, 151, 153, 155 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 32, 0, -1, -1, 32, 33, -1, 35, -1, 34, - -1, 30, 4, 45, 3, -1, 30, 3, -1, 30, - 30, 45, 3, -1, 30, 26, 30, 45, 3, -1, - 30, 25, 30, 26, 30, 45, 3, -1, 30, 29, - 45, 3, -1, 36, 29, 45, 3, -1, 37, 30, - 45, 3, -1, 38, 30, 45, 3, -1, 39, 30, - 45, 3, -1, 40, 30, 45, 3, -1, 41, 45, - 3, -1, 42, 45, 3, -1, 43, 45, 3, -1, - 44, 45, 3, -1, 30, 5, 45, 3, -1, 5, - 45, 3, -1, 3, -1, 1, -1, 6, -1, 7, - -1, 8, -1, 10, -1, 9, -1, 12, -1, 11, - -1, 13, -1, 19, -1, 14, -1, 20, -1, 15, - -1, 21, -1, 17, -1, 23, -1, 16, -1, 22, - -1, 18, -1, 24, -1, -1, 45, 46, -1, 30, - -1, 29, -1, 5, -1, 4, -1, 26, -1, 25, - -1, 28, -1 + 33, 0, -1, -1, 33, 34, -1, 36, -1, 35, + -1, 30, 4, 46, 3, -1, 30, 3, -1, 30, + 30, 46, 3, -1, 30, 26, 30, 46, 3, -1, + 30, 25, 30, 26, 30, 46, 3, -1, 30, 29, + 46, 3, -1, 31, 46, 3, -1, 37, 29, 46, + 3, -1, 38, 30, 46, 3, -1, 39, 30, 46, + 3, -1, 40, 30, 46, 3, -1, 41, 30, 46, + 3, -1, 42, 46, 3, -1, 43, 46, 3, -1, + 44, 46, 3, -1, 45, 46, 3, -1, 30, 5, + 46, 3, -1, 5, 46, 3, -1, 3, -1, 1, + -1, 6, -1, 7, -1, 8, -1, 10, -1, 9, + -1, 12, -1, 11, -1, 13, -1, 19, -1, 14, + -1, 20, -1, 15, -1, 21, -1, 17, -1, 23, + -1, 16, -1, 22, -1, 18, -1, 24, -1, -1, + 46, 47, -1, 30, -1, 29, -1, 5, -1, 4, + -1, 26, -1, 25, -1, 28, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 115, 115, 115, 117, 117, 119, 125, 135, 165, - 176, 189, 200, 207, 213, 219, 225, 231, 236, 241, - 246, 251, 255, 256, 257, 262, 262, 262, 263, 263, - 264, 264, 265, 265, 266, 266, 267, 267, 268, 268, - 269, 269, 270, 270, 271, 271, 274, 275, 276, 277, - 278, 279, 280 + 0, 111, 111, 111, 113, 113, 115, 121, 131, 161, + 172, 185, 196, 203, 210, 216, 222, 228, 234, 239, + 244, 249, 254, 258, 259, 260, 265, 265, 265, 266, + 266, 267, 267, 268, 268, 269, 269, 270, 270, 271, + 271, 272, 272, 273, 273, 274, 274, 277, 278, 279, + 280, 281, 282, 283 }; #endif @@ -600,9 +605,9 @@ static const char *const yytname[] = "CPP_IF", "CPP_ELSE", "CPP_ELIF", "CPP_ENDIF", "F90PPR_IFDEF", "F90PPR_IFNDEF", "F90PPR_IF", "F90PPR_ELSE", "F90PPR_ELIF", "F90PPR_ENDIF", "COMMA", "DCOLON", "CPP_TOENDL", "UNTERMINATED_STRING", - "STRING", "WORD", "$accept", "code", "stmt", "assignment_stmt", - "keyword_stmt", "include", "define", "undef", "ifdef", "ifndef", "if", - "elif", "else", "endif", "other", "misc_code", 0 + "STRING", "WORD", "CPP_INCLUDE_ANGLE", "$accept", "code", "stmt", + "assignment_stmt", "keyword_stmt", "include", "define", "undef", "ifdef", + "ifndef", "if", "elif", "else", "endif", "other", "misc_code", 0 }; #endif @@ -614,163 +619,168 @@ static const yytype_uint16 yytoknum[] = 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285 + 285, 286 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 31, 32, 32, 33, 33, 34, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 36, 36, 36, 37, 37, - 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, - 43, 43, 44, 44, 45, 45, 46, 46, 46, 46, - 46, 46, 46 + 0, 32, 33, 33, 34, 34, 35, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 37, 37, 37, 38, + 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, + 43, 44, 44, 45, 45, 46, 46, 47, 47, 47, + 47, 47, 47, 47 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 1, 1, 4, 2, 4, 5, - 7, 4, 4, 4, 4, 4, 4, 3, 3, 3, - 3, 4, 3, 1, 1, 1, 1, 1, 1, 1, + 7, 4, 3, 4, 4, 4, 4, 4, 3, 3, + 3, 3, 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, - 1, 1, 1 + 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, + 1, 1, 1, 1 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { - 2, 0, 1, 24, 23, 44, 25, 26, 27, 29, - 28, 31, 30, 32, 34, 36, 40, 38, 42, 33, - 35, 37, 41, 39, 43, 0, 3, 5, 4, 0, - 0, 0, 0, 0, 44, 44, 44, 44, 0, 7, - 44, 44, 0, 0, 44, 44, 44, 44, 44, 44, - 44, 0, 0, 0, 0, 22, 49, 48, 51, 50, - 52, 47, 46, 45, 0, 0, 0, 44, 0, 0, - 0, 0, 0, 0, 0, 17, 18, 19, 20, 6, - 21, 0, 0, 11, 8, 12, 13, 14, 15, 16, - 44, 9, 0, 10 + 2, 0, 1, 25, 24, 45, 26, 27, 28, 30, + 29, 32, 31, 33, 35, 37, 41, 39, 43, 34, + 36, 38, 42, 40, 44, 0, 45, 3, 5, 4, + 0, 0, 0, 0, 0, 45, 45, 45, 45, 0, + 7, 45, 45, 0, 0, 45, 45, 0, 45, 45, + 45, 45, 45, 0, 0, 0, 0, 23, 50, 49, + 52, 51, 53, 48, 47, 46, 0, 0, 0, 45, + 0, 0, 12, 0, 0, 0, 0, 0, 18, 19, + 20, 21, 6, 22, 0, 0, 11, 8, 13, 14, + 15, 16, 17, 45, 9, 0, 10 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 1, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 63 + -1, 1, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 65 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -35 +#define YYPACT_NINF -29 static const yytype_int16 yypact[] = { - -35, 29, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, 241, -35, -35, -35, -25, - -22, -21, -13, -12, -35, -35, -35, -35, 57, -35, - -35, -35, -11, -10, -35, -35, -35, -35, -35, -35, - -35, 63, 69, 75, 103, -35, -35, -35, -35, -35, - -35, -35, -35, -35, 109, 115, -5, -35, 121, 149, - 155, 161, 167, 195, 201, -35, -35, -35, -35, -35, - -35, -8, 207, -35, -35, -35, -35, -35, -35, -35, - -35, -35, 213, -35 + -29, 39, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, 246, -29, -29, -29, -29, + -28, -27, -22, -17, -16, -29, -29, -29, -29, 2, + -29, -29, -29, -13, -12, -29, -29, 61, -29, -29, + -29, -29, -29, 68, 74, 80, 108, -29, -29, -29, + -29, -29, -29, -29, -29, -29, 114, 120, -24, -29, + 126, 154, -29, 160, 166, 172, 200, 206, -29, -29, + -29, -29, -29, -29, -9, 212, -29, -29, -29, -29, + -29, -29, -29, -29, -29, 218, -29 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -34, -35 + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -26, -29 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ + number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 51, 52, 53, 54, 46, 0, 64, 65, 47, 48, - 68, 69, 70, 71, 72, 73, 74, 49, 50, 66, - 67, 81, 90, 0, 0, 0, 0, 0, 0, 2, - 3, 0, 4, 82, 5, 6, 7, 8, 9, 10, + 47, 48, 84, 49, 0, 57, 58, 59, 50, 53, + 54, 55, 56, 51, 52, 66, 67, 68, 69, 70, + 71, 93, 73, 74, 75, 76, 77, 60, 61, 0, + 62, 63, 64, 0, 0, 0, 0, 0, 0, 2, + 3, 0, 4, 85, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 0, 0, 92, 0, 0, 25, - 55, 56, 57, 0, 0, 0, 75, 56, 57, 0, - 0, 0, 76, 56, 57, 0, 0, 0, 77, 56, - 57, 0, 58, 59, 0, 60, 61, 62, 58, 59, - 0, 60, 61, 62, 58, 59, 0, 60, 61, 62, - 58, 59, 0, 60, 61, 62, 78, 56, 57, 0, - 0, 0, 79, 56, 57, 0, 0, 0, 80, 56, - 57, 0, 0, 0, 83, 56, 57, 0, 58, 59, - 0, 60, 61, 62, 58, 59, 0, 60, 61, 62, - 58, 59, 0, 60, 61, 62, 58, 59, 0, 60, - 61, 62, 84, 56, 57, 0, 0, 0, 85, 56, - 57, 0, 0, 0, 86, 56, 57, 0, 0, 0, - 87, 56, 57, 0, 58, 59, 0, 60, 61, 62, - 58, 59, 0, 60, 61, 62, 58, 59, 0, 60, - 61, 62, 58, 59, 0, 60, 61, 62, 88, 56, - 57, 0, 0, 0, 89, 56, 57, 0, 0, 0, - 91, 56, 57, 0, 0, 0, 93, 56, 57, 0, - 58, 59, 0, 60, 61, 62, 58, 59, 0, 60, - 61, 62, 58, 59, 0, 60, 61, 62, 58, 59, - 0, 60, 61, 62, 39, 40, 41, 0, 0, 0, + 21, 22, 23, 24, 72, 58, 59, 95, 0, 25, + 26, 78, 58, 59, 0, 0, 0, 79, 58, 59, + 0, 0, 0, 80, 58, 59, 60, 61, 0, 62, + 63, 64, 0, 60, 61, 0, 62, 63, 64, 60, + 61, 0, 62, 63, 64, 60, 61, 0, 62, 63, + 64, 81, 58, 59, 0, 0, 0, 82, 58, 59, + 0, 0, 0, 83, 58, 59, 0, 0, 0, 86, + 58, 59, 0, 60, 61, 0, 62, 63, 64, 60, + 61, 0, 62, 63, 64, 60, 61, 0, 62, 63, + 64, 60, 61, 0, 62, 63, 64, 87, 58, 59, + 0, 0, 0, 88, 58, 59, 0, 0, 0, 89, + 58, 59, 0, 0, 0, 90, 58, 59, 0, 60, + 61, 0, 62, 63, 64, 60, 61, 0, 62, 63, + 64, 60, 61, 0, 62, 63, 64, 60, 61, 0, + 62, 63, 64, 91, 58, 59, 0, 0, 0, 92, + 58, 59, 0, 0, 0, 94, 58, 59, 0, 0, + 0, 96, 58, 59, 0, 60, 61, 0, 62, 63, + 64, 60, 61, 0, 62, 63, 64, 60, 61, 0, + 62, 63, 64, 60, 61, 0, 62, 63, 64, 40, + 41, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 42, 43, 0, 0, - 44, 45 + 0, 43, 44, 0, 0, 45, 46 }; +#define yypact_value_is_default(yystate) \ + ((yystate) == (-29)) + +#define yytable_value_is_error(yytable_value) \ + YYID (0) + static const yytype_int8 yycheck[] = { - 34, 35, 36, 37, 29, -1, 40, 41, 30, 30, - 44, 45, 46, 47, 48, 49, 50, 30, 30, 30, - 30, 26, 30, -1, -1, -1, -1, -1, -1, 0, - 1, -1, 3, 67, 5, 6, 7, 8, 9, 10, + 26, 29, 26, 30, -1, 3, 4, 5, 30, 35, + 36, 37, 38, 30, 30, 41, 42, 30, 30, 45, + 46, 30, 48, 49, 50, 51, 52, 25, 26, -1, + 28, 29, 30, -1, -1, -1, -1, -1, -1, 0, + 1, -1, 3, 69, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, -1, -1, 90, -1, -1, 30, - 3, 4, 5, -1, -1, -1, 3, 4, 5, -1, - -1, -1, 3, 4, 5, -1, -1, -1, 3, 4, - 5, -1, 25, 26, -1, 28, 29, 30, 25, 26, - -1, 28, 29, 30, 25, 26, -1, 28, 29, 30, - 25, 26, -1, 28, 29, 30, 3, 4, 5, -1, - -1, -1, 3, 4, 5, -1, -1, -1, 3, 4, - 5, -1, -1, -1, 3, 4, 5, -1, 25, 26, - -1, 28, 29, 30, 25, 26, -1, 28, 29, 30, - 25, 26, -1, 28, 29, 30, 25, 26, -1, 28, - 29, 30, 3, 4, 5, -1, -1, -1, 3, 4, - 5, -1, -1, -1, 3, 4, 5, -1, -1, -1, - 3, 4, 5, -1, 25, 26, -1, 28, 29, 30, - 25, 26, -1, 28, 29, 30, 25, 26, -1, 28, - 29, 30, 25, 26, -1, 28, 29, 30, 3, 4, - 5, -1, -1, -1, 3, 4, 5, -1, -1, -1, - 3, 4, 5, -1, -1, -1, 3, 4, 5, -1, - 25, 26, -1, 28, 29, 30, 25, 26, -1, 28, - 29, 30, 25, 26, -1, 28, 29, 30, 25, 26, - -1, 28, 29, 30, 3, 4, 5, -1, -1, -1, + 21, 22, 23, 24, 3, 4, 5, 93, -1, 30, + 31, 3, 4, 5, -1, -1, -1, 3, 4, 5, + -1, -1, -1, 3, 4, 5, 25, 26, -1, 28, + 29, 30, -1, 25, 26, -1, 28, 29, 30, 25, + 26, -1, 28, 29, 30, 25, 26, -1, 28, 29, + 30, 3, 4, 5, -1, -1, -1, 3, 4, 5, + -1, -1, -1, 3, 4, 5, -1, -1, -1, 3, + 4, 5, -1, 25, 26, -1, 28, 29, 30, 25, + 26, -1, 28, 29, 30, 25, 26, -1, 28, 29, + 30, 25, 26, -1, 28, 29, 30, 3, 4, 5, + -1, -1, -1, 3, 4, 5, -1, -1, -1, 3, + 4, 5, -1, -1, -1, 3, 4, 5, -1, 25, + 26, -1, 28, 29, 30, 25, 26, -1, 28, 29, + 30, 25, 26, -1, 28, 29, 30, 25, 26, -1, + 28, 29, 30, 3, 4, 5, -1, -1, -1, 3, + 4, 5, -1, -1, -1, 3, 4, 5, -1, -1, + -1, 3, 4, 5, -1, 25, 26, -1, 28, 29, + 30, 25, 26, -1, 28, 29, 30, 25, 26, -1, + 28, 29, 30, 25, 26, -1, 28, 29, 30, 3, + 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 25, 26, -1, -1, - 29, 30 + -1, 25, 26, -1, -1, 29, 30 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 32, 0, 1, 3, 5, 6, 7, 8, 9, + 0, 33, 0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 30, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 3, - 4, 5, 25, 26, 29, 30, 29, 30, 30, 30, - 30, 45, 45, 45, 45, 3, 4, 5, 25, 26, - 28, 29, 30, 46, 45, 45, 30, 30, 45, 45, - 45, 45, 45, 45, 45, 3, 3, 3, 3, 3, - 3, 26, 45, 3, 3, 3, 3, 3, 3, 3, - 30, 3, 45, 3 + 20, 21, 22, 23, 24, 30, 31, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 3, 4, 5, 25, 26, 29, 30, 46, 29, 30, + 30, 30, 30, 46, 46, 46, 46, 3, 4, 5, + 25, 26, 28, 29, 30, 47, 46, 46, 30, 30, + 46, 46, 3, 46, 46, 46, 46, 46, 3, 3, + 3, 3, 3, 3, 26, 46, 3, 3, 3, 3, + 3, 3, 3, 30, 3, 46, 3 }; #define yyerrok (yyerrstatus = 0) @@ -785,9 +795,18 @@ static const yytype_uint8 yystos[] = /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ + Once GCC version 2 has supplanted version 1, this can go. However, + YYFAIL appears to be in use. Nevertheless, it is formally deprecated + in Bison 2.4.2's NEWS entry, where a plan to phase it out is + discussed. */ #define YYFAIL goto yyerrlab +#if defined YYFAIL + /* This is here to suppress warnings from the GCC cpp's + -Wunused-macros. Normally we don't worry about that warning, but + some users do, and we want to make it easy for users to remove + YYFAIL uses, which will produce warnings from Bison 2.5. */ +#endif #define YYRECOVERING() (!!yyerrstatus) @@ -797,7 +816,6 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -839,19 +857,10 @@ while (YYID (0)) #endif -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ +/* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif @@ -1043,7 +1052,6 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -1146,115 +1154,142 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = 0; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; + yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; - if (yysize_overflow) - return YYSIZE_MAXIMUM; + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } - if (yyresult) + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; } - return yysize; - } + else + { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1287,6 +1322,7 @@ yydestruct (yymsg, yytype, yyvaluep) } } + /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus @@ -1303,12 +1339,9 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ - - - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ +/*----------. +| yyparse. | +`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1495,7 +1528,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -1526,7 +1559,7 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) + if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -1582,8 +1615,8 @@ yyreduce: { case 6: -/* Line 1455 of yacc.c */ -#line 120 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 116 "cmDependsFortranParser.y" { free((yyvsp[(1) - (4)].string)); } @@ -1591,8 +1624,8 @@ yyreduce: case 7: -/* Line 1455 of yacc.c */ -#line 126 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 122 "cmDependsFortranParser.y" { if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (2)].string), "interface")) { @@ -1606,8 +1639,8 @@ yyreduce: case 8: -/* Line 1455 of yacc.c */ -#line 136 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 132 "cmDependsFortranParser.y" { if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "use")) { @@ -1641,8 +1674,8 @@ yyreduce: case 9: -/* Line 1455 of yacc.c */ -#line 166 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 162 "cmDependsFortranParser.y" { if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (5)].string), "use")) { @@ -1657,8 +1690,8 @@ yyreduce: case 10: -/* Line 1455 of yacc.c */ -#line 177 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 173 "cmDependsFortranParser.y" { if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (7)].string), "use") && cmDependsFortranParserIsKeyword((yyvsp[(3) - (7)].string), "non_intrinsic") ) @@ -1675,8 +1708,8 @@ yyreduce: case 11: -/* Line 1455 of yacc.c */ -#line 190 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 186 "cmDependsFortranParser.y" { if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "include")) { @@ -1691,8 +1724,20 @@ yyreduce: case 12: -/* Line 1455 of yacc.c */ -#line 201 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 197 "cmDependsFortranParser.y" + { + cmDependsFortranParser* parser = + cmDependsFortran_yyget_extra(yyscanner); + cmDependsFortranParser_RuleInclude(parser, (yyvsp[(1) - (3)].string)); + free((yyvsp[(1) - (3)].string)); + } + break; + + case 13: + +/* Line 1806 of yacc.c */ +#line 204 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); @@ -1701,10 +1746,10 @@ yyreduce: } break; - case 13: + case 14: -/* Line 1455 of yacc.c */ -#line 208 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 211 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleDefine(parser, (yyvsp[(2) - (4)].string)); @@ -1712,10 +1757,10 @@ yyreduce: } break; - case 14: + case 15: -/* Line 1455 of yacc.c */ -#line 214 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 217 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleUndef(parser, (yyvsp[(2) - (4)].string)); @@ -1723,10 +1768,10 @@ yyreduce: } break; - case 15: + case 16: -/* Line 1455 of yacc.c */ -#line 220 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 223 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleIfdef(parser, (yyvsp[(2) - (4)].string)); @@ -1734,10 +1779,10 @@ yyreduce: } break; - case 16: + case 17: -/* Line 1455 of yacc.c */ -#line 226 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 229 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleIfndef(parser, (yyvsp[(2) - (4)].string)); @@ -1745,75 +1790,86 @@ yyreduce: } break; - case 17: + case 18: -/* Line 1455 of yacc.c */ -#line 232 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 235 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleIf(parser); } break; - case 18: + case 19: -/* Line 1455 of yacc.c */ -#line 237 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 240 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleElif(parser); } break; - case 19: + case 20: -/* Line 1455 of yacc.c */ -#line 242 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 245 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleElse(parser); } break; - case 20: + case 21: -/* Line 1455 of yacc.c */ -#line 247 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 250 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleEndif(parser); } break; - case 21: + case 22: -/* Line 1455 of yacc.c */ -#line 252 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 255 "cmDependsFortranParser.y" { free((yyvsp[(1) - (4)].string)); } break; - case 46: + case 47: -/* Line 1455 of yacc.c */ -#line 274 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 277 "cmDependsFortranParser.y" { free ((yyvsp[(1) - (1)].string)); } break; - case 47: + case 48: -/* Line 1455 of yacc.c */ -#line 275 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 278 "cmDependsFortranParser.y" { free ((yyvsp[(1) - (1)].string)); } break; -/* Line 1455 of yacc.c */ -#line 1821 "cmDependsFortranParser.cxx" +/* Line 1806 of yacc.c */ +#line 1860 "cmDependsFortranParser.cxx" default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -1841,6 +1897,10 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -1848,37 +1908,36 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; } } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR #endif } @@ -1939,7 +1998,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) + if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -1998,8 +2057,13 @@ yyexhaustedlab: yyreturn: if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -2024,7 +2088,7 @@ yyreturn: -/* Line 1675 of yacc.c */ -#line 283 "cmDependsFortranParser.y" +/* Line 2067 of yacc.c */ +#line 286 "cmDependsFortranParser.y" /* End of grammar */ diff --git a/Source/cmDependsFortranParser.y b/Source/cmDependsFortranParser.y index 00d3327..5681d69 100644 --- a/Source/cmDependsFortranParser.y +++ b/Source/cmDependsFortranParser.y @@ -102,6 +102,7 @@ static bool cmDependsFortranParserIsKeyword(const char* word, %token <string> CPP_TOENDL %token <number> UNTERMINATED_STRING %token <string> STRING WORD +%token <string> CPP_INCLUDE_ANGLE /*-------------------------------------------------------------------------*/ /* grammar */ @@ -192,6 +193,13 @@ keyword_stmt: free($1); free($2); } +| CPP_INCLUDE_ANGLE other EOSTMT + { + cmDependsFortranParser* parser = + cmDependsFortran_yyget_extra(yyscanner); + cmDependsFortranParser_RuleInclude(parser, $1); + free($1); + } | include STRING other EOSTMT { cmDependsFortranParser* parser = diff --git a/Source/cmDependsFortranParserTokens.h b/Source/cmDependsFortranParserTokens.h index 0bbcaae..941eda0 100644 --- a/Source/cmDependsFortranParserTokens.h +++ b/Source/cmDependsFortranParserTokens.h @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,6 +30,7 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ + /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -64,7 +64,8 @@ CPP_TOENDL = 282, UNTERMINATED_STRING = 283, STRING = 284, - WORD = 285 + WORD = 285, + CPP_INCLUDE_ANGLE = 286 }; #endif /* Tokens. */ @@ -96,6 +97,7 @@ #define UNTERMINATED_STRING 283 #define STRING 284 #define WORD 285 +#define CPP_INCLUDE_ANGLE 286 @@ -104,12 +106,14 @@ typedef union YYSTYPE { -/* Line 1676 of yacc.c */ -#line 94 "cmDependsFortranParser.y" +/* Line 2068 of yacc.c */ +#line 89 "cmDependsFortranParser.y" char* string; -/* Line 1676 of yacc.c */ + + +/* Line 2068 of yacc.c */ #line 118 "cmDependsFortranParserTokens.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 897e516..77aaffc 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -218,7 +218,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Full path to ctest command installed with cmake.", "This is the full path to the CTest executable ctest " "which is useful from custom commands that want " - " to use the cmake -E option for portable system " + "to use the cmake -E option for portable system " "commands.",false, "Variables that Provide Information"); @@ -355,7 +355,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "If this is set to TRUE, then the rpath information " "is not added to compiled executables. The default " "is to add rpath information if the platform supports it. " - "This allows for easy running from the build tree. To omit RPATH" + "This allows for easy running from the build tree. To omit RPATH " "in the install step, but not the build step, use " "CMAKE_SKIP_INSTALL_RPATH instead.",false, "Variables that Provide Information"); @@ -523,6 +523,16 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Variables That Change Behavior"); cm->DefineProperty + ("CMAKE_INSTALL_DEFAULT_COMPONENT_NAME", cmProperty::VARIABLE, + "Default component used in install() commands.", + "If an install() command is used without the COMPONENT argument, " + "these files will be grouped into a default component. The name of this " + "default install component will be taken from this variable. " + "It defaults to \"Unspecified\". ", + false, + "Variables That Change Behavior"); + + cm->DefineProperty ("CMAKE_FIND_LIBRARY_PREFIXES", cmProperty::VARIABLE, "Prefixes to prepend when looking for libraries.", "This specifies what prefixes to add to library names when " @@ -833,6 +843,36 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Default is ON.",false, "Variables That Change Behavior"); + cm->DefineProperty + ("CMAKE_ABSOLUTE_DESTINATION_FILES", cmProperty::VARIABLE, + "List of files which have been installed using " + " an ABSOLUTE DESTINATION path.", + "This variable is defined by CMake-generated cmake_install.cmake " + "scripts." + " It can be used (read-only) by program or script that source those" + " install scripts. This is used by some CPack generators (e.g. RPM).", + false, + "Variables That Change Behavior"); + + cm->DefineProperty + ("CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE, + "Ask cmake_install.cmake script to warn each time a file with " + "absolute INSTALL DESTINATION is encountered.", + "This variable is used by CMake-generated cmake_install.cmake" + " scripts. If ones set this variable to ON while running the" + " script, it may get warning messages from the script.", false, + "Variables That Change Behavior"); + + cm->DefineProperty + ("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE, + "Ask cmake_install.cmake script to error out as soon as " + "a file with absolute INSTALL DESTINATION is encountered.", + "The fatal error is emitted before the installation of " + "the offending file takes place." + " This variable is used by CMake-generated cmake_install.cmake" + " scripts. If ones set this variable to ON while running the" + " script, it may get fatal error messages from the script.",false, + "Variables That Change Behavior"); // Variables defined by CMake that describe the system @@ -1310,6 +1350,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "See that target property for additional information.", false, "Variables that Control the Build"); + cm->DefineProperty + ("CMAKE_POSITION_INDEPENDENT_FLAGS", cmProperty::VARIABLE, + "Default value for POSITION_INDEPENDENT_CODE of targets.", + "This variable is used to initialize the " + "POSITION_INDEPENDENT_CODE property on all the targets. " + "See that target property for additional information.", + false, + "Variables that Control the Build"); // Variables defined when the a language is enabled These variables will // also be defined whenever CMake has loaded its support for compiling (LANG) diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 904a157..1b042ae 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -221,7 +221,7 @@ DOCUMENT_INTRO(CompatCommands, "cmakecompat", cmDocumentation::cmDocumentation() :CurrentFormatter(0) { - this->SetForm(TextForm); + this->SetForm(TextForm, 0); this->addCommonStandardDocSections(); this->ShowGenerators = true; } @@ -594,7 +594,7 @@ bool cmDocumentation::PrintRequestedDocumentation(std::ostream& os) i != this->RequestedHelpItems.end(); ++i) { - this->SetForm(i->HelpForm); + this->SetForm(i->HelpForm, i->ManSection); this->CurrentArgument = i->Argument; // If a file name was given, use it. Otherwise, default to the // given stream. @@ -642,7 +642,8 @@ bool cmDocumentation::PrintRequestedDocumentation(std::ostream& os) cmDocumentation::Form cmDocumentation::GetFormFromFilename( - const std::string& filename) + const std::string& filename, + int* manSection) { std::string ext = cmSystemTools::GetFilenameLastExtension(filename); ext = cmSystemTools::UpperCase(ext); @@ -659,6 +660,10 @@ cmDocumentation::Form cmDocumentation::GetFormFromFilename( // ".1" to ".9" should be manpages if ((ext.length()==2) && (ext[1] >='1') && (ext[1]<='9')) { + if (manSection) + { + *manSection = ext[1] - '0'; + } return cmDocumentation::ManForm; } @@ -1128,49 +1133,57 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv, { help.HelpType = cmDocumentation::Properties; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-policies") == 0) { help.HelpType = cmDocumentation::Policies; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-variables") == 0) { help.HelpType = cmDocumentation::Variables; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-modules") == 0) { help.HelpType = cmDocumentation::Modules; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-custom-modules") == 0) { help.HelpType = cmDocumentation::CustomModules; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-commands") == 0) { help.HelpType = cmDocumentation::Commands; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-compatcommands") == 0) { help.HelpType = cmDocumentation::CompatCommands; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-full") == 0) { help.HelpType = cmDocumentation::Full; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-html") == 0) { @@ -1183,6 +1196,7 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv, help.HelpType = cmDocumentation::Full; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = cmDocumentation::ManForm; + help.ManSection = 1; } else if(strcmp(argv[i], "--help-command") == 0) { @@ -1190,35 +1204,40 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv, GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); help.Argument = cmSystemTools::LowerCase(help.Argument); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-module") == 0) { help.HelpType = cmDocumentation::SingleModule; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-property") == 0) { help.HelpType = cmDocumentation::SingleProperty; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-policy") == 0) { help.HelpType = cmDocumentation::SinglePolicy; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-variable") == 0) { help.HelpType = cmDocumentation::SingleVariable; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-command-list") == 0) { @@ -1269,9 +1288,9 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv, } //---------------------------------------------------------------------------- -void cmDocumentation::Print(Form f, std::ostream& os) +void cmDocumentation::Print(Form f, int manSection, std::ostream& os) { - this->SetForm(f); + this->SetForm(f, manSection); this->Print(os); } @@ -1879,7 +1898,7 @@ void cmDocumentation::CreateFullDocumentation() } //---------------------------------------------------------------------------- -void cmDocumentation::SetForm(Form f) +void cmDocumentation::SetForm(Form f, int manSection) { switch(f) { @@ -1890,6 +1909,7 @@ void cmDocumentation::SetForm(Form f) this->CurrentFormatter = &this->DocbookFormatter; break; case ManForm: + this->ManFormatter.SetManSection(manSection); this->CurrentFormatter = &this->ManFormatter; break; case TextForm: diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index 11bef16..e180f60 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -33,7 +33,7 @@ class cmDocumentation: public cmDocumentationEnums { public: cmDocumentation(); - + ~cmDocumentation(); /** @@ -51,18 +51,18 @@ public: typedef std::list<documentedModuleSectionPair_t> documentedModulesList_t; // High-level interface for standard documents: - + /** * Check command line arguments for documentation options. Returns * true if documentation options are found, and false otherwise. * When true is returned, PrintRequestedDocumentation should be - * called. exitOpt can be used for things like cmake -E, so that + * called. exitOpt can be used for things like cmake -E, so that * all arguments after the -E are ignored and not searched for * help arguments. */ - bool CheckOptions(int argc, const char* const* argv, + bool CheckOptions(int argc, const char* const* argv, const char* exitOpt =0); - + /** * Print help requested on the command line. Call after * CheckOptions returns true. Returns true on success, and false @@ -70,12 +70,12 @@ public: * command line cannot be written. */ bool PrintRequestedDocumentation(std::ostream& os); - + /** Print help of the given type. */ bool PrintDocumentation(Type ht, std::ostream& os, const char* docname=0); void SetShowGenerators(bool showGen) { this->ShowGenerators = showGen; } - + /** Set the program name for standard document generation. */ void SetName(const char* name); @@ -108,8 +108,8 @@ public: * Print documentation in the given form. All previously added * sections will be generated. */ - void Print(Form f, std::ostream& os); - + void Print(Form f, int manSection, std::ostream& os); + /** * Print documentation in the current form. All previously added * sections will be generated. @@ -125,15 +125,16 @@ public: void SetSeeAlsoList(const char *data[][3]); /** Clear all previously added sections of help. */ - void ClearSections(); - + void ClearSections(); + /** Set cmake root so we can find installed files */ void SetCMakeRoot(const char* root) { this->CMakeRoot = root;} /** Set CMAKE_MODULE_PATH so we can find additional cmake modules */ void SetCMakeModulePath(const char* path) { this->CMakeModulePath = path;} - - static Form GetFormFromFilename(const std::string& filename); + + static Form GetFormFromFilename(const std::string& filename, + int* ManSection); /** Add common (to all tools) documentation section(s) */ void addCommonStandardDocSections(); @@ -190,13 +191,13 @@ public: std::vector<cmDocumentationEntry>& commands, cmake* cm); private: - void SetForm(Form f); + void SetForm(Form f, int manSection); void SetDocName(const char* docname); - bool CreateSingleModule(const char* fname, + bool CreateSingleModule(const char* fname, const char* moduleName, cmDocumentationSection &sec); - void CreateModuleDocsForDir(cmsys::Directory& dir, + void CreateModuleDocsForDir(cmsys::Directory& dir, cmDocumentationSection &moduleSection); bool CreateModulesSection(); bool CreateCustomModulesSection(); @@ -236,7 +237,7 @@ private: std::string NameString; std::string DocName; std::map<std::string,cmDocumentationSection*> AllSections; - + std::string SeeAlsoString; std::string CMakeRoot; std::string CMakeModulePath; @@ -247,11 +248,12 @@ private: struct RequestedHelpItem { - RequestedHelpItem():HelpForm(TextForm), HelpType(None) {} + RequestedHelpItem():HelpForm(TextForm), HelpType(None), ManSection(1) {} cmDocumentationEnums::Form HelpForm; cmDocumentationEnums::Type HelpType; std::string Filename; std::string Argument; + int ManSection; }; std::vector<RequestedHelpItem> RequestedHelpItems; diff --git a/Source/cmDocumentationFormatterHTML.cxx b/Source/cmDocumentationFormatterHTML.cxx index 6ced1e4..cd0077e 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? @@ -145,7 +145,7 @@ void cmDocumentationFormatterHTML cmDocumentationPrintHTMLId(os, op->Name.c_str()); os << "\"><b><code>"; this->PrintHTMLEscapes(os, op->Name.c_str()); - os << "</code></b></a></li>"; + os << "</code></b></a></li>\n"; } } os << "</ul>\n" ; @@ -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/cmDocumentationFormatterMan.cxx b/Source/cmDocumentationFormatterMan.cxx index 79a3b25..4123c85 100644 --- a/Source/cmDocumentationFormatterMan.cxx +++ b/Source/cmDocumentationFormatterMan.cxx @@ -19,9 +19,15 @@ cmDocumentationFormatterMan::cmDocumentationFormatterMan() :cmDocumentationFormatter() +,ManSection(1) { } +void cmDocumentationFormatterMan::SetManSection(int manSection) +{ + this->ManSection = manSection; +} + void cmDocumentationFormatterMan ::PrintSection(std::ostream& os, const cmDocumentationSection §ion, @@ -32,9 +38,9 @@ void cmDocumentationFormatterMan os << ".SH " << name << "\n"; } - const std::vector<cmDocumentationEntry> &entries = + const std::vector<cmDocumentationEntry> &entries = section.GetEntries(); - for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); + for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); op != entries.end(); ++op) { if(op->Name.size()) @@ -58,7 +64,7 @@ void cmDocumentationFormatterMan::EscapeText(std::string& man_text) cmSystemTools::ReplaceString(man_text, "-", "\\-"); } -void cmDocumentationFormatterMan::PrintPreformatted(std::ostream& os, +void cmDocumentationFormatterMan::PrintPreformatted(std::ostream& os, const char* text) { std::string man_text = text; @@ -69,7 +75,7 @@ void cmDocumentationFormatterMan::PrintPreformatted(std::ostream& os, os << ".fi\n\n"; } -void cmDocumentationFormatterMan::PrintParagraph(std::ostream& os, +void cmDocumentationFormatterMan::PrintParagraph(std::ostream& os, const char* text) { std::string man_text = text; @@ -87,7 +93,7 @@ void cmDocumentationFormatterMan::PrintHeader(const char* docname, this->EscapeText(s_docname); this->EscapeText(s_appname); - os << ".TH " << s_docname << " 1 \"" + os << ".TH " << s_docname << " " << this->ManSection << " \"" << cmSystemTools::GetCurrentDateTime("%B %d, %Y").c_str() << "\" \"" << s_appname << " " << cmVersion::GetCMakeVersion() diff --git a/Source/cmDocumentationFormatterMan.h b/Source/cmDocumentationFormatterMan.h index 11b5acb..b3d069c 100644 --- a/Source/cmDocumentationFormatterMan.h +++ b/Source/cmDocumentationFormatterMan.h @@ -22,6 +22,8 @@ class cmDocumentationFormatterMan : public cmDocumentationFormatter public: cmDocumentationFormatterMan(); + void SetManSection(int manSection); + virtual cmDocumentationEnums::Form GetForm() const { return cmDocumentationEnums::ManForm;} @@ -35,6 +37,7 @@ public: private: void EscapeText(std::string& man_text); + int ManSection; }; #endif diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index c4f5dfb..eb19df5e 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -137,10 +137,20 @@ cmExportFileGenerator (mf->IsOn("WIN32") || mf->IsOn("CYGWIN") || mf->IsOn("MINGW")); if(!dll_platform) { - std::string soname = target->GetSOName(config); - std::string prop = "IMPORTED_SONAME"; + std::string prop; + std::string value; + if(target->HasSOName(config)) + { + prop = "IMPORTED_SONAME"; + value = target->GetSOName(config); + } + else + { + prop = "IMPORTED_NO_SONAME"; + value = "TRUE"; + } prop += suffix; - properties[prop] = soname; + properties[prop] = value; } } 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/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 65077b3..ab11307 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -34,6 +34,9 @@ cmExtraEclipseCDT4Generator this->SupportedGlobalGenerators.push_back("MinGW Makefiles"); // this->SupportedGlobalGenerators.push_back("MSYS Makefiles"); #endif +#ifdef CMAKE_USE_NINJA + this->SupportedGlobalGenerators.push_back("Ninja"); +#endif this->SupportedGlobalGenerators.push_back("Unix Makefiles"); this->SupportsVirtualFolders = true; @@ -286,6 +289,9 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() // set the make command std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"); + const std::string makeArgs = mf->GetSafeDefinition( + "CMAKE_ECLIPSE_MAKE_ARGUMENTS"); + fout << "\t\t\t\t<dictionary>\n" "\t\t\t\t\t<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>\n" @@ -293,7 +299,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() "\t\t\t\t</dictionary>\n" "\t\t\t\t<dictionary>\n" "\t\t\t\t\t<key>org.eclipse.cdt.make.core.build.command</key>\n" - "\t\t\t\t\t<value>" + this->GetEclipsePath(make) + "</value>\n" + "\t\t\t\t\t<value>" << this->GetEclipsePath(make) << "</value>\n" "\t\t\t\t</dictionary>\n" "\t\t\t\t<dictionary>\n" "\t\t\t\t\t<key>org.eclipse.cdt.make.core.contents</key>\n" @@ -305,7 +311,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() "\t\t\t\t</dictionary>\n" "\t\t\t\t<dictionary>\n" "\t\t\t\t\t<key>org.eclipse.cdt.make.core.build.arguments</key>\n" - "\t\t\t\t\t<value></value>\n" + "\t\t\t\t\t<value>" << makeArgs << "</value>\n" "\t\t\t\t</dictionary>\n" "\t\t\t\t<dictionary>\n" "\t\t\t\t\t<key>org.eclipse.cdt.make.core.buildLocation</key>\n" @@ -1067,9 +1073,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const } //insert rules for compiling, preprocessing and assembling individual files - cmLocalUnixMakefileGenerator3* lumg=(cmLocalUnixMakefileGenerator3*)*it; std::vector<std::string> objectFileTargets; - lumg->GetIndividualFileTargets(objectFileTargets); + (*it)->GetIndividualFileTargets(objectFileTargets); for(std::vector<std::string>::const_iterator fit=objectFileTargets.begin(); fit != objectFileTargets.end(); ++fit) diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 3f14fa1..5da5a01 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; @@ -1003,7 +1003,9 @@ protected: // Match rules are case-insensitive on some platforms. #if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__) std::string lower = cmSystemTools::LowerCase(file); - file = lower.c_str(); + const char* file_to_match = lower.c_str(); +#else + const char* file_to_match = file; #endif // Collect properties from all matching rules. @@ -1012,7 +1014,7 @@ protected: for(std::vector<MatchRule>::iterator mr = this->MatchRules.begin(); mr != this->MatchRules.end(); ++mr) { - if(mr->Regex.find(file)) + if(mr->Regex.find(file_to_match)) { matched = true; result.Exclude |= mr->Properties.Exclude; diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index ef16ce8..be47f95 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." ; @@ -1345,41 +1368,73 @@ bool cmFindPackageCommand::ReadListFile(const char* f, PolicyScopeRule psr) } //---------------------------------------------------------------------------- -void cmFindPackageCommand::AppendToProperty(const char* propertyName) +void cmFindPackageCommand::AppendToFoundProperty(bool found) { - std::string propertyValue; - const char *prop = - this->Makefile->GetCMakeInstance()->GetProperty(propertyName); - if (prop && *prop) + std::vector<std::string> foundContents; + const char *foundProp = + this->Makefile->GetCMakeInstance()->GetProperty("PACKAGES_FOUND"); + if (foundProp && *foundProp) { - propertyValue = prop; - - std::vector<std::string> contents; - cmSystemTools::ExpandListArgument(propertyValue, contents, false); + std::string tmp = foundProp; - bool alreadyInserted = false; - for(std::vector<std::string>::const_iterator it = contents.begin(); - it != contents.end(); ++ it ) + cmSystemTools::ExpandListArgument(tmp, foundContents, false); + std::vector<std::string>::iterator nameIt = std::find( + foundContents.begin(), foundContents.end(), this->Name); + if(nameIt != foundContents.end()) { - if (*it == this->Name) - { - alreadyInserted = true; - break; - } + foundContents.erase(nameIt); } - if (!alreadyInserted) + } + + std::vector<std::string> notFoundContents; + const char *notFoundProp = + this->Makefile->GetCMakeInstance()->GetProperty("PACKAGES_NOT_FOUND"); + if (notFoundProp && *notFoundProp) + { + std::string tmp = notFoundProp; + + cmSystemTools::ExpandListArgument(tmp, notFoundContents, false); + std::vector<std::string>::iterator nameIt = std::find( + notFoundContents.begin(), notFoundContents.end(), this->Name); + if(nameIt != notFoundContents.end()) { - propertyValue += ";"; - propertyValue += this->Name; + notFoundContents.erase(nameIt); } } + + if(found) + { + foundContents.push_back(this->Name); + } else { - propertyValue = this->Name; + notFoundContents.push_back(this->Name); } - this->Makefile->GetCMakeInstance()->SetProperty(propertyName, - propertyValue.c_str()); - } + + + std::string tmp; + const char* sep =""; + for(size_t i=0; i<foundContents.size(); i++) + { + tmp += sep; + tmp += foundContents[i]; + sep = ";"; + } + + this->Makefile->GetCMakeInstance()->SetProperty("PACKAGES_FOUND", + tmp.c_str()); + + tmp = ""; + sep = ""; + for(size_t i=0; i<notFoundContents.size(); i++) + { + tmp += sep; + tmp += notFoundContents[i]; + sep = ";"; + } + this->Makefile->GetCMakeInstance()->SetProperty("PACKAGES_NOT_FOUND", + tmp.c_str()); +} //---------------------------------------------------------------------------- void cmFindPackageCommand::AppendSuccessInformation() @@ -1390,14 +1445,10 @@ void cmFindPackageCommand::AppendSuccessInformation() const char* upperResult = this->Makefile->GetDefinition(upperFound.c_str()); const char* result = this->Makefile->GetDefinition(found.c_str()); - if ((cmSystemTools::IsOn(result)) || (cmSystemTools::IsOn(upperResult))) - { - this->AppendToProperty("PACKAGES_FOUND"); - } - else - { - this->AppendToProperty("PACKAGES_NOT_FOUND"); - } + bool packageFound = ((cmSystemTools::IsOn(result)) + || (cmSystemTools::IsOn(upperResult))); + + this->AppendToFoundProperty(packageFound); // Record whether the find was quiet or not, so this can be used // e.g. in FeatureSummary.cmake diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index edb70a6..c380122 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -69,7 +69,7 @@ protected: virtual void GenerateDocumentation(); private: void AppendSuccessInformation(); - void AppendToProperty(const char* propertyName); + void AppendToFoundProperty(bool found); void SetModuleVariables(const std::string& components); bool FindModule(bool& found); void AddFindDefinition(const char* var, const char* val); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 42dd428..6e2e23d 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -39,17 +39,10 @@ void cmGeneratorTarget::ClassifySources() { cmSourceFile* sf = *si; std::string ext = cmSystemTools::LowerCase(sf->GetExtension()); - cmTarget::SourceFileFlags tsFlags = - this->Target->GetTargetSourceFileFlags(sf); if(sf->GetCustomCommand()) { this->CustomCommands.push_back(sf); } - else if(tsFlags.Type != cmTarget::SourceFileTypeNormal) - { - this->OSXContent.push_back(sf); - if(isObjLib) { badObjLib.push_back(sf); } - } else if(sf->GetPropertyAsBool("HEADER_FILE_ONLY")) { this->HeaderSources.push_back(sf); diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 3e50656..5c7578d 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -37,7 +37,6 @@ public: std::vector<cmSourceFile*> HeaderSources; std::vector<cmSourceFile*> ObjectSources; std::vector<cmSourceFile*> ExternalObjects; - std::vector<cmSourceFile*> OSXContent; std::vector<cmSourceFile*> IDLSources; std::string ModuleDefinitionFile; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 545f9e8..a47ca36 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -586,6 +586,16 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, } } // end if in try compile } // end need test language + // Store the shared library flags so that we can satisfy CMP0018 + std::string sharedLibFlagsVar = "CMAKE_SHARED_LIBRARY_"; + sharedLibFlagsVar += lang; + sharedLibFlagsVar += "_FLAGS"; + const char* sharedLibFlags = + mf->GetSafeDefinition(sharedLibFlagsVar.c_str()); + if (sharedLibFlags) + { + this->LanguageToOriginalSharedLibFlags[lang] = sharedLibFlags; + } } // end for each language // Now load files that can override any settings on the platform or for @@ -2092,6 +2102,32 @@ 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; +} + +//---------------------------------------------------------------------------- +std::string cmGlobalGenerator::GetSharedLibFlagsForLanguage( + std::string const& l) +{ + if(this->LanguageToOriginalSharedLibFlags.count(l) > 0) + { + return this->LanguageToOriginalSharedLibFlags[l]; + } + return ""; +} + +//---------------------------------------------------------------------------- void cmGlobalGenerator::AppendDirectoryForConfig(const char*, const char*, const char*, std::string&) { @@ -2459,3 +2495,16 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target) cmSystemTools::RemoveFile(file.c_str()); } } + +//---------------------------------------------------------------------------- +// static +std::string cmGlobalGenerator::EscapeJSON(const std::string& s) { + std::string result; + for (std::string::size_type i = 0; i < s.size(); ++i) { + if (s[i] == '"' || s[i] == '\\') { + result += '\\'; + } + result += s[i]; + } + return result; +} diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 80b948b..ce91793 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -277,6 +277,13 @@ public: i.e. "Can I build Debug and Release in the same tree?" */ virtual bool IsMultiConfig() { return false; } + std::string GetSharedLibFlagsForLanguage(std::string const& lang); + + /** Generate an <output>.rule file path for a given command output. */ + virtual std::string GenerateRuleFile(std::string const& output) const; + + static std::string EscapeJSON(const std::string& s); + protected: typedef std::vector<cmLocalGenerator*> GeneratorVector; // for a project collect all its targets by following depend @@ -354,6 +361,7 @@ private: std::map<cmStdString, cmStdString> LanguageToOutputExtension; std::map<cmStdString, cmStdString> ExtensionToLanguage; std::map<cmStdString, int> LanguageToLinkerPreference; + std::map<cmStdString, cmStdString> LanguageToOriginalSharedLibFlags; // Record hashes for rules and outputs. struct RuleHash { char Data[32]; }; diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index 56b9e9c..f699448 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -44,6 +44,9 @@ cmGlobalKdevelopGenerator::cmGlobalKdevelopGenerator() :cmExternalMakefileProjectGenerator() { this->SupportedGlobalGenerators.push_back("Unix Makefiles"); +#ifdef CMAKE_USE_NINJA + this->SupportedGlobalGenerators.push_back("Ninja"); +#endif } void cmGlobalKdevelopGenerator::Generate() diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 9cbd502..912e53e 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -43,12 +43,13 @@ void cmGlobalNinjaGenerator::WriteComment(std::ostream& os, std::string replace = comment; std::string::size_type lpos = 0; std::string::size_type rpos; + os << "\n#############################################\n"; while((rpos = replace.find('\n', lpos)) != std::string::npos) { os << "# " << replace.substr(lpos, rpos - lpos) << "\n"; lpos = rpos + 1; } - os << "# " << replace.substr(lpos) << "\n"; + os << "# " << replace.substr(lpos) << "\n\n"; } static bool IsIdentChar(char c) @@ -66,7 +67,7 @@ std::string cmGlobalNinjaGenerator::EncodeIdent(const std::string &ident, if (std::find_if(ident.begin(), ident.end(), std::not1(std::ptr_fun(IsIdentChar))) != ident.end()) { static unsigned VarNum = 0; - std::ostringstream names; + cmOStringStream names; names << "ident" << VarNum++; vars << names.str() << " = " << ident << "\n"; return "$" + names.str(); @@ -89,7 +90,10 @@ std::string cmGlobalNinjaGenerator::EncodePath(const std::string &path) { std::string result = path; #ifdef _WIN32 - cmSystemTools::ReplaceString(result, "/", "\\"); + if(UsingMinGW) + cmSystemTools::ReplaceString(result, "\\", "/"); + else + cmSystemTools::ReplaceString(result, "/", "\\"); #endif return EncodeLiteral(result); } @@ -101,7 +105,8 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os, const cmNinjaDeps& explicitDeps, const cmNinjaDeps& implicitDeps, const cmNinjaDeps& orderOnlyDeps, - const cmNinjaVars& variables) + const cmNinjaVars& variables, + int cmdLineLimit) { // Make sure there is a rule. if(rule.empty()) @@ -123,56 +128,67 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os, cmGlobalNinjaGenerator::WriteComment(os, comment); - std::ostringstream builds; + cmOStringStream arguments; // TODO: Better formatting for when there are multiple input/output files. - // Write outputs files. - builds << "build"; - for(cmNinjaDeps::const_iterator i = outputs.begin(); - i != outputs.end(); - ++i) - builds << " " << EncodeIdent(EncodePath(*i), os); - builds << ":"; - - // Write the rule. - builds << " " << rule; - // Write explicit dependencies. for(cmNinjaDeps::const_iterator i = explicitDeps.begin(); i != explicitDeps.end(); ++i) - builds << " " << EncodeIdent(EncodePath(*i), os); + arguments << " " << EncodeIdent(EncodePath(*i), os); // Write implicit dependencies. if(!implicitDeps.empty()) { - builds << " |"; + arguments << " |"; for(cmNinjaDeps::const_iterator i = implicitDeps.begin(); i != implicitDeps.end(); ++i) - builds << " " << EncodeIdent(EncodePath(*i), os); + arguments << " " << EncodeIdent(EncodePath(*i), os); } // Write order-only dependencies. if(!orderOnlyDeps.empty()) { - builds << " ||"; + arguments << " ||"; for(cmNinjaDeps::const_iterator i = orderOnlyDeps.begin(); i != orderOnlyDeps.end(); ++i) - builds << " " << EncodeIdent(EncodePath(*i), os); + arguments << " " << EncodeIdent(EncodePath(*i), os); } - builds << "\n"; + arguments << "\n"; + + cmOStringStream build; + + // Write outputs files. + build << "build"; + for(cmNinjaDeps::const_iterator i = outputs.begin(); + i != outputs.end(); ++i) + build << " " << EncodeIdent(EncodePath(*i), os); + build << ":"; - os << builds.str(); + // Write the rule. + build << " " << rule; // Write the variables bound to this build statement. + cmOStringStream variable_assignments; for(cmNinjaVars::const_iterator i = variables.begin(); - i != variables.end(); - ++i) - cmGlobalNinjaGenerator::WriteVariable(os, i->first, i->second, "", 1); + i != variables.end(); ++i) + cmGlobalNinjaGenerator::WriteVariable(variable_assignments, + i->first, i->second, "", 1); + + // check if a response file rule should be used + std::string buildstr = build.str(); + const std::string assignments = variable_assignments.str(); + const std::string args = arguments.str(); + if (cmdLineLimit > 0 + && args.size() + buildstr.size() + assignments.size() + > (size_t) cmdLineLimit) + buildstr += "_RSPFILE"; + + os << buildstr << args << assignments; } void cmGlobalNinjaGenerator::WritePhonyBuild(std::ostream& os, @@ -200,6 +216,8 @@ void cmGlobalNinjaGenerator::AddCustomCommandRule() "$DESC", "Rule for running custom commands.", /*depfile*/ "", + /*rspfile*/ "", + /*rspcontent*/ "", /*restat*/ true); } @@ -211,10 +229,17 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command, const cmNinjaDeps& deps, const cmNinjaDeps& orderOnlyDeps) { + std::string cmd = command; +#ifdef _WIN32 + if (cmd.empty()) + // TODO Shouldn't an empty command be handled by ninja? + cmd = "cmd.exe /c"; +#endif + this->AddCustomCommandRule(); cmNinjaVars vars; - vars["COMMAND"] = command; + vars["COMMAND"] = cmd; vars["DESC"] = EncodeLiteral(description); cmGlobalNinjaGenerator::WriteBuild(*this->BuildFileStream, @@ -233,6 +258,8 @@ void cmGlobalNinjaGenerator::WriteRule(std::ostream& os, const std::string& description, const std::string& comment, const std::string& depfile, + const std::string& rspfile, + const std::string& rspcontent, bool restat, bool generator) { @@ -277,6 +304,19 @@ void cmGlobalNinjaGenerator::WriteRule(std::ostream& os, os << "description = " << description << "\n"; } + if(!rspfile.empty()) + { + if (rspcontent.empty()) + { + cmSystemTools::Error("No rspfile_content given!", comment.c_str()); + return; + } + cmGlobalNinjaGenerator::Indent(os, 1); + os << "rspfile = " << rspfile << "\n"; + cmGlobalNinjaGenerator::Indent(os, 1); + os << "rspfile_content = " << rspcontent << "\n"; + } + if(restat) { cmGlobalNinjaGenerator::Indent(os, 1); @@ -288,6 +328,8 @@ void cmGlobalNinjaGenerator::WriteRule(std::ostream& os, cmGlobalNinjaGenerator::Indent(os, 1); os << "generator = 1\n"; } + + os << "\n"; } void cmGlobalNinjaGenerator::WriteVariable(std::ostream& os, @@ -341,6 +383,7 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator() : cmGlobalGenerator() , BuildFileStream(0) , RulesFileStream(0) + , CompileCommandsStream(0) , Rules() , AllDependencies() { @@ -349,6 +392,7 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator() this->FindMakeProgramFile = "CMakeNinjaFindMake.cmake"; } + //---------------------------------------------------------------------------- // Virtual public methods. @@ -385,6 +429,12 @@ void cmGlobalNinjaGenerator::Generate() this->WriteTargetAliases(*this->BuildFileStream); this->WriteBuiltinTargets(*this->BuildFileStream); + if (cmSystemTools::GetErrorOccuredFlag()) { + this->RulesFileStream->setstate(std::ios_base::failbit); + this->BuildFileStream->setstate(std::ios_base::failbit); + } + + this->CloseCompileCommandsStream(); this->CloseRulesFileStream(); this->CloseBuildFileStream(); } @@ -397,16 +447,19 @@ void cmGlobalNinjaGenerator cmMakefile *mf, bool optional) { - this->cmGlobalGenerator::EnableLanguage(languages, mf, optional); std::string path; for(std::vector<std::string>::const_iterator l = languages.begin(); l != languages.end(); ++l) { + std::vector<std::string> language; + language.push_back(*l); + if(*l == "NONE") { + this->cmGlobalGenerator::EnableLanguage(language, mf, optional); continue; } - if(*l == "Fortran") + else if(*l == "Fortran") { std::string message = "The \""; message += this->GetName(); @@ -415,10 +468,48 @@ void cmGlobalNinjaGenerator message += "\" yet."; cmSystemTools::Error(message.c_str()); } + else if(*l == "RC") + { + // check if mingw is used + if(mf->IsOn("CMAKE_COMPILER_IS_MINGW")) + { + UsingMinGW = true; + if(!mf->GetDefinition("CMAKE_RC_COMPILER")) + { + std::string windres = cmSystemTools::FindProgram("windres"); + if(windres.empty()) + { + std::string compiler_path; + std::string::size_type prefix = std::string::npos; + if (mf->GetDefinition("CMAKE_C_COMPILER")) + { + compiler_path = mf->GetDefinition("CMAKE_C_COMPILER"); + prefix = compiler_path.rfind("gcc"); + } + else if (mf->GetDefinition("CMAKE_CXX_COMPILER")) + { + compiler_path = mf->GetDefinition("CMAKE_CXX_COMPILER"); + prefix = compiler_path.rfind("++"); + prefix--; + } + if (prefix != std::string::npos) + { + windres = compiler_path.substr(0, prefix) + "windres"; + windres = cmSystemTools::FindProgram(windres.c_str()); + } + } + if(!windres.empty()) + mf->AddDefinition("CMAKE_RC_COMPILER", windres.c_str()); + } + } + } + this->cmGlobalGenerator::EnableLanguage(language, mf, optional); this->ResolveLanguageCompiler(*l, mf, optional); } } +bool cmGlobalNinjaGenerator::UsingMinGW = false; + // Implemented by: // cmGlobalUnixMakefileGenerator3 // cmGlobalVisualStudio10Generator @@ -476,12 +567,16 @@ void cmGlobalNinjaGenerator::AddRule(const std::string& name, const std::string& description, const std::string& comment, const std::string& depfile, + const std::string& rspfile, + const std::string& rspcontent, bool restat, bool generator) { // Do not add the same rule twice. if (this->HasRule(name)) + { return; + } this->Rules.insert(name); cmGlobalNinjaGenerator::WriteRule(*this->RulesFileStream, @@ -490,8 +585,12 @@ void cmGlobalNinjaGenerator::AddRule(const std::string& name, description, comment, depfile, + rspfile, + rspcontent, restat, generator); + + this->RuleCmdLength[name] = (int) command.size(); } bool cmGlobalNinjaGenerator::HasRule(const std::string &name) @@ -618,6 +717,55 @@ void cmGlobalNinjaGenerator::CloseRulesFileStream() } } +void cmGlobalNinjaGenerator::AddCXXCompileCommand( + const std::string &commandLine, + const std::string &sourceFile) +{ + // Compute Ninja's build file path. + std::string buildFileDir = + this->GetCMakeInstance()->GetHomeOutputDirectory(); + if (!this->CompileCommandsStream) + { + std::string buildFilePath = buildFileDir + "/compile_commands.json"; + + // Get a stream where to generate things. + this->CompileCommandsStream = + new cmGeneratedFileStream(buildFilePath.c_str()); + *this->CompileCommandsStream << "["; + } else { + *this->CompileCommandsStream << "," << std::endl; + } + + std::string sourceFileName = sourceFile; + if (!cmSystemTools::FileIsFullPath(sourceFileName.c_str())) + { + sourceFileName = cmSystemTools::CollapseFullPath( + sourceFileName.c_str(), + this->GetCMakeInstance()->GetHomeOutputDirectory()); + } + + + *this->CompileCommandsStream << "\n{\n" + << " \"directory\": \"" + << cmGlobalGenerator::EscapeJSON(buildFileDir) << "\",\n" + << " \"command\": \"" + << cmGlobalGenerator::EscapeJSON(commandLine) << "\",\n" + << " \"file\": \"" + << cmGlobalGenerator::EscapeJSON(sourceFileName) << "\"\n" + << "}"; +} + +void cmGlobalNinjaGenerator::CloseCompileCommandsStream() +{ + if (this->CompileCommandsStream) + { + *this->CompileCommandsStream << "\n]"; + delete this->CompileCommandsStream; + this->CompileCommandsStream = 0; + } + +} + void cmGlobalNinjaGenerator::WriteDisclaimer(std::ostream& os) { os @@ -720,7 +868,7 @@ void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias, // Insert the alias into the map. If the alias was already present in the // map and referred to another target, mark it as ambiguous. std::pair<TargetAliasMap::iterator, bool> newAlias = - TargetAliases.insert(make_pair(alias, target)); + TargetAliases.insert(std::make_pair(alias, target)); if (newAlias.second && newAlias.first->second != target) newAlias.first->second = 0; } @@ -754,6 +902,8 @@ void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os) this->WriteTargetAll(os); this->WriteTargetRebuildManifest(os); + this->WriteTargetClean(os); + this->WriteTargetHelp(os); } void cmGlobalNinjaGenerator::WriteTargetAll(std::ostream& os) @@ -776,7 +926,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) cmLocalGenerator *lg = this->LocalGenerators[0]; cmMakefile* mfRoot = lg->GetMakefile(); - std::ostringstream cmd; + cmOStringStream cmd; cmd << lg->ConvertToOutputFormat( mfRoot->GetRequiredDefinition("CMAKE_COMMAND"), cmLocalGenerator::SHELL) @@ -792,6 +942,8 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) "Re-running CMake...", "Rule for re-running cmake.", /*depfile=*/ "", + /*rspfile=*/ "", + /*rspcontent*/ "", /*restat=*/ false, /*generator=*/ true); @@ -820,3 +972,58 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) implicitDeps, cmNinjaDeps()); } + +std::string cmGlobalNinjaGenerator::ninjaCmd() const +{ + cmLocalGenerator* lgen = this->LocalGenerators[0]; + if (lgen) { + return lgen->ConvertToOutputFormat( + lgen->GetMakefile()->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"), + cmLocalGenerator::SHELL); + } + return "ninja"; +} + +void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os) +{ + WriteRule(*this->RulesFileStream, + "CLEAN", + (ninjaCmd() + " -t clean").c_str(), + "Cleaning all built files...", + "Rule for cleaning all built files.", + /*depfile=*/ "", + /*rspfile=*/ "", + /*rspcontent*/ "", + /*restat=*/ false, + /*generator=*/ false); + WriteBuild(os, + "Clean all the built files.", + "CLEAN", + /*outputs=*/ cmNinjaDeps(1, "clean"), + /*explicitDeps=*/ cmNinjaDeps(), + /*implicitDeps=*/ cmNinjaDeps(), + /*orderOnlyDeps=*/ cmNinjaDeps(), + /*variables=*/ cmNinjaVars()); +} + +void cmGlobalNinjaGenerator::WriteTargetHelp(std::ostream& os) +{ + WriteRule(*this->RulesFileStream, + "HELP", + (ninjaCmd() + " -t targets").c_str(), + "All primary targets available:", + "Rule for printing all primary targets available.", + /*depfile=*/ "", + /*rspfile=*/ "", + /*rspcontent*/ "", + /*restat=*/ false, + /*generator=*/ false); + WriteBuild(os, + "Print all primary targets available.", + "HELP", + /*outputs=*/ cmNinjaDeps(1, "help"), + /*explicitDeps=*/ cmNinjaDeps(), + /*implicitDeps=*/ cmNinjaDeps(), + /*orderOnlyDeps=*/ cmNinjaDeps(), + /*variables=*/ cmNinjaVars()); +} diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 3217581..ff4f85d 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -16,6 +16,8 @@ # include "cmGlobalGenerator.h" # include "cmNinjaTypes.h" +//#define NINJA_GEN_VERBOSE_FILES + class cmLocalGenerator; class cmGeneratedFileStream; class cmGeneratorTarget; @@ -81,7 +83,8 @@ public: const cmNinjaDeps& explicitDeps, const cmNinjaDeps& implicitDeps, const cmNinjaDeps& orderOnlyDeps, - const cmNinjaVars& variables); + const cmNinjaVars& variables, + int cmdLineLimit = -1); /** * Helper to write a build statement with the special 'phony' rule. @@ -111,10 +114,12 @@ public: const std::string& name, const std::string& command, const std::string& description, - const std::string& comment = "", - const std::string& depfile = "", - bool restat = false, - bool generator = false); + const std::string& comment, + const std::string& depfile, + const std::string& rspfile, + const std::string& rspcontent, + bool restat, + bool generator); /** * Write a variable named @a name to @a os with value @a value and an @@ -143,6 +148,9 @@ public: const cmNinjaDeps& targets, const std::string& comment = ""); + + static bool IsMinGW() { return UsingMinGW; } + public: /// Default constructor. cmGlobalNinjaGenerator(); @@ -213,6 +221,9 @@ public: cmGeneratedFileStream* GetRulesFileStream() const { return this->RulesFileStream; } + void AddCXXCompileCommand(const std::string &commandLine, + const std::string &sourceFile); + /** * Add a rule to the generated build system. * Call WriteRule() behind the scene but perform some check before like: @@ -221,8 +232,10 @@ public: void AddRule(const std::string& name, const std::string& command, const std::string& description, - const std::string& comment = "", + const std::string& comment, const std::string& depfile = "", + const std::string& rspfile = "", + const std::string& rspcontent = "", bool restat = false, bool generator = false); @@ -254,6 +267,8 @@ private: void OpenBuildFileStream(); void CloseBuildFileStream(); + void CloseCompileCommandsStream(); + void OpenRulesFileStream(); void CloseRulesFileStream(); @@ -273,6 +288,8 @@ private: void WriteBuiltinTargets(std::ostream& os); void WriteTargetAll(std::ostream& os); void WriteTargetRebuildManifest(std::ostream& os); + void WriteTargetClean(std::ostream& os); + void WriteTargetHelp(std::ostream& os); /// Called when we have seen the given custom command. Returns true /// if we has seen it before. @@ -302,6 +319,10 @@ private: ASD.insert(deps.begin(), deps.end()); } + std::string ninjaCmd() const; + + int GetRuleCmdLength(const std::string& name) { return RuleCmdLength[name]; } + private: /// The file containing the build statement. (the relation ship of the /// compilation DAG). @@ -309,6 +330,7 @@ private: /// The file containing the rule statements. (The action attached to each /// edge of the compilation DAG). cmGeneratedFileStream* RulesFileStream; + cmGeneratedFileStream* CompileCommandsStream; /// The type used to store the set of rules added to the generated build /// system. @@ -317,6 +339,9 @@ private: /// The set of rules added to the generated build system. RulesSetType Rules; + /// Length of rule command, used by rsp file evaluation + std::map<std::string, int> RuleCmdLength; + /// The set of dependencies to add to the "all" target. cmNinjaDeps AllDependencies; @@ -333,6 +358,9 @@ private: TargetAliasMap TargetAliases; static cmLocalGenerator* LocalGenerator; + + static bool UsingMinGW; + }; #endif // ! cmGlobalNinjaGenerator_h diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index e63de9c..ebd8219 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -103,18 +103,6 @@ cmGlobalUnixMakefileGenerator3 } } -//---------------------------------------------------------------------------- -std::string EscapeJSON(const std::string& s) { - std::string result; - for (std::string::size_type i = 0; i < s.size(); ++i) { - if (s[i] == '"' || s[i] == '\\') { - result += '\\'; - } - result += s[i]; - } - return result; -} - void cmGlobalUnixMakefileGenerator3::Generate() { // first do superclass method @@ -179,11 +167,14 @@ void cmGlobalUnixMakefileGenerator3::AddCXXCompileCommand( *this->CommandDatabase << "," << std::endl; } *this->CommandDatabase << "{" << std::endl - << " \"directory\": \"" << EscapeJSON(workingDirectory) << "\"," + << " \"directory\": \"" + << cmGlobalGenerator::EscapeJSON(workingDirectory) << "\"," << std::endl - << " \"command\": \"" << EscapeJSON(compileCommand) << "\"," + << " \"command\": \"" << + cmGlobalGenerator::EscapeJSON(compileCommand) << "\"," << std::endl - << " \"file\": \"" << EscapeJSON(sourceFile) << "\"" + << " \"file\": \"" << + cmGlobalGenerator::EscapeJSON(sourceFile) << "\"" << std::endl << "}"; } diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 22ead10..947a1c9 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -13,6 +13,7 @@ #include "cmGlobalVisualStudio10Generator.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" +#include "cmSourceFile.h" #include "cmake.h" @@ -51,6 +52,38 @@ cmLocalGenerator *cmGlobalVisualStudio10Generator::CreateLocalGenerator() } //---------------------------------------------------------------------------- +void cmGlobalVisualStudio10Generator::Generate() +{ + this->LongestSource = LongestSourcePath(); + this->cmGlobalVisualStudio8Generator::Generate(); + if(this->LongestSource.Length > 0) + { + cmMakefile* mf = this->LongestSource.Target->GetMakefile(); + cmOStringStream e; + e << + "The binary and/or source directory paths may be too long to generate " + "Visual Studio 10 files for this project. " + "Consider choosing shorter directory names to build this project with " + "Visual Studio 10. " + "A more detailed explanation follows." + "\n" + "There is a bug in the VS 10 IDE that renders property dialog fields " + "blank for files referenced by full path in the project file. " + "However, CMake must reference at least one file by full path:\n" + " " << this->LongestSource.SourceFile->GetFullPath() << "\n" + "This is because some Visual Studio tools would append the relative " + "path to the end of the referencing directory path, as in:\n" + " " << mf->GetCurrentOutputDirectory() << "/" + << this->LongestSource.SourceRel << "\n" + "and then incorrectly complain that the file does not exist because " + "the path length is too long for some internal buffer or API. " + "To avoid this problem CMake must use a full path for this file " + "which then triggers the VS 10 property dialog bug."; + mf->IssueMessage(cmake::WARNING, e.str().c_str()); + } +} + +//---------------------------------------------------------------------------- void cmGlobalVisualStudio10Generator ::GetDocumentation(cmDocumentationEntry& entry) const { @@ -212,3 +245,42 @@ 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; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio10Generator::PathTooLong( + cmTarget* target, cmSourceFile* sf, std::string const& sfRel) +{ + size_t len = (strlen(target->GetMakefile()->GetCurrentOutputDirectory()) + + 1 + sfRel.length()); + if(len > this->LongestSource.Length) + { + this->LongestSource.Length = len; + this->LongestSource.Target = target; + this->LongestSource.SourceFile = sf; + this->LongestSource.SourceRel = sfRel; + } +} + +//---------------------------------------------------------------------------- +bool cmGlobalVisualStudio10Generator::UseFolderProperty() +{ + return IsExpressEdition() ? false : cmGlobalGenerator::UseFolderProperty(); +} diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 750b89c..060cdff 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -46,6 +46,8 @@ public: ///! create the correct local generator virtual cmLocalGenerator *CreateLocalGenerator(); + virtual void Generate(); + /** * Try to determine system infomation such as shared library * extension, pthreads, byte order etc. @@ -75,10 +77,29 @@ 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; + + void PathTooLong(cmTarget* target, cmSourceFile* sf, + std::string const& sfRel); protected: virtual const char* GetIDEVersion() { return "10.0"; } std::string PlatformToolset; bool ExpressEdition; + + bool UseFolderProperty(); + +private: + struct LongestSourcePath + { + LongestSourcePath(): Length(0), Target(0), SourceFile(0) {} + size_t Length; + cmTarget* Target; + cmSourceFile* SourceFile; + std::string SourceRel; + }; + LongestSourcePath LongestSource; }; #endif diff --git a/Source/cmGlobalVisualStudio11ARMGenerator.cxx b/Source/cmGlobalVisualStudio11ARMGenerator.cxx new file mode 100644 index 0000000..fef1aba --- /dev/null +++ b/Source/cmGlobalVisualStudio11ARMGenerator.cxx @@ -0,0 +1,32 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2011 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#include "cmGlobalVisualStudio11ARMGenerator.h" +#include "cmMakefile.h" +#include "cmake.h" + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio11ARMGenerator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = "Generates Visual Studio 11 ARM project files."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio11ARMGenerator +::AddPlatformDefinitions(cmMakefile* mf) +{ + this->cmGlobalVisualStudio11Generator::AddPlatformDefinitions(mf); + mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "ARM"); + mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "ARM"); +} diff --git a/Source/cmGlobalVisualStudio11ARMGenerator.h b/Source/cmGlobalVisualStudio11ARMGenerator.h new file mode 100644 index 0000000..77e1429 --- /dev/null +++ b/Source/cmGlobalVisualStudio11ARMGenerator.h @@ -0,0 +1,37 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2011 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#ifndef cmGlobalVisualStudio11ARMGenerator_h +#define cmGlobalVisualStudio11ARMGenerator_h + +#include "cmGlobalVisualStudio11Generator.h" + +class cmGlobalVisualStudio11ARMGenerator : + public cmGlobalVisualStudio11Generator +{ +public: + cmGlobalVisualStudio11ARMGenerator() {} + static cmGlobalGenerator* New() { + return new cmGlobalVisualStudio11ARMGenerator; } + + ///! Get the name for the generator. + virtual const char* GetName() const { + return cmGlobalVisualStudio11ARMGenerator::GetActualName();} + static const char* GetActualName() {return "Visual Studio 11 ARM";} + + virtual const char* GetPlatformName() const {return "ARM";} + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + virtual void AddPlatformDefinitions(cmMakefile* mf); +}; +#endif 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/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 998843f..938977b 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -723,6 +723,10 @@ GetSourcecodeValueFromFileExtension(const std::string& _ext, { sourcecode = "file.xib"; } + else if(ext == "storyboard") + { + sourcecode = "file.storyboard"; + } else if(ext == "mm") { sourcecode += ".cpp.objcpp"; @@ -1590,14 +1594,14 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, if(strcmp(lang, "CXX") == 0) { this->CurrentLocalGenerator->AddLanguageFlags(cflags, "C", configName); - this->CurrentLocalGenerator->AddSharedFlags(cflags, lang, shared); + this->CurrentLocalGenerator->AddCMP0018Flags(cflags, &target, "C"); } // Add language-specific flags. this->CurrentLocalGenerator->AddLanguageFlags(flags, lang, configName); // Add shared-library flags if needed. - this->CurrentLocalGenerator->AddSharedFlags(flags, lang, shared); + this->CurrentLocalGenerator->AddCMP0018Flags(flags, &target, lang); } else if(binary) { diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 4eed477..ffc0f35 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -74,6 +74,13 @@ IsFunctionBlocked(const cmListFileFunction& lff, { this->IsBlocking = this->HasRun; this->HasRun = true; + + // if trace is enabled, print a (trivially) evaluated "else" + // statement + if(!this->IsBlocking && mf.GetCMakeInstance()->GetTrace()) + { + mf.PrintCommandTrace(this->Functions[c]); + } } else if (scopeDepth == 0 && !cmSystemTools::Strucmp (this->Functions[c].Name.c_str(),"elseif")) @@ -88,6 +95,12 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefileCall stack_manager(&mf, this->Functions[c], status); static_cast<void>(stack_manager); + // if trace is enabled, print the evaluated "elseif" statement + if(mf.GetCMakeInstance()->GetTrace()) + { + mf.PrintCommandTrace(this->Functions[c]); + } + std::string errorString; std::vector<std::string> expandedArguments; diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h index 83ea8a4..94e4d99 100644 --- a/Source/cmIfCommand.h +++ b/Source/cmIfCommand.h @@ -123,6 +123,7 @@ public: " if(<variable>)\n" "True if the variable is defined to a value that is not a false " "constant. False otherwise. " + "(Note macro arguments are not variables.)" "\n" " if(NOT <expression>)\n" "True if the expression is not true." diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 0ac6df4..0d5f67b 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -70,6 +70,13 @@ bool cmIncludeCommand } } + if(fname.empty()) + { + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, + "include() given empty file name (ignored)."); + return true; + } + if(!cmSystemTools::FileIsFullPath(fname.c_str())) { // Not a path. Maybe module. 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/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index c656487..4016734 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -23,25 +23,25 @@ static cmInstallTargetGenerator* CreateInstallTargetGenerator(cmTarget& target, const cmInstallCommandArguments& args, bool impLib, bool forceOpt = false) { - return new cmInstallTargetGenerator(target, args.GetDestination().c_str(), - impLib, args.GetPermissions().c_str(), + return new cmInstallTargetGenerator(target, args.GetDestination().c_str(), + impLib, args.GetPermissions().c_str(), args.GetConfigurations(), args.GetComponent().c_str(), args.GetOptional() || forceOpt); } static cmInstallFilesGenerator* CreateInstallFilesGenerator( - const std::vector<std::string>& absFiles, + const std::vector<std::string>& absFiles, const cmInstallCommandArguments& args, bool programs) { - return new cmInstallFilesGenerator(absFiles, args.GetDestination().c_str(), - programs, args.GetPermissions().c_str(), + return new cmInstallFilesGenerator(absFiles, args.GetDestination().c_str(), + programs, args.GetPermissions().c_str(), args.GetConfigurations(), args.GetComponent().c_str(), args.GetRename().c_str(), args.GetOptional()); } // cmInstallCommand -bool cmInstallCommand::InitialPass(std::vector<std::string> const& args, +bool cmInstallCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &) { // Allow calling with no arguments so that arguments may be built up @@ -55,6 +55,13 @@ bool cmInstallCommand::InitialPass(std::vector<std::string> const& args, this->Makefile->GetLocalGenerator() ->GetGlobalGenerator()->EnableInstallTarget(); + this->DefaultComponentName = this->Makefile->GetSafeDefinition( + "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"); + if (this->DefaultComponentName.empty()) + { + this->DefaultComponentName = "Unspecified"; + } + // Switch among the command modes. if(args[0] == "SCRIPT") { @@ -95,7 +102,7 @@ bool cmInstallCommand::InitialPass(std::vector<std::string> const& args, //---------------------------------------------------------------------------- bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args) { - std::string component("Unspecified"); + std::string component = this->DefaultComponentName; int componentCount = 0; bool doing_script = false; bool doing_code = false; @@ -190,7 +197,7 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args) /*struct InstallPart { - InstallPart(cmCommandArgumentsHelper* helper, const char* key, + InstallPart(cmCommandArgumentsHelper* helper, const char* key, cmCommandArgumentGroup* group); cmCAStringVector argVector; cmInstallCommandArguments args; @@ -222,7 +229,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) // ARCHIVE, RUNTIME etc. (see above) // These generic args also contain the targets and the export stuff std::vector<std::string> unknownArgs; - cmInstallCommandArguments genericArgs; + cmInstallCommandArguments genericArgs(this->DefaultComponentName); cmCAStringVector targetList(&genericArgs.Parser, "TARGETS"); cmCAString exports(&genericArgs.Parser,"EXPORT", &genericArgs.ArgumentGroup); targetList.Follows(0); @@ -230,16 +237,16 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) genericArgs.Parse(&genericArgVector.GetVector(), &unknownArgs); bool success = genericArgs.Finalize(); - cmInstallCommandArguments archiveArgs; - cmInstallCommandArguments libraryArgs; - cmInstallCommandArguments runtimeArgs; - cmInstallCommandArguments frameworkArgs; - cmInstallCommandArguments bundleArgs; - cmInstallCommandArguments privateHeaderArgs; - cmInstallCommandArguments publicHeaderArgs; - cmInstallCommandArguments resourceArgs; + cmInstallCommandArguments archiveArgs(this->DefaultComponentName); + cmInstallCommandArguments libraryArgs(this->DefaultComponentName); + cmInstallCommandArguments runtimeArgs(this->DefaultComponentName); + cmInstallCommandArguments frameworkArgs(this->DefaultComponentName); + cmInstallCommandArguments bundleArgs(this->DefaultComponentName); + cmInstallCommandArguments privateHeaderArgs(this->DefaultComponentName); + cmInstallCommandArguments publicHeaderArgs(this->DefaultComponentName); + cmInstallCommandArguments resourceArgs(this->DefaultComponentName); - // now parse the args for specific parts of the target (e.g. LIBRARY, + // now parse the args for specific parts of the target (e.g. LIBRARY, // RUNTIME, ARCHIVE etc. archiveArgs.Parse (&archiveArgVector.GetVector(), &unknownArgs); libraryArgs.Parse (&libraryArgVector.GetVector(), &unknownArgs); @@ -345,7 +352,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) this->Makefile->IsOn("CYGWIN") || this->Makefile->IsOn("MINGW")); - for(std::vector<std::string>::const_iterator + for(std::vector<std::string>::const_iterator targetIt=targetList.GetVector().begin(); targetIt!=targetList.GetVector().end(); ++targetIt) @@ -422,7 +429,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) case cmTarget::SHARED_LIBRARY: { // Shared libraries are handled differently on DLL and non-DLL - // platforms. All windows platforms are DLL platforms including + // platforms. All windows platforms are DLL platforms including // cygwin. Currently no other platform is a DLL platform. if(dll_platform) { @@ -436,13 +443,13 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) if(!archiveArgs.GetDestination().empty()) { // The import library uses the ARCHIVE properties. - archiveGenerator = CreateInstallTargetGenerator(target, + archiveGenerator = CreateInstallTargetGenerator(target, archiveArgs, true); } if(!runtimeArgs.GetDestination().empty()) { // The DLL uses the RUNTIME properties. - runtimeGenerator = CreateInstallTargetGenerator(target, + runtimeGenerator = CreateInstallTargetGenerator(target, runtimeArgs, false); } if ((archiveGenerator==0) && (runtimeGenerator==0)) @@ -467,7 +474,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) // Use the FRAMEWORK properties. if (!frameworkArgs.GetDestination().empty()) { - frameworkGenerator = CreateInstallTargetGenerator(target, + frameworkGenerator = CreateInstallTargetGenerator(target, frameworkArgs, false); } else @@ -484,7 +491,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) // The shared library uses the LIBRARY properties. if (!libraryArgs.GetDestination().empty()) { - libraryGenerator = CreateInstallTargetGenerator(target, + libraryGenerator = CreateInstallTargetGenerator(target, libraryArgs, false); libraryGenerator->SetNamelinkMode(namelinkMode); namelinkOnly = @@ -507,7 +514,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) // Static libraries use ARCHIVE properties. if (!archiveArgs.GetDestination().empty()) { - archiveGenerator = CreateInstallTargetGenerator(target, archiveArgs, + archiveGenerator = CreateInstallTargetGenerator(target, archiveArgs, false); } else @@ -525,7 +532,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) // Modules use LIBRARY properties. if (!libraryArgs.GetDestination().empty()) { - libraryGenerator = CreateInstallTargetGenerator(target, libraryArgs, + libraryGenerator = CreateInstallTargetGenerator(target, libraryArgs, false); libraryGenerator->SetNamelinkMode(namelinkMode); namelinkOnly = @@ -548,7 +555,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) // Application bundles use the BUNDLE properties. if (!bundleArgs.GetDestination().empty()) { - bundleGenerator = CreateInstallTargetGenerator(target, bundleArgs, + bundleGenerator = CreateInstallTargetGenerator(target, bundleArgs, false); } else if(!runtimeArgs.GetDestination().empty()) @@ -580,7 +587,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) // Executables use the RUNTIME properties. if (!runtimeArgs.GetDestination().empty()) { - runtimeGenerator = CreateInstallTargetGenerator(target, + runtimeGenerator = CreateInstallTargetGenerator(target, runtimeArgs, false); } else @@ -600,7 +607,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) target.IsExecutableWithExports()) { // The import library uses the ARCHIVE properties. - archiveGenerator = CreateInstallTargetGenerator(target, + archiveGenerator = CreateInstallTargetGenerator(target, archiveArgs, true, true); } } @@ -710,7 +717,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) installsRuntime = installsRuntime || runtimeGenerator != 0; installsFramework = installsFramework || frameworkGenerator != 0; installsBundle = installsBundle || bundleGenerator != 0; - installsPrivateHeader = installsPrivateHeader + installsPrivateHeader = installsPrivateHeader || privateHeaderGenerator != 0; installsPublicHeader = installsPublicHeader || publicHeaderGenerator != 0; installsResource = installsResource || resourceGenerator; @@ -729,7 +736,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) if(!exports.GetString().empty() && !namelinkOnly) { this->Makefile->GetLocalGenerator()->GetGlobalGenerator() - ->AddTargetToExports(exports.GetCString(), &target, + ->AddTargetToExports(exports.GetCString(), &target, archiveGenerator, runtimeGenerator, libraryGenerator, frameworkGenerator, bundleGenerator, publicHeaderGenerator); @@ -788,7 +795,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args) { // This is the FILES mode. bool programs = (args[0] == "PROGRAMS"); - cmInstallCommandArguments ica; + cmInstallCommandArguments ica(this->DefaultComponentName); cmCAStringVector files(&ica.Parser, programs ? "PROGRAMS" : "FILES"); files.Follows(0); ica.ArgumentGroup.Follows(&files); @@ -803,7 +810,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args) this->SetError(e.str().c_str()); return false; } - + // Check if there is something to do. if(files.GetVector().empty()) { @@ -865,7 +872,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args) std::string permissions_file; std::string permissions_dir; std::vector<std::string> configurations; - std::string component = "Unspecified"; + std::string component = this->DefaultComponentName; std::string literal_args; for(unsigned int i=1; i < args.size(); ++i) { @@ -1179,7 +1186,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args) bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args) { // This is the EXPORT mode. - cmInstallCommandArguments ica; + cmInstallCommandArguments ica(this->DefaultComponentName); cmCAString exp(&ica.Parser, "EXPORT"); cmCAString name_space(&ica.Parser, "NAMESPACE", &ica.ArgumentGroup); cmCAString filename(&ica.Parser, "FILE", &ica.ArgumentGroup); diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h index 3403c38..76e622e 100644 --- a/Source/cmInstallCommand.h +++ b/Source/cmInstallCommand.h @@ -85,7 +85,10 @@ public: "with which the install rule is associated, such as \"runtime\" or " "\"development\". During component-specific installation only " "install rules associated with the given component name will be " - "executed. During a full installation all components are installed.\n" + "executed. During a full installation all components are installed." + " If COMPONENT is not provided a default component \"Unspecified\" is" + " created. The default component name may be controlled with the " + "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME variable.\n" "The RENAME argument specifies a name for an installed file that " "may be different from the original file. Renaming is allowed only " "when a single file is installed by the command.\n" @@ -337,10 +340,12 @@ private: bool HandleFilesMode(std::vector<std::string> const& args); bool HandleDirectoryMode(std::vector<std::string> const& args); bool HandleExportMode(std::vector<std::string> const& args); - bool MakeFilesFullPath(const char* modeName, + bool MakeFilesFullPath(const char* modeName, const std::vector<std::string>& relFiles, std::vector<std::string>& absFiles); bool CheckCMP0006(bool& failure); + + std::string DefaultComponentName; }; diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx index 13ef8ed..8e48f08 100644 --- a/Source/cmInstallCommandArguments.cxx +++ b/Source/cmInstallCommandArguments.cxx @@ -23,7 +23,8 @@ const char* cmInstallCommandArguments::PermissionsTable[] = const std::string cmInstallCommandArguments::EmptyString; -cmInstallCommandArguments::cmInstallCommandArguments() +cmInstallCommandArguments::cmInstallCommandArguments( + const std::string& defaultComponent) :Parser() ,ArgumentGroup() ,Destination (&Parser, "DESTINATION" , &ArgumentGroup) @@ -35,7 +36,9 @@ cmInstallCommandArguments::cmInstallCommandArguments() ,NamelinkOnly (&Parser, "NAMELINK_ONLY" , &ArgumentGroup) ,NamelinkSkip (&Parser, "NAMELINK_SKIP" , &ArgumentGroup) ,GenericArguments(0) -{} +,DefaultComponentName(defaultComponent) +{ +} const std::string& cmInstallCommandArguments::GetDestination() const { @@ -60,7 +63,10 @@ const std::string& cmInstallCommandArguments::GetComponent() const { return this->GenericArguments->GetComponent(); } - + if (!this->DefaultComponentName.empty()) + { + return this->DefaultComponentName; + } static std::string unspecifiedComponent = "Unspecified"; return unspecifiedComponent; } @@ -130,7 +136,7 @@ bool cmInstallCommandArguments::GetNamelinkSkip() const return false; } -const std::vector<std::string>& +const std::vector<std::string>& cmInstallCommandArguments::GetConfigurations() const { if (!this->Configurations.GetVector().empty()) @@ -156,7 +162,7 @@ bool cmInstallCommandArguments::Finalize() return true; } -void cmInstallCommandArguments::Parse(const std::vector<std::string>* args, +void cmInstallCommandArguments::Parse(const std::vector<std::string>* args, std::vector<std::string>* unconsumedArgs) { this->Parser.Parse(args, unconsumedArgs); @@ -166,9 +172,9 @@ void cmInstallCommandArguments::Parse(const std::vector<std::string>* args, bool cmInstallCommandArguments::CheckPermissions() { this->PermissionsString = ""; - for(std::vector<std::string>::const_iterator - permIt = this->Permissions.GetVector().begin(); - permIt != this->Permissions.GetVector().end(); + for(std::vector<std::string>::const_iterator + permIt = this->Permissions.GetVector().begin(); + permIt != this->Permissions.GetVector().end(); ++permIt) { if (!this->CheckPermissions(*permIt, this->PermissionsString)) @@ -183,7 +189,7 @@ bool cmInstallCommandArguments::CheckPermissions( const std::string& onePermission, std::string& permissions) { // Check the permission against the table. - for(const char** valid = cmInstallCommandArguments::PermissionsTable; + for(const char** valid = cmInstallCommandArguments::PermissionsTable; *valid; ++valid) { if(onePermission == *valid) diff --git a/Source/cmInstallCommandArguments.h b/Source/cmInstallCommandArguments.h index 16033ce..01f7d56 100644 --- a/Source/cmInstallCommandArguments.h +++ b/Source/cmInstallCommandArguments.h @@ -19,10 +19,10 @@ class cmInstallCommandArguments { public: - cmInstallCommandArguments(); - void SetGenericArguments(cmInstallCommandArguments* args) + cmInstallCommandArguments(const std::string& defaultComponent); + void SetGenericArguments(cmInstallCommandArguments* args) {this->GenericArguments = args;} - void Parse(const std::vector<std::string>* args, + void Parse(const std::vector<std::string>* args, std::vector<std::string>* unconsumedArgs); // Compute destination path.and check permissions @@ -37,14 +37,15 @@ class cmInstallCommandArguments bool GetNamelinkOnly() const; bool GetNamelinkSkip() const; - // once HandleDirectoryMode() is also switched to using + // once HandleDirectoryMode() is also switched to using // cmInstallCommandArguments then these two functions can become non-static // private member functions without arguments - static bool CheckPermissions(const std::string& onePerm, + static bool CheckPermissions(const std::string& onePerm, std::string& perm); cmCommandArgumentsHelper Parser; cmCommandArgumentGroup ArgumentGroup; private: + cmInstallCommandArguments(); // disabled cmCAString Destination; cmCAString Component; cmCAString Rename; @@ -60,6 +61,7 @@ class cmInstallCommandArguments cmInstallCommandArguments* GenericArguments; static const char* PermissionsTable[]; static const std::string EmptyString; + std::string DefaultComponentName; bool CheckPermissions(); }; diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx index 0ec3030..cc62c4b 100644 --- a/Source/cmInstallFilesCommand.cxx +++ b/Source/cmInstallFilesCommand.cxx @@ -34,7 +34,7 @@ bool cmInstallFilesCommand if((args.size() > 1) && (args[1] == "FILES")) { - this->IsFilesForm = true; + this->IsFilesForm = true; for(std::vector<std::string>::const_iterator s = args.begin()+2; s != args.end(); ++s) { @@ -53,45 +53,46 @@ bool cmInstallFilesCommand this->FinalArgs.push_back(*s); } } - + this->Makefile->GetLocalGenerator()->GetGlobalGenerator() - ->AddInstallComponent("Unspecified"); + ->AddInstallComponent(this->Makefile->GetSafeDefinition( + "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME")); return true; } -void cmInstallFilesCommand::FinalPass() +void cmInstallFilesCommand::FinalPass() { // No final pass for "FILES" form of arguments. if(this->IsFilesForm) { return; } - + std::string testf; std::string ext = this->FinalArgs[0]; - + // two different options if (this->FinalArgs.size() > 1) { // now put the files into the list std::vector<std::string>::iterator s = this->FinalArgs.begin(); ++s; - // for each argument, get the files + // for each argument, get the files for (;s != this->FinalArgs.end(); ++s) { // replace any variables std::string temps = *s; if (cmSystemTools::GetFilenamePath(temps).size() > 0) { - testf = cmSystemTools::GetFilenamePath(temps) + "/" + + testf = cmSystemTools::GetFilenamePath(temps) + "/" + cmSystemTools::GetFilenameWithoutLastExtension(temps) + ext; } else { testf = cmSystemTools::GetFilenameWithoutLastExtension(temps) + ext; } - + // add to the result this->Files.push_back(this->FindInstallSource(testf.c_str())); } @@ -102,9 +103,9 @@ void cmInstallFilesCommand::FinalPass() std::string regex = this->FinalArgs[0].c_str(); cmSystemTools::Glob(this->Makefile->GetCurrentDirectory(), regex.c_str(), files); - + std::vector<std::string>::iterator s = files.begin(); - // for each argument, get the files + // for each argument, get the files for (;s != files.end(); ++s) { this->Files.push_back(this->FindInstallSource(s->c_str())); @@ -128,13 +129,14 @@ void cmInstallFilesCommand::CreateInstallGenerator() const // Use a file install generator. const char* no_permissions = ""; const char* no_rename = ""; - const char* no_component = "Unspecified"; + std::string no_component = this->Makefile->GetSafeDefinition( + "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"); std::vector<std::string> no_configurations; this->Makefile->AddInstallGenerator( new cmInstallFilesGenerator(this->Files, destination.c_str(), false, no_permissions, no_configurations, - no_component, no_rename)); + no_component.c_str(), no_rename)); } @@ -151,7 +153,7 @@ std::string cmInstallFilesCommand::FindInstallSource(const char* name) const // This is a full path. return name; } - + // This is a relative path. std::string tb = this->Makefile->GetCurrentOutputDirectory(); tb += "/"; @@ -159,7 +161,7 @@ std::string cmInstallFilesCommand::FindInstallSource(const char* name) const std::string ts = this->Makefile->GetCurrentDirectory(); ts += "/"; ts += name; - + if(cmSystemTools::FileExists(tb.c_str())) { // The file exists in the binary tree. Use it. diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx index 807168e..3be2c2b 100644 --- a/Source/cmInstallGenerator.cxx +++ b/Source/cmInstallGenerator.cxx @@ -60,7 +60,7 @@ void cmInstallGenerator std::string dest = this->GetInstallDestination(); if (cmSystemTools::FileIsFullPath(dest.c_str())) { - os << "list(APPEND CPACK_ABSOLUTE_DESTINATION_FILES\n"; + os << "list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES\n"; os << indent << " \""; for(std::vector<std::string>::const_iterator fi = files.begin(); fi != files.end(); ++fi) @@ -80,6 +80,16 @@ void cmInstallGenerator } } os << "\")\n"; + os << indent << "IF (CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)\n"; + os << indent << indent << "message(WARNING \"ABSOLUTE path INSTALL " + << "DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n"; + os << indent << "ENDIF (CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)\n"; + + os << indent << "IF (CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)\n"; + os << indent << indent << "message(FATAL_ERROR \"ABSOLUTE path INSTALL " + << "DESTINATION forbidden (by caller): " + << "${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n"; + os << indent << "ENDIF (CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)\n"; } os << "FILE(INSTALL DESTINATION \"" << dest << "\" TYPE " << stype.c_str(); if(optional) diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx index 7e6c9ce..3a0a322 100644 --- a/Source/cmInstallProgramsCommand.cxx +++ b/Source/cmInstallProgramsCommand.cxx @@ -31,26 +31,27 @@ bool cmInstallProgramsCommand for (++s;s != args.end(); ++s) { this->FinalArgs.push_back(*s); - } - + } + this->Makefile->GetLocalGenerator()->GetGlobalGenerator() - ->AddInstallComponent("Unspecified"); + ->AddInstallComponent(this->Makefile->GetSafeDefinition( + "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME")); return true; } -void cmInstallProgramsCommand::FinalPass() +void cmInstallProgramsCommand::FinalPass() { bool files_mode = false; if(!this->FinalArgs.empty() && this->FinalArgs[0] == "FILES") { files_mode = true; } - + // two different options if (this->FinalArgs.size() > 1 || files_mode) { - // for each argument, get the programs + // for each argument, get the programs std::vector<std::string>::iterator s = this->FinalArgs.begin(); if(files_mode) { @@ -68,9 +69,9 @@ void cmInstallProgramsCommand::FinalPass() std::vector<std::string> programs; cmSystemTools::Glob(this->Makefile->GetCurrentDirectory(), this->FinalArgs[0].c_str(), programs); - + std::vector<std::string>::iterator s = programs.begin(); - // for each argument, get the programs + // for each argument, get the programs for (;s != programs.end(); ++s) { this->Files.push_back(this->FindInstallSource(s->c_str())); @@ -89,13 +90,14 @@ void cmInstallProgramsCommand::FinalPass() // Use a file install generator. const char* no_permissions = ""; const char* no_rename = ""; - const char* no_component = "Unspecified"; + std::string no_component = this->Makefile->GetSafeDefinition( + "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"); std::vector<std::string> no_configurations; this->Makefile->AddInstallGenerator( new cmInstallFilesGenerator(this->Files, destination.c_str(), true, no_permissions, no_configurations, - no_component, no_rename)); + no_component.c_str(), no_rename)); } /** @@ -112,7 +114,7 @@ std::string cmInstallProgramsCommand // This is a full path. return name; } - + // This is a relative path. std::string tb = this->Makefile->GetCurrentOutputDirectory(); tb += "/"; @@ -120,7 +122,7 @@ std::string cmInstallProgramsCommand std::string ts = this->Makefile->GetCurrentDirectory(); ts += "/"; ts += name; - + if(cmSystemTools::FileExists(tb.c_str())) { // The file exists in the binary tree. Use it. diff --git a/Source/cmInstallTargetsCommand.cxx b/Source/cmInstallTargetsCommand.cxx index 27fc175..277ccea 100644 --- a/Source/cmInstallTargetsCommand.cxx +++ b/Source/cmInstallTargetsCommand.cxx @@ -58,7 +58,8 @@ bool cmInstallTargetsCommand } this->Makefile->GetLocalGenerator()->GetGlobalGenerator() - ->AddInstallComponent("Unspecified"); + ->AddInstallComponent(this->Makefile->GetSafeDefinition( + "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME")); return true; } 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/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 13ede5d..0cfb36b 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -872,6 +872,13 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable, return replaceValues.TargetPDB; } } + if(replaceValues.DependencyFile ) + { + if(variable == "DEP_FILE") + { + return replaceValues.DependencyFile; + } + } if(replaceValues.Target) { @@ -954,29 +961,27 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable, } } } - if(replaceValues.TargetSOName) + if(variable == "TARGET_SONAME" || variable == "SONAME_FLAG" || + variable == "TARGET_INSTALLNAME_DIR") { - if(variable == "TARGET_SONAME") + // All these variables depend on TargetSOName + if(replaceValues.TargetSOName) { - if(replaceValues.Language) + if(variable == "TARGET_SONAME") { - std::string name = "CMAKE_SHARED_LIBRARY_SONAME_"; - name += replaceValues.Language; - name += "_FLAG"; - if(this->Makefile->GetDefinition(name.c_str())) - { - return replaceValues.TargetSOName; - } + return replaceValues.TargetSOName; + } + if(variable == "SONAME_FLAG" && replaceValues.SONameFlag) + { + return replaceValues.SONameFlag; + } + if(replaceValues.TargetInstallNameDir && + variable == "TARGET_INSTALLNAME_DIR") + { + return replaceValues.TargetInstallNameDir; } - return ""; - } - } - if(replaceValues.TargetInstallNameDir) - { - if(variable == "TARGET_INSTALLNAME_DIR") - { - return replaceValues.TargetInstallNameDir; } + return ""; } if(replaceValues.LinkLibraries) { @@ -1550,16 +1555,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs, target.GetName()); return; } - std::string langVar = "CMAKE_"; - langVar += linkLanguage; - std::string flagsVar = langVar + "_FLAGS"; - std::string sharedFlagsVar = "CMAKE_SHARED_LIBRARY_"; - sharedFlagsVar += linkLanguage; - sharedFlagsVar += "_FLAGS"; - flags += this->Makefile->GetSafeDefinition(flagsVar.c_str()); - flags += " "; - flags += this->Makefile->GetSafeDefinition(sharedFlagsVar.c_str()); - flags += " "; + this->AddLanguageFlags(flags, linkLanguage, buildType.c_str()); cmOStringStream linklibs; this->OutputLinkLibraries(linklibs, target, false); linkLibs = linklibs.str(); @@ -1968,6 +1964,111 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags, } //---------------------------------------------------------------------------- +void cmLocalGenerator::AddCMP0018Flags(std::string &flags, cmTarget* target, + std::string const& lang) +{ + int targetType = target->GetType(); + + bool shared = ((targetType == cmTarget::SHARED_LIBRARY) || + (targetType == cmTarget::MODULE_LIBRARY)); + + if (this->GetShouldUseOldFlags(shared, lang)) + { + this->AddSharedFlags(flags, lang.c_str(), shared); + } + else + { + // Add position independendent flags, if needed. + if (target->GetPropertyAsBool("POSITION_INDEPENDENT_CODE")) + { + this->AddPositionIndependentFlags(flags, lang, targetType); + } + if (shared) + { + this->AppendFeatureOptions(flags, lang.c_str(), "DLL"); + } + } +} + +//---------------------------------------------------------------------------- +bool cmLocalGenerator::GetShouldUseOldFlags(bool shared, + const std::string &lang) const +{ + std::string originalFlags = + this->GlobalGenerator->GetSharedLibFlagsForLanguage(lang); + if (shared) + { + std::string flagsVar = "CMAKE_SHARED_LIBRARY_"; + flagsVar += lang; + flagsVar += "_FLAGS"; + const char* flags = + this->Makefile->GetSafeDefinition(flagsVar.c_str()); + + if (flags && flags != originalFlags) + { + switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0018)) + { + case cmPolicies::WARN: + { + cmOStringStream e; + e << "Variable " << flagsVar << " has been modified. CMake " + "will ignore the POSITION_INDEPENDENT_CODE target property for " + "shared libraries and will use the " << flagsVar << " variable " + "instead. This may cause errors if the original content of " + << flagsVar << " was removed.\n" + << this->Makefile->GetPolicies()->GetPolicyWarning( + cmPolicies::CMP0018); + + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str()); + // fall through to OLD behaviour + } + case cmPolicies::OLD: + return true; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::NEW: + default: + return false; + } + } + } + return false; +} + +//---------------------------------------------------------------------------- +void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags, + std::string const& lang, + int targetType) +{ + const char* picFlags = 0; + + if(targetType == cmTarget::EXECUTABLE) + { + std::string flagsVar = "CMAKE_"; + flagsVar += lang; + flagsVar += "_COMPILE_OPTIONS_PIE"; + picFlags = this->Makefile->GetSafeDefinition(flagsVar.c_str()); + } + if (!picFlags) + { + std::string flagsVar = "CMAKE_"; + flagsVar += lang; + flagsVar += "_COMPILE_OPTIONS_PIC"; + picFlags = this->Makefile->GetSafeDefinition(flagsVar.c_str()); + } + if (picFlags) + { + std::vector<std::string> options; + cmSystemTools::ExpandListArgument(picFlags, options); + for(std::vector<std::string>::const_iterator oi = options.begin(); + oi != options.end(); ++oi) + { + this->AppendFlags(flags, this->EscapeForShell(oi->c_str()).c_str()); + } + } +} + +//---------------------------------------------------------------------------- void cmLocalGenerator::AddConfigVariableFlags(std::string& flags, const char* var, const char* config) @@ -2764,10 +2865,13 @@ cmLocalGenerator bool replaceExt = this->NeedBackwardsCompatibility(2, 4); if(!replaceExt) { - std::string repVar = "CMAKE_"; - repVar += source.GetLanguage(); - repVar += "_OUTPUT_EXTENSION_REPLACE"; - replaceExt = this->Makefile->IsOn(repVar.c_str()); + if(const char* lang = source.GetLanguage()) + { + std::string repVar = "CMAKE_"; + repVar += lang; + repVar += "_OUTPUT_EXTENSION_REPLACE"; + replaceExt = this->Makefile->IsOn(repVar.c_str()); + } } // Remove the source extension if it is to be replaced. diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 3e93819..39b493f 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -140,7 +140,8 @@ public: void AddLanguageFlags(std::string& flags, const char* lang, const char* config); - void AddSharedFlags(std::string& flags, const char* lang, bool shared); + void AddCMP0018Flags(std::string &flags, cmTarget* target, + std::string const& lang); void AddConfigVariableFlags(std::string& flags, const char* var, const char* config); ///! Append flags to a string. @@ -204,6 +205,10 @@ public: /** Compute the language used to compile the given source file. */ const char* GetSourceFileLanguage(const cmSourceFile& source); + // Fill the vector with the target names for the object files, + // preprocessed files and assembly files. + virtual void GetIndividualFileTargets(std::vector<std::string>&) {} + // Create a struct to hold the varibles passed into // ExpandRuleVariables struct RuleVariables @@ -228,12 +233,14 @@ public: const char* ObjectDir; const char* Flags; const char* ObjectsQuoted; + const char* SONameFlag; const char* TargetSOName; const char* TargetInstallNameDir; const char* LinkFlags; const char* LanguageCompileFlags; const char* Defines; const char* RuleLauncher; + const char* DependencyFile; }; /** Set whether to treat conversions to SHELL as a link script shell. */ @@ -424,6 +431,11 @@ protected: private: std::string ConvertToOutputForExistingCommon(const char* remote, std::string const& result); + + void AddSharedFlags(std::string& flags, const char* lang, bool shared); + bool GetShouldUseOldFlags(bool shared, const std::string &lang) const; + void AddPositionIndependentFlags(std::string& flags, std::string const& l, + int targetType); }; #endif diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 425b219..ea9c406 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -46,7 +46,9 @@ void cmLocalNinjaGenerator::Generate() this->SetConfigName(); this->WriteProcessedMakefile(this->GetBuildFileStream()); +#ifdef NINJA_GEN_VERBOSE_FILES this->WriteProcessedMakefile(this->GetRulesFileStream()); +#endif this->WriteBuildFileTop(); @@ -270,21 +272,21 @@ std::string cmLocalNinjaGenerator::BuildCommandLine( // don't use POST_BUILD. if (cmdLines.empty()) #ifdef _WIN32 - return "cd."; + return "cd ."; #else return ":"; #endif - // TODO: This will work only on Unix platforms. I don't - // want to use a link.txt file because I will lose the benefit of the - // $in variables. A discussion about dealing with multiple commands in - // a rule is started here: - // groups.google.com/group/ninja-build/browse_thread/thread/d515f23a78986008 - std::ostringstream cmd; + cmOStringStream cmd; for (std::vector<std::string>::const_iterator li = cmdLines.begin(); li != cmdLines.end(); ++li) { - if (li != cmdLines.begin()) + if (li != cmdLines.begin()) { cmd << " && "; +#ifdef _WIN32 + } else if (cmdLines.size() > 1) { + cmd << "cmd.exe /c "; +#endif + } cmd << *li; } return cmd.str(); @@ -299,7 +301,7 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(const cmCustomCommand *cc, if (!wd) wd = this->GetMakefile()->GetStartOutputDirectory(); - std::ostringstream cdCmd; + cmOStringStream cdCmd; cdCmd << "cd " << this->ConvertToOutputFormat(wd, SHELL); cmdLines.push_back(cdCmd.str()); } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index a645303..db93529 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -36,6 +36,30 @@ #include <queue> //---------------------------------------------------------------------------- +// Escape special characters in Makefile dependency lines +class cmMakeSafe +{ +public: + cmMakeSafe(const char* s): Data(s) {} + cmMakeSafe(std::string const& s): Data(s.c_str()) {} +private: + const char* Data; + friend std::ostream& operator<<(std::ostream& os, + cmMakeSafe const& self) + { + for(const char* c = self.Data; *c; ++c) + { + switch (*c) + { + case '=': os << "$(EQUALS)"; break; + default: os << *c; break; + } + } + return os; + } +}; + +//---------------------------------------------------------------------------- // Helper function used below. static std::string cmSplitExtension(std::string const& in, std::string& base) { @@ -555,28 +579,13 @@ cmLocalUnixMakefileGenerator3 space = " "; } - // Warn about paths not supported by Make tools. - std::string::size_type pos = tgt.find_first_of("="); - if(pos != std::string::npos) - { - cmOStringStream m; - m << - "Make rule for\n" - " " << tgt << "\n" - "has '=' on left hand side. " - "The make tool may not support this."; - cmListFileBacktrace bt; - this->GlobalGenerator->GetCMakeInstance() - ->IssueMessage(cmake::WARNING, m.str(), bt); - } - // Mark the rule as symbolic if requested. if(symbolic) { if(const char* sym = this->Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE")) { - os << tgt.c_str() << space << ": " << sym << "\n"; + os << cmMakeSafe(tgt) << space << ": " << sym << "\n"; } } @@ -584,7 +593,7 @@ cmLocalUnixMakefileGenerator3 if(depends.empty()) { // No dependencies. The commands will always run. - os << tgt.c_str() << space << ":\n"; + os << cmMakeSafe(tgt) << space << ":\n"; } else { @@ -595,7 +604,7 @@ cmLocalUnixMakefileGenerator3 { replace = *dep; replace = this->Convert(replace.c_str(),HOME_OUTPUT,MAKEFILE); - os << tgt.c_str() << space << ": " << replace.c_str() << "\n"; + os << cmMakeSafe(tgt) << space << ": " << cmMakeSafe(replace) << "\n"; } } @@ -608,7 +617,7 @@ cmLocalUnixMakefileGenerator3 } if(symbolic && !this->WatcomWMake) { - os << ".PHONY : " << tgt.c_str() << "\n"; + os << ".PHONY : " << cmMakeSafe(tgt) << "\n"; } os << "\n"; // Add the output to the local help if requested. @@ -687,6 +696,10 @@ cmLocalUnixMakefileGenerator3 << this->ConvertShellCommand(cmakecommand, FULL) << " -E remove -f\n" << "\n"; + makefileStream + << "# Escaping for special characters.\n" + << "EQUALS = =\n" + << "\n"; if(const char* edit_cmd = this->Makefile->GetDefinition("CMAKE_EDIT_COMMAND")) 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/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 9faf46d..f2ab79d 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1933,9 +1933,11 @@ cmLocalVisualStudio7Generator vskey += "\\Packages\\" CM_INTEL_PLUGIN_GUID ";ProductVersion"; cmSystemTools::ReadRegistryValue(vskey.c_str(), intelVersion, cmSystemTools::KeyWOW64_32); - if (intelVersion.find("12") == 0 || (intelVersion.find("11") == 0)) + if (intelVersion.find("13") == 0 || + intelVersion.find("12") == 0 || + intelVersion.find("11") == 0) { - // Version 11.x and 12.x actually use 11.0 in project files! + // Version 11.x, 12.x, and 13.x actually use 11.0 in project files! intelVersion = "11.0" ; } else if(intelVersion.find("10") == 0) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index e7e5eda..7b6c450 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -354,6 +354,22 @@ bool cmMakefile::GetBacktrace(cmListFileBacktrace& backtrace) const } //---------------------------------------------------------------------------- +void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) +{ + cmOStringStream msg; + msg << lff.FilePath << "(" << lff.Line << "): "; + msg << lff.Name << "("; + for(std::vector<cmListFileArgument>::const_iterator i = + lff.Arguments.begin(); i != lff.Arguments.end(); ++i) + { + msg << i->Value; + msg << " "; + } + msg << ")"; + cmSystemTools::Message(msg.str().c_str()); +} + +//---------------------------------------------------------------------------- bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, cmExecutionStatus &status) { @@ -385,20 +401,10 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, || pcmd->IsScriptable())) { - // if trace is one, print out invoke information + // if trace is enabled, print out invoke information if(this->GetCMakeInstance()->GetTrace()) { - cmOStringStream msg; - msg << lff.FilePath << "(" << lff.Line << "): "; - msg << lff.Name << "("; - for(std::vector<cmListFileArgument>::const_iterator i = - lff.Arguments.begin(); i != lff.Arguments.end(); ++i) - { - msg << i->Value; - msg << " "; - } - msg << ")"; - cmSystemTools::Message(msg.str().c_str()); + this->PrintCommandTrace(lff); } // Try invoking the command. if(!pcmd->InvokeInitialPass(lff.Arguments,status) || @@ -883,7 +889,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 +903,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 +916,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 +934,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 +954,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 +970,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 +1005,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 +1021,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 +1056,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 +1071,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 +1977,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) { @@ -2201,6 +2201,18 @@ bool cmMakefile::PlatformIs64Bit() const return false; } +const char* cmMakefile::GetSONameFlag(const char* language) const +{ + std::string name = "CMAKE_SHARED_LIBRARY_SONAME"; + if(language) + { + name += "_"; + name += language; + } + name += "_FLAG"; + return GetDefinition(name.c_str()); +} + bool cmMakefile::CanIWriteThisFile(const char* fileName) { if ( !this->IsOn("CMAKE_DISABLE_SOURCE_CHANGES") ) diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 960ba39..8a0088b 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, @@ -593,6 +595,9 @@ public: /** Return whether the target platform is 64-bit. */ bool PlatformIs64Bit() const; + /** Retrieve soname flag for the specified language if supported */ + const char* GetSONameFlag(const char* language) const; + /** * Get a list of preprocessor define flags. */ @@ -696,6 +701,11 @@ public: #endif /** + * Print a command's invocation + */ + void PrintCommandTrace(const cmListFileFunction& lff); + + /** * Execute a single CMake command. Returns true if the command * succeeded or false if it failed. */ diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 38aa59d..db59ffd 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -714,7 +714,11 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules std::string linkString = linklibs.str(); vars.LinkLibraries = linkString.c_str(); vars.ObjectsQuoted = buildObjs.c_str(); - vars.TargetSOName= targetNameSO.c_str(); + if (this->Target->HasSOName(this->ConfigName)) + { + vars.SONameFlag = this->Makefile->GetSONameFlag(linkLanguage); + vars.TargetSOName= targetNameSO.c_str(); + } vars.LinkFlags = linkFlags.c_str(); // Compute the directory portion of the install_name setting. diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index a0e0481..16e3e02 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -153,14 +153,8 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules() } } } - for(std::vector<cmSourceFile*>::const_iterator - si = this->GeneratorTarget->OSXContent.begin(); - si != this->GeneratorTarget->OSXContent.end(); ++si) - { - cmTarget::SourceFileFlags tsFlags = - this->Target->GetTargetSourceFileFlags(*si); - this->WriteMacOSXContentRules(**si, tsFlags.MacFolder); - } + this->WriteMacOSXContentRules(this->GeneratorTarget->HeaderSources); + this->WriteMacOSXContentRules(this->GeneratorTarget->ExtraSources); for(std::vector<cmSourceFile*>::const_iterator si = this->GeneratorTarget->ExternalObjects.begin(); si != this->GeneratorTarget->ExternalObjects.end(); ++si) @@ -251,9 +245,6 @@ std::string cmMakefileTargetGenerator::GetFlags(const std::string &l) std::string flags; const char *lang = l.c_str(); - bool shared = ((this->Target->GetType() == cmTarget::SHARED_LIBRARY) || - (this->Target->GetType() == cmTarget::MODULE_LIBRARY)); - // Add language feature flags. this->AddFeatureFlags(flags, lang); @@ -266,8 +257,7 @@ std::string cmMakefileTargetGenerator::GetFlags(const std::string &l) this->AddFortranFlags(flags); } - // Add shared-library flags if needed. - this->LocalGenerator->AddSharedFlags(flags, lang, shared); + this->LocalGenerator->AddCMP0018Flags(flags, this->Target, lang); // Add include directory flags. this->AddIncludeFlags(flags, lang); @@ -354,6 +344,22 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags() } //---------------------------------------------------------------------------- +void cmMakefileTargetGenerator::WriteMacOSXContentRules( + std::vector<cmSourceFile*> const& sources) +{ + for(std::vector<cmSourceFile*>::const_iterator + si = sources.begin(); si != sources.end(); ++si) + { + cmTarget::SourceFileFlags tsFlags = + this->Target->GetTargetSourceFileFlags(*si); + if(tsFlags.Type != cmTarget::SourceFileTypeNormal) + { + this->WriteMacOSXContentRules(**si, tsFlags.MacFolder); + } + } +} + +//---------------------------------------------------------------------------- void cmMakefileTargetGenerator::WriteMacOSXContentRules(cmSourceFile& source, const char* pkgloc) { @@ -1410,10 +1416,9 @@ class cmMakefileTargetGeneratorObjectStrings { public: cmMakefileTargetGeneratorObjectStrings(std::vector<std::string>& strings, - cmMakefile* mf, cmLocalUnixMakefileGenerator3* lg, std::string::size_type limit): - Strings(strings), Makefile(mf), LocalGenerator(lg), LengthLimit(limit) + Strings(strings), LocalGenerator(lg), LengthLimit(limit) { this->Space = ""; } @@ -1448,7 +1453,6 @@ public: } private: std::vector<std::string>& Strings; - cmMakefile* Makefile; cmLocalUnixMakefileGenerator3* LocalGenerator; std::string::size_type LengthLimit; std::string CurrentString; @@ -1463,7 +1467,7 @@ cmMakefileTargetGenerator std::string::size_type limit) { cmMakefileTargetGeneratorObjectStrings - helper(objStrings, this->Makefile, this->LocalGenerator, limit); + helper(objStrings, this->LocalGenerator, limit); for(std::vector<std::string>::const_iterator i = this->Objects.begin(); i != this->Objects.end(); ++i) { diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index e1e554b..36a1f68 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -73,6 +73,7 @@ protected: void WriteTargetDependRules(); // write rules for Mac OS X Application Bundle content. + void WriteMacOSXContentRules(std::vector<cmSourceFile*> const& sources); void WriteMacOSXContentRules(cmSourceFile& source, const char* pkgloc); // write the rules for an object diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 2bad32c..be7739e 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -18,6 +18,12 @@ #include "cmMakefile.h" #include <assert.h> +#include <algorithm> + +#ifndef _WIN32 +#include <unistd.h> +#endif + cmNinjaNormalTargetGenerator:: cmNinjaNormalTargetGenerator(cmTarget* target) @@ -47,8 +53,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())); } } @@ -76,16 +81,15 @@ void cmNinjaNormalTargetGenerator::Generate() } else { - this->WriteLinkRule(); + this->WriteLinkRule(false); // write rule without rspfile support + this->WriteLinkRule(true); // write rule with rspfile support this->WriteLinkStatement(); } - - this->GetBuildFileStream() << "\n"; - this->GetRulesFileStream() << "\n"; } void cmNinjaNormalTargetGenerator::WriteLanguagesRules() { +#ifdef NINJA_GEN_VERBOSE_FILES cmGlobalNinjaGenerator::WriteDivider(this->GetRulesFileStream()); this->GetRulesFileStream() << "# Rules for each languages for " @@ -93,6 +97,7 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules() << " target " << this->GetTargetName() << "\n\n"; +#endif std::set<cmStdString> languages; this->GetTarget()->GetLanguages(languages); @@ -130,28 +135,47 @@ cmNinjaNormalTargetGenerator void cmNinjaNormalTargetGenerator -::WriteLinkRule() +::WriteLinkRule(bool useResponseFile) { cmTarget::TargetType targetType = this->GetTarget()->GetType(); std::string ruleName = this->LanguageLinkerRule(); + if (useResponseFile) + ruleName += "_RSPFILE"; + + // Select whether to use a response file for objects. + std::string rspfile; + std::string rspcontent; if (!this->GetGlobalGenerator()->HasRule(ruleName)) { cmLocalGenerator::RuleVariables vars; vars.RuleLauncher = "RULE_LAUNCH_LINK"; vars.CMTarget = this->GetTarget(); vars.Language = this->TargetLinkLanguage; - vars.Objects = "$in"; - std::string objdir = - this->GetLocalGenerator()->GetHomeRelativeOutputPath(); - objdir += objdir.empty() ? "" : "/"; - objdir += cmake::GetCMakeFilesDirectoryPostSlash(); - objdir += this->GetTargetName(); - objdir += ".dir"; - objdir = this->GetLocalGenerator()->Convert(objdir.c_str(), - cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); - vars.ObjectDir = objdir.c_str(); + + std::string responseFlag; + if (!useResponseFile) { + vars.Objects = "$in"; + vars.LinkLibraries = "$LINK_LIBRARIES"; + } else { + // handle response file + std::string cmakeLinkVar = std::string("CMAKE_") + + this->TargetLinkLanguage + "_RESPONSE_FILE_LINK_FLAG"; + const char * flag = GetMakefile()->GetDefinition(cmakeLinkVar.c_str()); + if(flag) { + responseFlag = flag; + } else { + responseFlag = "@"; + } + rspfile = "$out.rsp"; + responseFlag += rspfile; + rspcontent = "$in $LINK_LIBRARIES"; + vars.Objects = responseFlag.c_str(); + vars.LinkLibraries = ""; + } + + vars.ObjectDir = "$OBJECT_DIR"; vars.Target = "$out"; + vars.SONameFlag = "$SONAME_FLAG"; vars.TargetSOName = "$SONAME"; vars.TargetInstallNameDir = "$INSTALLNAME_DIR"; vars.TargetPDB = "$TARGET_PDB"; @@ -173,19 +197,19 @@ cmNinjaNormalTargetGenerator vars.TargetVersionMajor = targetVersionMajor.c_str(); vars.TargetVersionMinor = targetVersionMinor.c_str(); - vars.LinkLibraries = "$LINK_LIBRARIES"; vars.Flags = "$FLAGS"; vars.LinkFlags = "$LINK_FLAGS"; std::string langFlags; - this->GetLocalGenerator()->AddLanguageFlags(langFlags, - this->TargetLinkLanguage, - this->GetConfigName()); - if (targetType != cmTarget::EXECUTABLE) + if (targetType != cmTarget::EXECUTABLE) { + this->GetLocalGenerator()->AddLanguageFlags(langFlags, + this->TargetLinkLanguage, + this->GetConfigName()); langFlags += " $ARCH_FLAGS"; - vars.LanguageCompileFlags = langFlags.c_str(); + vars.LanguageCompileFlags = langFlags.c_str(); + } - // Rule for linking library. + // Rule for linking library/executable. std::vector<std::string> linkCmds = this->ComputeLinkCmd(); for(std::vector<std::string>::iterator i = linkCmds.begin(); i != linkCmds.end(); @@ -198,17 +222,20 @@ cmNinjaNormalTargetGenerator std::string linkCmd = this->GetLocalGenerator()->BuildCommandLine(linkCmds); - // Write the linker rule. - std::ostringstream comment; + // Write the linker rule with response file if needed. + cmOStringStream comment; comment << "Rule for linking " << this->TargetLinkLanguage << " " << this->GetVisibleTypeName() << "."; - std::ostringstream description; + cmOStringStream description; description << "Linking " << this->TargetLinkLanguage << " " << this->GetVisibleTypeName() << " $out"; this->GetGlobalGenerator()->AddRule(ruleName, linkCmd, description.str(), - comment.str()); + comment.str(), + /*depfile*/ "", + rspfile, + rspcontent); } if (this->TargetNameOut != this->TargetNameReal) { @@ -337,7 +364,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() /*implib=*/true).c_str()); // Compute the comment. - std::ostringstream comment; + cmOStringStream comment; comment << "Link the " << this->GetVisibleTypeName() << " " << targetOutputReal; @@ -346,8 +373,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() outputs.push_back(targetOutputReal); // Compute specific libraries to link with. - cmNinjaDeps explicitDeps = this->GetObjects(), - implicitDeps = this->ComputeLinkDeps(); + cmNinjaDeps explicitDeps = this->GetObjects(); + cmNinjaDeps implicitDeps = this->ComputeLinkDeps(); this->GetLocalGenerator()->GetTargetFlags(vars["LINK_LIBRARIES"], vars["FLAGS"], @@ -359,34 +386,64 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() // Compute architecture specific link flags. Yes, these go into a different // variable for executables, probably due to a mistake made when duplicating // code between the Makefile executable and library generators. - this->GetLocalGenerator() - ->AddArchitectureFlags(targetType == cmTarget::EXECUTABLE + std::string flags = (targetType == cmTarget::EXECUTABLE ? vars["FLAGS"] - : vars["ARCH_FLAGS"], + : vars["ARCH_FLAGS"]); + this->GetLocalGenerator()->AddArchitectureFlags(flags, this->GetTarget(), this->TargetLinkLanguage, this->GetConfigName()); - vars["SONAME"] = this->TargetNameSO; - - if (targetType == cmTarget::SHARED_LIBRARY) { - std::string install_name_dir = - this->GetTarget()->GetInstallNameDirForBuildTree(this->GetConfigName()); - - if (!install_name_dir.empty()) { - vars["INSTALLNAME_DIR"] = - this->GetLocalGenerator()->Convert(install_name_dir.c_str(), - cmLocalGenerator::NONE, - cmLocalGenerator::SHELL, false); + if (targetType == cmTarget::EXECUTABLE) { + vars["FLAGS"] = flags; + } else { + vars["ARCH_FLAGS"] = flags; + } + if (this->GetTarget()->HasSOName(this->GetConfigName())) { + vars["SONAME_FLAG"] = + this->GetMakefile()->GetSONameFlag(this->TargetLinkLanguage); + vars["SONAME"] = this->TargetNameSO; + if (targetType == cmTarget::SHARED_LIBRARY) { + std::string install_name_dir = this->GetTarget() + ->GetInstallNameDirForBuildTree(this->GetConfigName()); + + if (!install_name_dir.empty()) { + vars["INSTALLNAME_DIR"] = + this->GetLocalGenerator()->Convert(install_name_dir.c_str(), + cmLocalGenerator::NONE, + cmLocalGenerator::SHELL, false); + } } } + 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); + // TODO move to GetTargetPDB + cmMakefile* mf = this->GetMakefile(); + if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") || + mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID")) + { + path = this->GetTargetPDB(); + vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat( + ConvertToNinjaPath(path.c_str()).c_str(), + cmLocalGenerator::SHELL); + EnsureParentDirectoryExists(path); + } + + if (mf->IsOn("CMAKE_COMPILER_IS_MINGW")) + { + path = GetTarget()->GetSupportDirectory(); + vars["OBJECT_DIR"] = ConvertToNinjaPath(path.c_str()); + EnsureDirectoryExists(path); + // ar.exe can't handle backslashes in rsp files (implictly used by gcc) + std::string& linkLibraries = vars["LINK_LIBRARIES"]; + std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/'); + } std::vector<cmCustomCommand> *cmdLists[3] = { &this->GetTarget()->GetPreBuildCommands(), @@ -413,7 +470,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); @@ -432,6 +489,17 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() symlinkVars["POST_BUILD"] = postBuildCmdLine; } + int linkRuleLength = this->GetGlobalGenerator()-> + GetRuleCmdLength(this->LanguageLinkerRule()); +#ifdef _WIN32 + int commandLineLengthLimit = 8000 - linkRuleLength; +#elif defined(__linux) || defined(__APPLE__) + // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac + int commandLineLengthLimit = sysconf(_SC_ARG_MAX) - linkRuleLength - 1000; +#else + int commandLineLengthLimit = -1; +#endif + // Write the build statement for this target. cmGlobalNinjaGenerator::WriteBuild(this->GetBuildFileStream(), comment.str(), @@ -440,7 +508,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() explicitDeps, implicitDeps, emptyDeps, - vars); + vars, + commandLineLengthLimit); if (targetOutput != targetOutputReal) { if (targetType == cmTarget::EXECUTABLE) { @@ -453,11 +522,20 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() emptyDeps, symlinkVars); } else { - symlinkVars["SONAME"] = this->GetTargetFilePath(this->TargetNameSO); + cmNinjaDeps symlinks; + const std::string soName = this->GetTargetFilePath(this->TargetNameSO); + // If one link has to be created. + if (targetOutputReal == soName || targetOutput == soName) { + symlinkVars["SONAME"] = soName; + } else { + symlinkVars["SONAME"] = ""; + symlinks.push_back(soName); + } + symlinks.push_back(targetOutput); cmGlobalNinjaGenerator::WriteBuild(this->GetBuildFileStream(), "Create library symlink " + targetOutput, "CMAKE_SYMLINK_LIBRARY", - cmNinjaDeps(1, targetOutput), + symlinks, cmNinjaDeps(1, targetOutputReal), emptyDeps, emptyDeps, diff --git a/Source/cmNinjaNormalTargetGenerator.h b/Source/cmNinjaNormalTargetGenerator.h index 1702caf..1ef9567 100644 --- a/Source/cmNinjaNormalTargetGenerator.h +++ b/Source/cmNinjaNormalTargetGenerator.h @@ -30,7 +30,7 @@ private: std::string LanguageLinkerRule() const; const char* GetVisibleTypeName() const; void WriteLanguagesRules(); - void WriteLinkRule(); + void WriteLinkRule(bool useResponseFile); void WriteLinkStatement(); void WriteObjectLibStatement(); std::vector<std::string> ComputeLinkCmd(); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index c6469f2..4758989 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -140,11 +140,8 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source, // } // Add shared-library flags if needed. - { - bool shared = ((this->Target->GetType() == cmTarget::SHARED_LIBRARY) || - (this->Target->GetType() == cmTarget::MODULE_LIBRARY)); - this->GetLocalGenerator()->AddSharedFlags(flags, language.c_str(), shared); - } + this->LocalGenerator->AddCMP0018Flags(flags, this->Target, + language.c_str()); // TODO: Handle response file. // Add include directory flags. @@ -154,6 +151,8 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source, language.c_str()); std::string includeFlags = this->LocalGenerator->GetIncludeFlags(includes, language.c_str(), false); + if(cmGlobalNinjaGenerator::IsMinGW()) + cmSystemTools::ReplaceString(includeFlags, "\\", "/"); this->LocalGenerator->AppendFlags(flags, includeFlags.c_str()); } @@ -301,7 +300,7 @@ std::string cmNinjaTargetGenerator::GetTargetPDB() const targetFullPathPDB += this->Target->GetPDBName(this->GetConfigName()); } - return ConvertToNinjaPath(targetFullPathPDB.c_str()); + return targetFullPathPDB.c_str(); } @@ -309,10 +308,11 @@ void cmNinjaTargetGenerator ::WriteLanguageRules(const std::string& language) { +#ifdef NINJA_GEN_VERBOSE_FILES this->GetRulesFileStream() << "# Rules for language " << language << "\n\n"; +#endif this->WriteCompileRule(language); - this->GetRulesFileStream() << "\n"; } void @@ -330,20 +330,45 @@ cmNinjaTargetGenerator vars.Defines = "$DEFINES"; vars.TargetPDB = "$TARGET_PDB"; + + cmMakefile* mf = this->GetMakefile(); + + bool useClDeps = false; + std::string clDepsBinary; + std::string clShowPrefix; + if (lang == "C" || lang == "CXX" || lang == "RC") + { + const char* depsPtr = mf->GetDefinition("CMAKE_CMCLDEPS_EXECUTABLE"); + const char* showPtr = mf->GetDefinition("CMAKE_CL_SHOWINCLUDE_PREFIX"); + if (depsPtr && showPtr) + { + // don't wrap for try_compile, + // TODO but why doesn't it work with cmcldeps? + const std::string projectName = mf->GetProjectName() ? + mf->GetProjectName() : ""; + if (projectName != "CMAKE_TRY_COMPILE") + { + useClDeps = true; + std::string qu = "\""; + clDepsBinary = qu + depsPtr + qu; + clShowPrefix = qu + showPtr + qu; + vars.DependencyFile = "$DEP_FILE"; + } + } + } + + std::string depfile; std::string depfileFlagsName = "CMAKE_DEPFILE_FLAGS_" + language; - const char *depfileFlags = - this->GetMakefile()->GetDefinition(depfileFlagsName.c_str()); - if (depfileFlags) { - std::string depfileFlagsStr = depfileFlags; - depfile = "$out.d"; - cmSystemTools::ReplaceString(depfileFlagsStr, "<DEPFILE>", - depfile.c_str()); - cmSystemTools::ReplaceString(depfileFlagsStr, "<OBJECT>", - "$out"); - cmSystemTools::ReplaceString(depfileFlagsStr, "<CMAKE_C_COMPILER>", - this->GetMakefile()->GetDefinition("CMAKE_C_COMPILER")); - flags += " " + depfileFlagsStr; + const char *depfileFlags = mf->GetDefinition(depfileFlagsName.c_str()); + if (depfileFlags || useClDeps) { + std::string depFlagsStr = depfileFlags ? depfileFlags : ""; + depfile = "$DEP_FILE"; + cmSystemTools::ReplaceString(depFlagsStr, "<DEPFILE>", "\"$DEP_FILE\""); + cmSystemTools::ReplaceString(depFlagsStr, "<OBJECT>", "$out"); + cmSystemTools::ReplaceString(depFlagsStr, "<CMAKE_C_COMPILER>", + mf->GetDefinition("CMAKE_C_COMPILER")); + flags += " " + depFlagsStr; } vars.Flags = flags.c_str(); @@ -352,8 +377,7 @@ cmNinjaTargetGenerator std::string compileCmdVar = "CMAKE_"; compileCmdVar += language; compileCmdVar += "_COMPILE_OBJECT"; - std::string compileCmd = - this->GetMakefile()->GetRequiredDefinition(compileCmdVar.c_str()); + std::string compileCmd = mf->GetRequiredDefinition(compileCmdVar.c_str()); std::vector<std::string> compileCmds; cmSystemTools::ExpandListArgument(compileCmd, compileCmds); @@ -364,10 +388,18 @@ cmNinjaTargetGenerator std::string cmdLine = this->GetLocalGenerator()->BuildCommandLine(compileCmds); + if(useClDeps) + { + std::string cl = mf->GetDefinition("CMAKE_C_COMPILER"); + cl = "\"" + cl + "\" "; + cmdLine = clDepsBinary + " " + lang + " $in \"$DEP_FILE\" $out " + + clShowPrefix + " " + cl + cmdLine; + } + // Write the rule for compiling file of the given language. - std::ostringstream comment; + cmOStringStream comment; comment << "Rule for compiling " << language << " files."; - std::ostringstream description; + cmOStringStream description; description << "Building " << language << " object $out"; this->GetGlobalGenerator()->AddRule(this->LanguageCompilerRule(language), cmdLine, @@ -396,7 +428,6 @@ cmNinjaTargetGenerator cmCustomCommand const* cc = (*si)->GetCustomCommand(); this->GetLocalGenerator()->AddCustomCommandTarget(cc, this->GetTarget()); } - // TODO: this->GeneratorTarget->OSXContent for(std::vector<cmSourceFile*>::const_iterator si = this->GeneratorTarget->ExternalObjects.begin(); si != this->GeneratorTarget->ExternalObjects.end(); ++si) @@ -485,8 +516,63 @@ cmNinjaTargetGenerator cmNinjaVars vars; vars["FLAGS"] = this->ComputeFlagsForObject(source, language); vars["DEFINES"] = this->ComputeDefines(source, language); - vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat( - this->GetTargetPDB().c_str(), cmLocalGenerator::SHELL); + vars["DEP_FILE"] = objectFileName + ".d";; + EnsureParentDirectoryExists(objectFileName); + + // TODO move to GetTargetPDB + cmMakefile* mf = this->GetMakefile(); + if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") || + mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID")) + { + vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat( + ConvertToNinjaPath(GetTargetPDB().c_str()).c_str(), + cmLocalGenerator::SHELL); + } + + if(this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS")) + { + cmLocalGenerator::RuleVariables compileObjectVars; + std::string lang = language; + compileObjectVars.Language = lang.c_str(); + + std::string escapedSourceFileName = sourceFileName; + + if (!cmSystemTools::FileIsFullPath(sourceFileName.c_str())) + { + escapedSourceFileName = cmSystemTools::CollapseFullPath( + escapedSourceFileName.c_str(), + this->GetGlobalGenerator()->GetCMakeInstance()-> + GetHomeOutputDirectory()); + } + + escapedSourceFileName = + this->LocalGenerator->ConvertToOutputFormat( + escapedSourceFileName.c_str(), cmLocalGenerator::SHELL); + + compileObjectVars.Source = escapedSourceFileName.c_str(); + compileObjectVars.Object = objectFileName.c_str(); + compileObjectVars.Flags = vars["FLAGS"].c_str(); + compileObjectVars.Defines = vars["DEFINES"].c_str(); + + // Rule for compiling object file. + std::string compileCmdVar = "CMAKE_"; + compileCmdVar += language; + compileCmdVar += "_COMPILE_OBJECT"; + std::string compileCmd = + this->GetMakefile()->GetRequiredDefinition(compileCmdVar.c_str()); + std::vector<std::string> compileCmds; + cmSystemTools::ExpandListArgument(compileCmd, compileCmds); + + for (std::vector<std::string>::iterator i = compileCmds.begin(); + i != compileCmds.end(); ++i) + this->GetLocalGenerator()->ExpandRuleVariables(*i, compileObjectVars); + + std::string cmdLine = + this->GetLocalGenerator()->BuildCommandLine(compileCmds); + + this->GetGlobalGenerator()->AddCXXCompileCommand(cmdLine, + sourceFileName); + } cmGlobalNinjaGenerator::WriteBuild(this->GetBuildFileStream(), comment, @@ -534,3 +620,17 @@ cmNinjaTargetGenerator this->ModuleDefinitionFile.c_str())); this->LocalGenerator->AppendFlags(flags, flag.c_str()); } + +void +cmNinjaTargetGenerator +::EnsureDirectoryExists(const std::string& dir) +{ + cmSystemTools::MakeDirectory(dir.c_str()); +} + +void +cmNinjaTargetGenerator +::EnsureParentDirectoryExists(const std::string& path) +{ + EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path.c_str())); +} diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index b64ce1e..af43a8b 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -111,6 +111,9 @@ protected: // Helper to add flag for windows .def file. void AddModuleDefinitionFlag(std::string& flags); + void EnsureDirectoryExists(const std::string& dir); + void EnsureParentDirectoryExists(const std::string& path); + private: cmTarget* Target; cmGeneratorTarget* GeneratorTarget; diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h index 775a4eb..96a75de 100644 --- a/Source/cmOrderDirectories.h +++ b/Source/cmOrderDirectories.h @@ -48,7 +48,6 @@ private: std::vector<std::string> OrderedDirectories; - bool OrderedDirectoriesComputed; std::vector<cmOrderDirectoriesConstraint*> ConstraintEntries; std::vector<cmOrderDirectoriesConstraint*> ImplicitDirEntries; std::vector<std::string> UserDirectories; diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 37070b6..79af4d7 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -463,6 +463,34 @@ cmPolicies::cmPolicies() "The OLD behaviour is to always prefer files from CMAKE_MODULE_PATH over " "files from the CMake modules directory.", 2,8,4,0, cmPolicies::WARN); + + this->DefinePolicy( + CMP0018, "CMP0018", + "Ignore CMAKE_SHARED_LIBRARY_<Lang>_FLAGS variable.", + "CMake 2.8.8 and lower compiled sources in SHARED and MODULE libraries " + "using the value of the undocumented CMAKE_SHARED_LIBRARY_<Lang>_FLAGS " + "platform variable. The variable contained platform-specific flags " + "needed to compile objects for shared libraries. Typically it included " + "a flag such as -fPIC for position independent code but also included " + "other flags needed on certain platforms. CMake 2.8.9 and higher " + "prefer instead to use the POSITION_INDEPENDENT_CODE target property to " + "determine what targets should be position independent, and new " + "undocumented platform variables to select flags while ignoring " + "CMAKE_SHARED_LIBRARY_<Lang>_FLAGS completely." + "\n" + "The default for either approach produces identical compilation flags, " + "but if a project modifies CMAKE_SHARED_LIBRARY_<Lang>_FLAGS from its " + "original value this policy determines which approach to use." + "\n" + "The OLD behavior for this policy is to ignore the " + "POSITION_INDEPENDENT_CODE property for all targets and use the modified " + "value of CMAKE_SHARED_LIBRARY_<Lang>_FLAGS for SHARED and MODULE " + "libraries." + "\n" + "The NEW behavior for this policy is to ignore " + "CMAKE_SHARED_LIBRARY_<Lang>_FLAGS whether it is modified or not and " + "honor the POSITION_INDEPENDENT_CODE target property.", + 2,8,9,0, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 3106248..6932565 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -65,6 +65,9 @@ public: /// target_link_libraries() fails if only argument is not a target CMP0016, CMP0017, ///< Prefer files in CMAKE_ROOT when including from CMAKE_ROOT + CMP0018, ///< Ignore language flags for shared libs, and adhere to + /// POSITION_INDEPENDENT_CODE property and *_COMPILE_OPTIONS_PI{E,C} + /// instead. /** \brief Always the last entry. * diff --git a/Source/cmProjectCommand.h b/Source/cmProjectCommand.h index 4b051af..88a1944 100644 --- a/Source/cmProjectCommand.h +++ b/Source/cmProjectCommand.h @@ -69,7 +69,7 @@ public: "C++ compiler, you can disable the check for it by explicitly listing " "the languages you want to support, e.g. C. By using the special " "language \"NONE\" all checks for any language can be disabled. " - "If a variable exists called CMAKE_PROJECT_<projectName>_INCLUDE_FILE, " + "If a variable exists called CMAKE_PROJECT_<projectName>_INCLUDE, " "the file pointed to by that variable will be included as the last step " "of the project command."; } diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index ca27530..65ecdf7 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -18,6 +18,7 @@ #include "cmSystemTools.h" #include <cmsys/Terminal.h> +#include <cmsys/ios/sstream> #include <string.h> #if defined(__APPLE__) @@ -244,6 +245,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) bool cmQtAutomoc::Run(const char* targetDirectory) { + bool success = true; cmake cm; cmGlobalGenerator* gg = this->CreateGlobalGenerator(&cm, targetDirectory); cmMakefile* makefile = gg->GetCurrentLocalGenerator()->GetMakefile(); @@ -255,7 +257,7 @@ bool cmQtAutomoc::Run(const char* targetDirectory) if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5") { - this->RunAutomoc(); + success = this->RunAutomoc(); } this->WriteOldMocDefinitionsFile(targetDirectory); @@ -263,7 +265,7 @@ bool cmQtAutomoc::Run(const char* targetDirectory) delete gg; gg = NULL; makefile = NULL; - return true; + return success; } @@ -549,7 +551,7 @@ bool cmQtAutomoc::RunAutomoc() this->GenerateMoc(it->first, it->second); } - std::stringstream outStream(std::stringstream::out); + cmsys_ios::stringstream outStream; outStream << "/* This file is autogenerated, do not edit*/\n"; bool automocCppChanged = false; @@ -577,7 +579,7 @@ bool cmQtAutomoc::RunAutomoc() if (this->RunMocFailed) { - std::cerr << "returning failed.."<< std::endl; + std::cerr << "moc failed..."<< std::endl; return false; } outStream.flush(); @@ -1077,7 +1079,7 @@ bool cmQtAutomoc::EndsWith(const std::string& str, const std::string& with) std::string cmQtAutomoc::ReadAll(const std::string& filename) { std::ifstream file(filename.c_str()); - std::stringstream stream; + cmsys_ios::stringstream stream; stream << file.rdbuf(); file.close(); return stream.str(); diff --git a/Source/cmSetCommand.h b/Source/cmSetCommand.h index 66b129e..2dd80e3 100644 --- a/Source/cmSetCommand.h +++ b/Source/cmSetCommand.h @@ -52,7 +52,7 @@ public: */ virtual const char* GetTerseDocumentation() const { - return "Set a CMAKE variable to a given value."; + return "Set a CMake, cache or environment variable to a given value."; } /** @@ -63,26 +63,37 @@ public: return " set(<variable> <value>\n" " [[CACHE <type> <docstring> [FORCE]] | PARENT_SCOPE])\n" - "Within CMake sets <variable> to the value <value>. <value> is expanded" - " before <variable> is set to it. If CACHE is present, then the " - "<variable> is put in the cache. <type> and <docstring> are then " - "required. <type> is used by the CMake GUI to choose a widget with " - "which the user sets a value. The value for <type> may be one of\n" + "Within CMake sets <variable> to the value <value>. " + "<value> is expanded before <variable> is set to it. " + "Normally, set will set a regular CMake variable. " + "If CACHE is present, then the <variable> is put in the cache " + "instead, unless it is already in the cache. " + "See section 'Variable types in CMake' below for details of " + "regular and cache variables and their interactions. " + "If CACHE is used, <type> and <docstring> are required. <type> is used " + "by the CMake GUI to choose a widget with which the user sets a value. " + "The value for <type> may be one of\n" " FILEPATH = File chooser dialog.\n" " PATH = Directory chooser dialog.\n" " STRING = Arbitrary string.\n" " BOOL = Boolean ON/OFF checkbox.\n" " INTERNAL = No GUI entry (used for persistent variables).\n" - "If <type> is INTERNAL, then the <value> is always written into the " - "cache, replacing any values existing in the cache. If it is not a " - "cache variable, then this always writes into the current makefile. The " - "FORCE option will overwrite the cache value removing any changes by " - "the user.\n" + "If <type> is INTERNAL, the cache variable is marked as internal, " + "and will not be shown to the user in tools like cmake-gui. " + "This is intended for values that should be persisted in the cache, " + "but which users should not normally change. INTERNAL implies FORCE." + "\n" + "Normally, set(...CACHE...) creates cache variables, but does not " + "modify them. " + "If FORCE is specified, the value of the cache variable is set, even " + "if the variable is already in the cache. This should normally be " + "avoided, as it will remove any changes to the cache variable's value " + "by the user.\n" "If PARENT_SCOPE is present, the variable will be set in the scope " "above the current scope. Each new directory or function creates a new " "scope. This command will set the value of a variable into the parent " "directory or calling function (whichever is applicable to the case at " - "hand).\n" + "hand). PARENT_SCOPE cannot be combined with CACHE.\n" "If <value> is not specified then the variable is removed " "instead of set. See also: the unset() command.\n" " set(<variable> <value1> ... <valueN>)\n" @@ -90,7 +101,58 @@ public: "values.\n" "<variable> can be an environment variable such as:\n" " set( ENV{PATH} /home/martink )\n" - "in which case the environment variable will be set."; + "in which case the environment variable will be set.\n" + "*** Variable types in CMake ***\n" + "In CMake there are two types of variables: normal variables and cache " + "variables. Normal variables are meant for the internal use of the " + "script (just like variables in most programming languages); they are " + "not persisted across CMake runs. " + "Cache variables (unless set with INTERNAL) are mostly intended for " + "configuration settings where the first CMake run determines a " + "suitable default value, which the user can then override, by editing " + "the cache with tools such as ccmake or cmake-gui. " + "Cache variables are stored in the CMake cache file, and " + "are persisted across CMake runs. \n" + "Both types can exist at the same time with the same name " + "but different values. " + "When ${FOO} is evaluated, CMake first looks for " + "a normal variable 'FOO' in scope and uses it if set. " + "If and only if no normal variable exists then it falls back to the " + "cache variable 'FOO'.\n" + "Some examples:\n" + "The code 'set(FOO \"x\")' sets the normal variable 'FOO'. It does not " + "touch the cache, but it will hide any existing cache value 'FOO'.\n" + "The code 'set(FOO \"x\" CACHE ...)' checks for 'FOO' in the cache, " + "ignoring any normal variable of the same name. If 'FOO' is in the " + "cache then nothing happens to either the normal variable or the cache " + "variable. If 'FOO' is not in the cache, then it is added to the " + "cache.\n" + "Finally, whenever a cache variable is added or modified by a command, " + "CMake also *removes* the normal variable of the same name from the " + "current scope so that an immediately following evaluation of " + "it will expose the newly cached value.\n" + "Normally projects should avoid using normal and cache variables of " + "the same name, as this interaction can be hard to follow. " + "However, in some situations it can be useful. " + "One example (used by some projects):" + "\n" + "A project has a subproject in its source tree. The child project has " + "its own CMakeLists.txt, which is included from the parent " + "CMakeLists.txt using add_subdirectory(). " + "Now, if the parent and the child project provide the same option " + "(for example a compiler option), the parent gets the first chance " + "to add a user-editable option to the cache. " + "Normally, the child would then use the same value " + "that the parent uses. " + "However, it may be necessary to hard-code the value for the child " + "project's option while still allowing the user to edit the value used " + "by the parent project. The parent project can achieve this simply by " + "setting a normal variable with the same name as the option in a scope " + "sufficient to hide the option's cache variable from the child " + "completely. The parent has already set the cache variable, so the " + "child's set(...CACHE...) will do nothing, and evaluating the option " + "variable will use the value from the normal variable, which hides the " + "cache variable."; } cmTypeMacro(cmSetCommand, cmCommand); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1376a48..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; @@ -1630,33 +1633,28 @@ std::vector<std::string> cmSystemTools::GetEnvironmentVariables() } //---------------------------------------------------------------------- -std::vector<std::string> cmSystemTools::AppendEnv( - std::vector<std::string>* env) +void cmSystemTools::AppendEnv(std::vector<std::string> const& env) { - std::vector<std::string> origEnv = GetEnvironmentVariables(); - - if (env && env->size()>0) + for(std::vector<std::string>::const_iterator eit = env.begin(); + eit != env.end(); ++eit) { - std::vector<std::string>::const_iterator eit; - - for (eit = env->begin(); eit!= env->end(); ++eit) - { - PutEnv(eit->c_str()); - } + cmSystemTools::PutEnv(eit->c_str()); } - - return origEnv; } //---------------------------------------------------------------------- -void cmSystemTools::RestoreEnv(const std::vector<std::string>& env) +cmSystemTools::SaveRestoreEnvironment::SaveRestoreEnvironment() { - std::vector<std::string>::const_iterator eit; + this->Env = cmSystemTools::GetEnvironmentVariables(); +} +//---------------------------------------------------------------------- +cmSystemTools::SaveRestoreEnvironment::~SaveRestoreEnvironment() +{ // First clear everything in the current environment: - // std::vector<std::string> currentEnv = GetEnvironmentVariables(); - for (eit = currentEnv.begin(); eit!= currentEnv.end(); ++eit) + for(std::vector<std::string>::const_iterator + eit = currentEnv.begin(); eit != currentEnv.end(); ++eit) { std::string var(*eit); @@ -1666,27 +1664,11 @@ void cmSystemTools::RestoreEnv(const std::vector<std::string>& env) var = var.substr(0, pos); } - UnsetEnv(var.c_str()); + cmSystemTools::UnsetEnv(var.c_str()); } // Then put back each entry from the original environment: - // - for (eit = env.begin(); eit!= env.end(); ++eit) - { - PutEnv(eit->c_str()); - } -} - -//---------------------------------------------------------------------- -cmSystemTools::SaveRestoreEnvironment::SaveRestoreEnvironment() -{ - this->Env = cmSystemTools::GetEnvironmentVariables(); -} - -//---------------------------------------------------------------------- -cmSystemTools::SaveRestoreEnvironment::~SaveRestoreEnvironment() -{ - cmSystemTools::RestoreEnv(this->Env); + cmSystemTools::AppendEnv(this->Env); } #endif diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 5f21de2..69673c9 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -371,16 +371,8 @@ public: /** Get the list of all environment variables */ static std::vector<std::string> GetEnvironmentVariables(); - /** Append multiple variables to the current environment. - Return the original environment, as it was before the - append. */ - static std::vector<std::string> AppendEnv( - std::vector<std::string>* env); - - /** Restore the full environment to "env" - use after - AppendEnv to put the environment back to the way it - was. */ - static void RestoreEnv(const std::vector<std::string>& env); + /** Append multiple variables to the current environment. */ + static void AppendEnv(std::vector<std::string> const& env); /** Helper class to save and restore the environment. Instantiate this class as an automatic variable on diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index cfa9976..4f3f2c5 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -700,9 +700,9 @@ void cmTarget::DefineProperties(cmake *cm) "Setting this property tells CMake what imported configurations are " "suitable for use when building the <CONFIG> configuration. " "The first configuration in the list found to be provided by the " - "imported target is selected. If no matching configurations are " - "available the imported target is considered to be not found. " - "This property is ignored for non-imported targets.", + "imported target is selected. If this property is set and no matching " + "configurations are available, then the imported target is considered " + "to be not found. This property is ignored for non-imported targets.", false /* TODO: make this chained */ ); cm->DefineProperty @@ -756,6 +756,14 @@ void cmTarget::DefineProperties(cmake *cm) "(such as \"lib\") on a library name."); cm->DefineProperty + ("POSITION_INDEPENDENT_CODE", cmProperty::TARGET, + "Whether to create a position-independent target", + "The POSITION_INDEPENDENT_CODE property determines whether position " + "independent executables or shared libraries will be created. " + "This property is true by default for SHARED and MODULE library " + "targets and false otherwise."); + + cm->DefineProperty ("POST_INSTALL_SCRIPT", cmProperty::TARGET, "Deprecated install support.", "The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the " @@ -823,6 +831,19 @@ void cmTarget::DefineProperties(cmake *cm) "CMAKE_SKIP_BUILD_RPATH if it is set when a target is created."); cm->DefineProperty + ("NO_SONAME", cmProperty::TARGET, + "Whether to set \"soname\" when linking a shared library or module.", + "Enable this boolean property if a generated shared library or module " + "should not have \"soname\" set. Default is to set \"soname\" on all " + "shared libraries and modules as long as the platform supports it. " + "Generally, use this property only for leaf private libraries or " + "plugins. If you use it on normal shared libraries which other targets " + "link against, on some platforms a linker will insert a full path to " + "the library (as specified at link time) into the dynamic section of " + "the dependent binary. Therefore, once installed, dynamic loader may " + "eventually fail to locate the library for the binary."); + + cm->DefineProperty ("SOVERSION", cmProperty::TARGET, "What version number is this target.", "For shared libraries VERSION and SOVERSION can be used to specify " @@ -831,6 +852,7 @@ void cmTarget::DefineProperties(cmake *cm) "supports symlinks and the linker supports so-names. " "If only one of both is specified the missing is assumed to have " "the same version number. " + "SOVERSION is ignored if NO_SONAME property is set. " "For shared libraries and executables on Windows the VERSION " "attribute is parsed to extract a \"major.minor\" version number. " "These numbers are used as the image version of the binary. "); @@ -1291,6 +1313,13 @@ void cmTarget::SetMakefile(cmMakefile* mf) this->SetProperty("INCLUDE_DIRECTORIES", this->Makefile->GetProperty("INCLUDE_DIRECTORIES")); + if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY + || this->TargetTypeValue == cmTarget::MODULE_LIBRARY) + { + this->SetProperty("POSITION_INDEPENDENT_CODE", "True"); + } + this->SetPropertyDefault("POSITION_INDEPENDENT_CODE", 0); + // Record current policies for later use. this->PolicyStatusCMP0003 = this->Makefile->GetPolicyStatus(cmPolicies::CMP0003); @@ -2995,6 +3024,17 @@ std::string cmTarget::GetPDBName(const char* config) } //---------------------------------------------------------------------------- +bool cmTarget::HasSOName(const char* config) +{ + // soname is supported only for shared libraries and modules, + // and then only when the platform supports an soname flag. + return ((this->GetType() == cmTarget::SHARED_LIBRARY || + this->GetType() == cmTarget::MODULE_LIBRARY) && + !this->GetPropertyAsBool("NO_SONAME") && + this->Makefile->GetSONameFlag(this->GetLinkerLanguage(config))); +} + +//---------------------------------------------------------------------------- std::string cmTarget::GetSOName(const char* config) { if(this->IsImported()) @@ -3327,22 +3367,10 @@ void cmTarget::GetLibraryNames(std::string& name, return; } - // Construct the name of the soname flag variable for this language. - const char* ll = this->GetLinkerLanguage(config); - std::string sonameFlag = "CMAKE_SHARED_LIBRARY_SONAME"; - if(ll) - { - sonameFlag += "_"; - sonameFlag += ll; - } - sonameFlag += "_FLAG"; - // Check for library version properties. const char* version = this->GetProperty("VERSION"); const char* soversion = this->GetProperty("SOVERSION"); - if((this->GetType() != cmTarget::SHARED_LIBRARY && - this->GetType() != cmTarget::MODULE_LIBRARY) || - !this->Makefile->GetDefinition(sonameFlag.c_str()) || + if(!this->HasSOName(config) || this->IsFrameworkOnApple()) { // Versioning is supported only for shared libraries and modules, diff --git a/Source/cmTarget.h b/Source/cmTarget.h index d41c827..d70cacd 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -347,6 +347,9 @@ public: /** Get the name of the pdb file for the target. */ std::string GetPDBName(const char* config=0); + /** Whether this library has soname enabled and platform supports it. */ + bool HasSOName(const char* config); + /** Get the soname of the target. Allowed only for a shared library. */ std::string GetSOName(const char* config); 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..9a97ab0 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())) { @@ -490,14 +491,9 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source, std::vector<std::string> *configs = static_cast<cmGlobalVisualStudio7Generator *> (this->GlobalGenerator)->GetConfigurations(); - this->WriteString("<CustomBuild Include=\"", 2); - // custom command have to use relative paths or they do not - // show up in the GUI - std::string path = cmSystemTools::RelativePath( - this->Makefile->GetCurrentOutputDirectory(), - sourcePath.c_str()); - this->ConvertToWindowsSlash(path); - (*this->BuildFileStream ) << path << "\">\n"; + + this->WriteSource("CustomBuild", source, ">\n"); + for(std::vector<std::string>::iterator i = configs->begin(); i != configs->end(); ++i) { @@ -540,6 +536,18 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source, this->WriteString("</CustomBuild>\n", 2); } +std::string +cmVisualStudio10TargetGenerator::ConvertPath(std::string const& path, + bool forceRelative) +{ + return forceRelative + ? cmSystemTools::RelativePath( + this->Makefile->GetCurrentOutputDirectory(), path.c_str()) + : this->LocalGenerator->Convert(path.c_str(), + cmLocalGenerator::START_OUTPUT, + cmLocalGenerator::UNCHANGED); +} + void cmVisualStudio10TargetGenerator::ConvertToWindowsSlash(std::string& s) { // first convert all of the slashes @@ -558,13 +566,6 @@ void cmVisualStudio10TargetGenerator::WriteGroups() std::vector<cmSourceFile*> classes = this->Target->GetSourceFiles(); std::set<cmSourceGroup*> groupsUsed; - std::vector<cmSourceFile*> clCompile; - std::vector<cmSourceFile*> customBuild; - std::vector<cmSourceFile*> none; - std::vector<cmSourceFile*> headers; - std::vector<cmSourceFile*> idls; - std::vector<cmSourceFile*> resource; - for(std::vector<cmSourceFile*>::const_iterator s = classes.begin(); s != classes.end(); s++) { @@ -573,40 +574,6 @@ void cmVisualStudio10TargetGenerator::WriteGroups() cmSourceGroup& sourceGroup = this->Makefile->FindSourceGroup(source.c_str(), sourceGroups); groupsUsed.insert(&sourceGroup); - const char* lang = sf->GetLanguage(); - bool header = (*s)->GetPropertyAsBool("HEADER_FILE_ONLY") - || this->GlobalGenerator->IgnoreFile - ((*s)->GetExtension().c_str()); - std::string ext = - cmSystemTools::LowerCase((*s)->GetExtension()); - if(!lang) - { - lang = "None"; - } - if(header) - { - headers.push_back(sf); - } - else if(lang[0] == 'C') - { - clCompile.push_back(sf); - } - else if(strcmp(lang, "RC") == 0) - { - resource.push_back(sf); - } - else if(sf->GetCustomCommand()) - { - customBuild.push_back(sf); - } - else if(ext == "idl") - { - idls.push_back(sf); - } - else - { - none.push_back(sf); - } } this->AddMissingSourceGroups(groupsUsed, sourceGroups); @@ -628,11 +595,11 @@ void cmVisualStudio10TargetGenerator::WriteGroups() "xmlns=\"http://schemas.microsoft.com/" "developer/msbuild/2003\">\n", 0); - this->WriteGroupSources("ClCompile", clCompile, sourceGroups); - this->WriteGroupSources("ClInclude", headers, sourceGroups); - this->WriteGroupSources("ResourceCompile", resource, sourceGroups); - this->WriteGroupSources("Midl", idls, sourceGroups); - this->WriteGroupSources("CustomBuild", customBuild, sourceGroups); + for(ToolSourceMap::const_iterator ti = this->Tools.begin(); + ti != this->Tools.end(); ++ti) + { + this->WriteGroupSources(ti->first.c_str(), ti->second, sourceGroups); + } // Add object library contents as external objects. std::vector<std::string> objs; @@ -689,7 +656,6 @@ void cmVisualStudio10TargetGenerator::WriteGroups() this->WriteString("</Filter>\n", 2); } this->WriteString("</ItemGroup>\n", 1); - this->WriteGroupSources("None", none, sourceGroups); this->WriteString("</Project>\n", 0); // restore stream pointer this->BuildFileStream = save; @@ -749,32 +715,20 @@ cmVisualStudio10TargetGenerator::AddMissingSourceGroups( void cmVisualStudio10TargetGenerator:: WriteGroupSources(const char* name, - std::vector<cmSourceFile*> const& sources, + ToolSources const& sources, std::vector<cmSourceGroup>& sourceGroups) { this->WriteString("<ItemGroup>\n", 1); - for(std::vector<cmSourceFile*>::const_iterator s = sources.begin(); + for(ToolSources::const_iterator s = sources.begin(); s != sources.end(); ++s) { - cmSourceFile* sf = *s; - if(sf->GetExtension() == "obj") - { - continue; - } + cmSourceFile* sf = s->SourceFile; std::string const& source = sf->GetFullPath(); cmSourceGroup& sourceGroup = this->Makefile->FindSourceGroup(source.c_str(), sourceGroups); const char* filter = sourceGroup.GetFullName(); this->WriteString("<", 2); - std::string path = source; - // custom command sources must use relative paths or they will - // not show up in the GUI. - if(sf->GetCustomCommand()) - { - path = cmSystemTools::RelativePath( - this->Makefile->GetCurrentOutputDirectory(), - source.c_str()); - } + std::string path = this->ConvertPath(source, s->RelativePath); this->ConvertToWindowsSlash(path); (*this->BuildFileStream) << name << " Include=\"" << path; @@ -795,15 +749,47 @@ WriteGroupSources(const char* name, } void cmVisualStudio10TargetGenerator::WriteSource( - const char* tool, cmSourceFile* sf, bool end) + const char* tool, cmSourceFile* sf, const char* end) { - std::string sourceFile = sf->GetFullPath(); - // do not use a relative path here because it means that you - // can not use as long a path to the file. + // Visual Studio tools append relative paths to the current dir, as in: + // + // c:\path\to\current\dir\..\..\..\relative\path\to\source.c + // + // and fail if this exceeds the maximum allowed path length. Our path + // conversion uses full paths outside the build tree to allow deeper trees. + bool forceRelative = false; + std::string sourceFile = this->ConvertPath(sf->GetFullPath(), false); + if(this->LocalGenerator->GetVersion() == cmLocalVisualStudioGenerator::VS10 + && cmSystemTools::FileIsFullPath(sourceFile.c_str())) + { + // Normal path conversion resulted in a full path. VS 10 (but not 11) + // refuses to show the property page in the IDE for a source file with a + // full path (not starting in a '.' or '/' AFAICT). CMake <= 2.8.4 used a + // relative path but to allow deeper build trees CMake 2.8.[5678] used a + // full path except for custom commands. Custom commands do not work + // without a relative path, but they do not seem to be involved in tools + // with the above behavior. For other sources we now use a relative path + // when the combined path will not be too long so property pages appear. + std::string sourceRel = this->ConvertPath(sf->GetFullPath(), true); + size_t const maxLen = 250; + if(sf->GetCustomCommand() || + ((strlen(this->Makefile->GetCurrentOutputDirectory()) + 1 + + sourceRel.length()) <= maxLen)) + { + forceRelative = true; + sourceFile = sourceRel; + } + else + { + this->GlobalGenerator->PathTooLong(this->Target, sf, sourceRel); + } + } this->ConvertToWindowsSlash(sourceFile); this->WriteString("<", 2); (*this->BuildFileStream ) << tool << - " Include=\"" << sourceFile << (end? "\" />\n" : "\" "); + " Include=\"" << sourceFile << "\"" << (end? end : " />\n"); + ToolSource toolSource = {sf, forceRelative}; + this->Tools[tool].push_back(toolSource); } void cmVisualStudio10TargetGenerator::WriteSources( @@ -835,7 +821,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources() bool cl = strcmp(lang, "C") == 0 || strcmp(lang, "CXX") == 0; bool rc = strcmp(lang, "RC") == 0; const char* tool = cl? "ClCompile" : (rc? "ResourceCompile" : "None"); - this->WriteSource(tool, *si, false); + this->WriteSource(tool, *si, " "); // ouput any flags specific to this source file if(cl && this->OutputSourceSpecificFlags(*si)) { diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 20a443b..2d5ec2a 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -43,11 +43,19 @@ public: ); private: + struct ToolSource + { + cmSourceFile* SourceFile; + bool RelativePath; + }; + struct ToolSources: public std::vector<ToolSource> {}; + + std::string ConvertPath(std::string const& path, bool forceRelative); void ConvertToWindowsSlash(std::string& s); void WriteString(const char* line, int indentLevel); void WriteProjectConfigurations(); void WriteProjectConfigurationValues(); - void WriteSource(const char* tool, cmSourceFile* sf, bool end = true); + void WriteSource(const char* tool, cmSourceFile* sf, const char* end = 0); void WriteSources(const char* tool, std::vector<cmSourceFile*> const&); void WriteAllSources(); void WriteDotNetReferences(); @@ -77,8 +85,7 @@ private: void WriteEvents(std::string const& configName); void WriteEvent(const char* name, std::vector<cmCustomCommand> & commands, std::string const& configName); - void WriteGroupSources(const char* name, - std::vector<cmSourceFile*> const& sources, + void WriteGroupSources(const char* name, ToolSources const& sources, std::vector<cmSourceGroup>& ); void AddMissingSourceGroups(std::set<cmSourceGroup*>& groupsUsed, const std::vector<cmSourceGroup>& allGroups); @@ -99,6 +106,9 @@ private: cmGeneratedFileStream* BuildFileStream; cmLocalVisualStudio7Generator* LocalGenerator; std::set<cmSourceFile*> SourcesVisited; + + typedef std::map<cmStdString, ToolSources> ToolSourceMap; + ToolSourceMap Tools; }; #endif diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 846aef5..451aec8 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -70,6 +70,7 @@ # include "cmGlobalVisualStudio10Win64Generator.h" # include "cmGlobalVisualStudio11Generator.h" # include "cmGlobalVisualStudio11Win64Generator.h" +# include "cmGlobalVisualStudio11ARMGenerator.h" # include "cmGlobalVisualStudio8Win64Generator.h" # include "cmGlobalBorlandMakefileGenerator.h" # include "cmGlobalNMakeMakefileGenerator.h" @@ -1698,8 +1699,8 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args) else if (args[1] == "cmake_automoc") { cmQtAutomoc automoc; - automoc.Run(args[2].c_str()); - return 0; + bool automocSuccess = automoc.Run(args[2].c_str()); + return automocSuccess ? 0 : 1; } #endif @@ -2569,6 +2570,8 @@ void cmake::AddDefaultGenerators() &cmGlobalVisualStudio11Generator::New; this->Generators[cmGlobalVisualStudio11Win64Generator::GetActualName()] = &cmGlobalVisualStudio11Win64Generator::New; + this->Generators[cmGlobalVisualStudio11ARMGenerator::GetActualName()] = + &cmGlobalVisualStudio11ARMGenerator::New; this->Generators[cmGlobalVisualStudio71Generator::GetActualName()] = &cmGlobalVisualStudio71Generator::New; this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] = diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index c3de8ca..11a4267 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -9,8 +9,8 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -// include these first, otherwise there will be problems on Windows -// with GetCurrentDirectory() being redefined +// include these first, otherwise there will be problems on Windows +// with GetCurrentDirectory() being redefined #ifdef CMAKE_BUILD_WITH_CMAKE #include "cmDynamicLoader.h" #include "cmDocumentation.h" @@ -183,7 +183,7 @@ static const char * cmDocumentationOptions[][3] = "If a file is specified, the documentation is written into and the output " "format is determined depending on the filename suffix. Supported are man " "page, HTML, DocBook and plain text."}, - {"--help-policy cmp [file]", + {"--help-policy cmp [file]", "Print help for a single policy and exit.", "Full documentation specific to the given policy is displayed." "If a file is specified, the documentation is written into and the output " @@ -194,7 +194,7 @@ static const char * cmDocumentationOptions[][3] = "If a file is specified, the documentation is written into and the output " "format is determined depending on the filename suffix. Supported are man " "page, HTML, DocBook and plain text."}, - {"--help-property prop [file]", + {"--help-property prop [file]", "Print help for a single property and exit.", "Full documentation specific to the given property is displayed." "If a file is specified, the documentation is written into and the output " @@ -212,7 +212,7 @@ static const char * cmDocumentationOptions[][3] = "If a file is specified, the documentation is written into and the output " "format is determined depending on the filename suffix. Supported are man " "page, HTML, DocBook and plain text."}, - {"--help-variable var [file]", + {"--help-variable var [file]", "Print help for a single variable and exit.", "Full documentation specific to the given variable is displayed." "If a file is specified, the documentation is written into and the output " @@ -296,13 +296,13 @@ static std::string cmakemainGetStack(void *clientdata) return msg; } -static void cmakemainErrorCallback(const char* m, const char*, bool&, +static void cmakemainErrorCallback(const char* m, const char*, bool&, void *clientdata) { std::cerr << m << cmakemainGetStack(clientdata) << std::endl << std::flush; } -static void cmakemainProgressCallback(const char *m, float prog, +static void cmakemainProgressCallback(const char *m, float prog, void* clientdata) { cmMakefile* mf = cmakemainGetMakefile(clientdata); @@ -348,7 +348,7 @@ int do_cmake(int ac, char** av) if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 ) { - std::cerr << "Current working directory cannot be established." + std::cerr << "Current working directory cannot be established." << std::endl; nocwd = 1; } @@ -357,13 +357,13 @@ int do_cmake(int ac, char** av) cmDocumentation doc; doc.addCMakeStandardDocSections(); if(doc.CheckOptions(ac, av, "-E") || nocwd) - { + { // Construct and print requested documentation. cmake hcm; hcm.AddCMakePaths(); doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT")); - // the command line args are processed here so that you can do + // the command line args are processed here so that you can do // -DCMAKE_MODULE_PATH=/some/path and have this value accessible here std::vector<std::string> args; for(int i =0; i < ac; ++i) @@ -401,7 +401,7 @@ int do_cmake(int ac, char** av) doc.SetSections(propDocs); cmDocumentationEntry e; - e.Brief = + e.Brief = "variables defined by cmake, that give information about the project, " "and cmake"; doc.PrependSection("Variables that Provide Information",e); @@ -418,7 +418,7 @@ int do_cmake(int ac, char** av) { doc.ClearSections(); doc.SetSection("NOTE", cmDocumentationNOTE); - doc.Print(cmDocumentation::UsageForm, std::cerr); + doc.Print(cmDocumentation::UsageForm, 0, std::cerr); return 1; } return result; @@ -426,13 +426,13 @@ int do_cmake(int ac, char** av) #else if ( nocwd || ac == 1 ) { - std::cout << + std::cout << "Bootstrap CMake should not be used outside CMake build process." << std::endl; return 0; } #endif - + bool wiz = false; bool sysinfo = false; bool command = false; @@ -453,7 +453,7 @@ int do_cmake(int ac, char** av) sysinfo = true; } // if command has already been set, then - // do not eat the -E + // do not eat the -E else if (!command && strcmp(av[i], "-E") == 0) { command = true; @@ -500,7 +500,7 @@ int do_cmake(int ac, char** av) workingMode = cmake::FIND_PACKAGE_MODE; args.push_back(av[i]); } - else + else { args.push_back(av[i]); } @@ -513,15 +513,15 @@ int do_cmake(int ac, char** av) if (wiz) { cmakewizard wizard; - return wizard.RunWizard(args); + return wizard.RunWizard(args); } if (sysinfo) { cmake cm; int ret = cm.GetSystemInformation(args); - return ret; + return ret; } - cmake cm; + cmake cm; cmSystemTools::SetErrorCallback(cmakemainErrorCallback, (void *)&cm); cm.SetProgressCallback(cmakemainProgressCallback, (void *)&cm); cm.SetWorkingMode(workingMode); @@ -529,7 +529,7 @@ int do_cmake(int ac, char** av) int res = cm.Run(args, view_only); if ( list_cached || list_all_cached ) { - cmCacheManager::CacheIterator it = + cmCacheManager::CacheIterator it = cm.GetCacheManager()->GetCacheIterator(); std::cout << "-- Cache values" << std::endl; for ( it.Begin(); !it.IsAtEnd(); it.Next() ) @@ -545,8 +545,8 @@ int do_cmake(int ac, char** av) { std::cout << "// " << it.GetProperty("HELPSTRING") << std::endl; } - std::cout << it.GetName() << ":" << - cmCacheManager::TypeToString(it.GetType()) + std::cout << it.GetName() << ":" << + cmCacheManager::TypeToString(it.GetType()) << "=" << it.GetValue() << std::endl; if ( list_help ) { diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx new file mode 100644 index 0000000..ce64132 --- /dev/null +++ b/Source/cmcldeps.cxx @@ -0,0 +1,279 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +// Wrapper around cl that adds /showIncludes to command line, and uses that to +// generate .d files that match the style from gcc -MD. +// +// /showIncludes is equivalent to -MD, not -MMD, that is, system headers are +// included. + + +#include <windows.h> +#include <sstream> +#include <cmSystemTools.h> + +// We don't want any wildcard expansion. +// See http://msdn.microsoft.com/en-us/library/zay8tzh6(v=vs.85).aspx +void _setargv() {} + +static void Fatal(const char* msg, ...) { + va_list ap; + fprintf(stderr, "ninja: FATAL: "); + va_start(ap, msg); + vfprintf(stderr, msg, ap); + va_end(ap); + fprintf(stderr, "\n"); + // On Windows, some tools may inject extra threads. + // exit() may block on locks held by those threads, so forcibly exit. + fflush(stderr); + fflush(stdout); + ExitProcess(1); +} + +static void usage(const char* msg) { + Fatal("%s\n\nusage:\n " + "cmcldeps " + "<language C, CXX or RC> " + "<source file path> " + "<output path for *.d file> " + "<output path for *.obj file> " + "<prefix of /showIncludes> " + "<path to cl.exe> " + "<path to tool (cl or rc)> " + "<rest of command ...>\n", msg); +} + +static std::string trimLeadingSpace(const std::string& cmdline) { + int i = 0; + for (; cmdline[i] == ' '; ++i) + ; + return cmdline.substr(i); +} + +static void doEscape(std::string& str, const std::string& search, + const std::string& repl) { + std::string::size_type pos = 0; + while ((pos = str.find(search, pos)) != std::string::npos) { + str.replace(pos, search.size(), repl); + pos += repl.size(); + } +} + +// Strips one argument from the cmdline and returns it. "surrounding quotes" +// are removed from the argument if there were any. +static std::string getArg(std::string& cmdline) { + std::string ret; + bool in_quoted = false; + unsigned int i = 0; + + cmdline = trimLeadingSpace(cmdline); + + for (;; ++i) { + if (i >= cmdline.size()) + usage("Couldn't parse arguments."); + if (!in_quoted && cmdline[i] == ' ') + break; // "a b" "x y" + if (cmdline[i] == '"') + in_quoted = !in_quoted; + } + + ret = cmdline.substr(0, i); + if (ret[0] == '"' && ret[i - 1] == '"') + ret = ret.substr(1, ret.size() - 2); + cmdline = cmdline.substr(i); + return ret; +} + +static void parseCommandLine(LPTSTR wincmdline, + std::string& lang, + std::string& srcfile, + std::string& dfile, + std::string& objfile, + std::string& prefix, + std::string& clpath, + std::string& binpath, + std::string& rest) { + std::string cmdline(wincmdline); + /* self */ getArg(cmdline); + lang = getArg(cmdline); + srcfile = getArg(cmdline); + dfile = getArg(cmdline); + objfile = getArg(cmdline); + prefix = getArg(cmdline); + clpath = getArg(cmdline); + binpath = getArg(cmdline); + rest = trimLeadingSpace(cmdline); +} + +static void outputDepFile(const std::string& dfile, const std::string& objfile, + std::vector<std::string>& incs) { + + if (dfile.empty()) + return; + + // strip duplicates + std::sort(incs.begin(), incs.end()); + incs.erase(std::unique(incs.begin(), incs.end()), incs.end()); + + FILE* out = fopen(dfile.c_str(), "wb"); + + // FIXME should this be fatal or not? delete obj? delete d? + if (!out) + return; + + std::string tmp = objfile; + doEscape(tmp, " ", "\\ "); + fprintf(out, "%s: \\\n", tmp.c_str()); + + std::vector<std::string>::iterator it = incs.begin(); + for (; it != incs.end(); ++it) { + tmp = *it; + doEscape(tmp, "\\", "/"); + doEscape(tmp, " ", "\\ "); + fprintf(out, "%s \\\n", tmp.c_str()); + } + + fprintf(out, "\n"); + fclose(out); +} + + +bool startsWith(const std::string& str, const std::string& what) { + return str.compare(0, what.size(), what) == 0; +} + +bool contains(const std::string& str, const std::string& what) { + return str.find(what) != std::string::npos; +} + +std::string replace(const std::string& str, const std::string& what, + const std::string& replacement) { + size_t pos = str.find(what); + if (pos == std::string::npos) + return str; + std::string replaced = str; + return replaced.replace(pos, what.size(), replacement); +} + + + +static int process( const std::string& srcfilename, + const std::string& dfile, + const std::string& objfile, + const std::string& prefix, + const std::string& cmd, + const std::string& dir = "", + bool quiet = false) +{ + std::string output; + // break up command line into a vector + std::vector<std::string> args; + cmSystemTools::ParseWindowsCommandLine(cmd.c_str(), args); + // convert to correct vector type for RunSingleCommand + std::vector<cmStdString> command; + for(std::vector<std::string>::iterator i = args.begin(); + i != args.end(); ++i) + { + command.push_back(i->c_str()); + } + // run the command + int exit_code = 0; + bool run = cmSystemTools::RunSingleCommand(command, &output, &exit_code, + dir.c_str(), cmSystemTools::OUTPUT_NONE); + + // process the include directives and output everything else + std::stringstream ss(output); + std::string line; + std::vector<std::string> includes; + bool isFirstLine = true; // cl prints always first the source filename + while (std::getline(ss, line)) { + if (startsWith(line, prefix)) { + std::string inc = trimLeadingSpace(line.substr(prefix.size()).c_str()); + if (inc[inc.size() - 1] == '\r') // blech, stupid \r\n + inc = inc.substr(0, inc.size() - 1); + includes.push_back(inc); + } else { + if (!isFirstLine || !startsWith(line, srcfilename)) { + if (!quiet) { + fprintf(stdout, "%s\n", line.c_str()); + } + } else { + isFirstLine = false; + } + } + } + + // don't update .d until/unless we succeed compilation + if (run && exit_code == 0) + outputDepFile(dfile, objfile, includes); + + return exit_code; +} + + +int main() { + + // Use the Win32 api instead of argc/argv so we can avoid interpreting the + // rest of command line after the .d and .obj. Custom parsing seemed + // preferable to the ugliness you get into in trying to re-escape quotes for + // subprocesses, so by avoiding argc/argv, the subprocess is called with + // the same command line verbatim. + + std::string lang, srcfile, dfile, objfile, prefix, cl, binpath, rest; + parseCommandLine(GetCommandLine(), lang, srcfile, dfile, objfile, + prefix, cl, binpath, rest); + + // needed to suppress filename output of msvc tools + std::string srcfilename; + std::string::size_type pos = srcfile.rfind("\\"); + if (pos != std::string::npos) { + srcfilename = srcfile.substr(pos + 1); + } + + std::string nol = " /nologo "; + std::string show = " /showIncludes "; + if (lang == "C" || lang == "CXX") { + return process(srcfilename, dfile, objfile, prefix, + binpath + nol + show + rest); + } else if (lang == "RC") { + // "misuse" cl.exe to get headers from .rc files + + std::string clrest = rest; + // rc: /fo x.dir\x.rc.res -> cl: /out:x.dir\x.rc.res.dep.obj + clrest = replace(clrest, "/fo", "/out:"); + clrest = replace(clrest, objfile, objfile + ".dep.obj "); + // rc: src\x\x.rc -> cl: /Tc src\x\x.rc + clrest = replace(clrest, srcfile, "/Tc " + srcfile); + + cl = "\"" + cl + "\" /P /DRC_INVOKED "; + + // call cl in object dir so the .i is generated there + std::string objdir; + std::string::size_type pos = objfile.rfind("\\"); + if (pos != std::string::npos) { + objdir = objfile.substr(0, pos); + } + + // extract dependencies with cl.exe + process(srcfilename, dfile, objfile, + prefix, cl + nol + show + clrest, objdir, true); + + // compile rc file with rc.exe + return process(srcfilename, "" , objfile, prefix, binpath + " " + rest); + } + + usage("Invalid language specified."); + return 1; +} diff --git a/Source/ctest.cxx b/Source/ctest.cxx index d41627e..d650777 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -103,6 +103,12 @@ static const char * cmDocumentationOptions[][3] = "a dashboard test. All tests are <Mode><Test>, where Mode can be " "Experimental, Nightly, and Continuous, and Test can be Start, Update, " "Configure, Build, Test, Coverage, and Submit."}, + {"-D <var>:<type>=<value>", "Define a variable for script mode", + "Pass in variable values on the command line. Use in " + "conjunction with -S to pass variable values to a dashboard script. " + "Parsing -D arguments as variable values is only attempted if " + "the value following -D does not match any of the known dashboard " + "types."}, {"-M <model>, --test-model <model>", "Sets the model for a dashboard", "This option tells ctest to act as a Dart client " "where the TestModel can be Experimental, " diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 0ef4e28..a132357 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) @@ -142,7 +141,6 @@ IF(KWSYS_USE_Process) SET(KWSYS_USE_System 1) ENDIF(KWSYS_USE_Process) IF(KWSYS_USE_SystemInformation) - SET(KWSYS_USE_FundamentalType 1) SET(KWSYS_USE_Process 1) ENDIF(KWSYS_USE_SystemInformation) @@ -414,6 +412,39 @@ IF(UNIX) "Checking whether struct stat has st_mtim member" DIRECT) ENDIF(UNIX) +# Check existence and uniqueness of long long and __int64. +KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_LONG_LONG + "Checking whether C++ compiler has 'long long'" DIRECT) +KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS___INT64 + "Checking whether C++ compiler has '__int64'" DIRECT) +IF(KWSYS_CXX_HAS___INT64) + KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_SAME_LONG_AND___INT64 + "Checking whether long and __int64 are the same type" DIRECT) + IF(KWSYS_CXX_HAS_LONG_LONG) + KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_SAME_LONG_LONG_AND___INT64 + "Checking whether long long and __int64 are the same type" DIRECT) + ENDIF() +ENDIF() + +# Enable the "long long" type if it is available. It is standard in +# C99 and C++03 but not in earlier standards. +IF(KWSYS_CXX_HAS_LONG_LONG) + SET(KWSYS_USE_LONG_LONG 1) +ELSE() + SET(KWSYS_USE_LONG_LONG 0) +ENDIF() + +# Enable the "__int64" type if it is available and unique. It is not +# standard. +SET(KWSYS_USE___INT64 0) +IF(KWSYS_CXX_HAS___INT64) + IF(NOT KWSYS_CXX_SAME_LONG_AND___INT64) + IF(NOT KWSYS_CXX_SAME_LONG_LONG_AND___INT64) + SET(KWSYS_USE___INT64 1) + ENDIF() + ENDIF() +ENDIF() + IF(KWSYS_USE_FundamentalType) # Look for type size helper macros. KWSYS_PLATFORM_INFO_TEST(C KWSYS_C_TYPE_MACROS @@ -464,34 +495,6 @@ IF(KWSYS_USE_FundamentalType) ENDIF() ENDFOREACH() - # Check uniqueness of types. - IF(KWSYS_SIZEOF___INT64) - KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_SAME_LONG_AND___INT64 - "Checking whether long and __int64 are the same type" DIRECT) - IF(KWSYS_SIZEOF_LONG_LONG) - KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_SAME_LONG_LONG_AND___INT64 - "Checking whether long long and __int64 are the same type" DIRECT) - ENDIF(KWSYS_SIZEOF_LONG_LONG) - ENDIF(KWSYS_SIZEOF___INT64) - - # Enable the "long long" type if it is available. It is standard in - # C99 and C++03 but not in earlier standards. - IF(KWSYS_SIZEOF_LONG_LONG) - SET(KWSYS_USE_LONG_LONG 1) - ELSE(KWSYS_SIZEOF_LONG_LONG) - SET(KWSYS_USE_LONG_LONG 0) - ENDIF(KWSYS_SIZEOF_LONG_LONG) - - # Enable the "__int64" type if it is available and unique. It is not - # standard. - SET(KWSYS_USE___INT64 0) - IF(KWSYS_SIZEOF___INT64) - IF(NOT KWSYS_CXX_SAME_LONG_AND___INT64) - IF(NOT KWSYS_CXX_SAME_LONG_LONG_AND___INT64) - SET(KWSYS_USE___INT64 1) - ENDIF(NOT KWSYS_CXX_SAME_LONG_LONG_AND___INT64) - ENDIF(NOT KWSYS_CXX_SAME_LONG_AND___INT64) - ENDIF(KWSYS_SIZEOF___INT64) IF(KWSYS_USE___INT64) KWSYS_PLATFORM_CXX_TEST(KWSYS_CAN_CONVERT_UI64_TO_DOUBLE "Checking whether unsigned __int64 can convert to double" DIRECT) @@ -506,8 +509,6 @@ ENDIF(KWSYS_USE_FundamentalType) IF(KWSYS_USE_IOStream) # Determine whether iostreams support long long. - KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_LONG_LONG - "Checking whether C++ compiler has 'long long'" DIRECT) IF(KWSYS_CXX_HAS_LONG_LONG) SET(KWSYS_PLATFORM_CXX_TEST_DEFINES -DKWSYS_IOS_USE_ANSI=${KWSYS_IOS_USE_ANSI} @@ -553,11 +554,22 @@ SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c System.c PROPERTIES COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}" ) -IF(KWSYS_DO_NOT_CLEAN_PUTENV) - # Disable cleanup of putenv memory for issues with GCOV. +IF(KWSYS_USE_SystemTools) + KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_SETENV + "Checking whether CXX compiler has setenv" DIRECT) + KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UNSETENV + "Checking whether CXX compiler has unsetenv" DIRECT) + KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H + "Checking whether CXX compiler has environ in stdlib.h" DIRECT) SET_SOURCE_FILES_PROPERTIES(SystemTools.cxx PROPERTIES - COMPILE_FLAGS -DKWSYS_DO_NOT_CLEAN_PUTENV=1) -ENDIF(KWSYS_DO_NOT_CLEAN_PUTENV) + COMPILE_FLAGS "-DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV} -DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV} -DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}") +ENDIF() + +IF(KWSYS_USE_SystemInformation) + SET_PROPERTY(SOURCE SystemInformation.cxx PROPERTY + COMPILE_DEFINITIONS KWSYS_USE_LONG_LONG=${KWSYS_USE_LONG_LONG} + KWSYS_USE___INT64=${KWSYS_USE___INT64}) +ENDIF() #----------------------------------------------------------------------------- # Choose a directory for the generated headers. @@ -690,7 +702,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/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index d49c0d7..e1ee873 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -26,7 +26,6 @@ // http://msdn.microsoft.com/en-us/library/ms683219(VS.85).aspx #include "kwsysPrivate.h" -#include KWSYS_HEADER(FundamentalType.h) #include KWSYS_HEADER(stl/string) #include KWSYS_HEADER(stl/vector) #include KWSYS_HEADER(ios/iosfwd) @@ -38,7 +37,6 @@ // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. #if 0 -# include "FundamentalType.h.in" # include "SystemInformation.hxx.in" # include "Process.h.in" # include "Configure.hxx.in" diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 4d83293..66850e9 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -25,6 +25,8 @@ #include KWSYS_HEADER(ios/fstream) #include KWSYS_HEADER(ios/sstream) +#include KWSYS_HEADER(stl/set) + // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. #if 0 @@ -78,6 +80,10 @@ # undef _WIN32 #endif +#if !KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H +extern char **environ; +#endif + #ifdef __CYGWIN__ extern "C" void cygwin_conv_to_win32_path(const char *path, char *win32_path); #endif @@ -371,38 +377,224 @@ bool SystemTools::GetEnv(const char* key, kwsys_stl::string& result) } } -#ifdef __INTEL_COMPILER -#pragma warning disable 444 +//---------------------------------------------------------------------------- + +#if defined(__CYGWIN__) || defined(__GLIBC__) +# define KWSYS_PUTENV_NAME /* putenv("A") removes A. */ +#elif defined(_WIN32) +# define KWSYS_PUTENV_EMPTY /* putenv("A=") removes A. */ #endif -class kwsysDeletingCharVector : public kwsys_stl::vector<char*> +#if KWSYS_CXX_HAS_UNSETENV +/* unsetenv("A") removes A from the environment. + On older platforms it returns void instead of int. */ +static int kwsysUnPutEnv(const char* env) { -public: - ~kwsysDeletingCharVector(); -}; + if(const char* eq = strchr(env, '=')) + { + std::string name(env, eq-env); + unsetenv(name.c_str()); + } + else + { + unsetenv(env); + } + return 0; +} -kwsysDeletingCharVector::~kwsysDeletingCharVector() +#elif defined(KWSYS_PUTENV_EMPTY) || defined(KWSYS_PUTENV_NAME) +/* putenv("A=") or putenv("A") removes A from the environment. */ +static int kwsysUnPutEnv(const char* env) { -#ifndef KWSYS_DO_NOT_CLEAN_PUTENV - for(kwsys_stl::vector<char*>::iterator i = this->begin(); - i != this->end(); ++i) + int err = 0; + const char* eq = strchr(env, '='); + size_t const len = eq? (size_t)(eq-env) : strlen(env); +# ifdef KWSYS_PUTENV_EMPTY + size_t const sz = len + 2; +# else + size_t const sz = len + 1; +# endif + char local_buf[256]; + char* buf = sz > sizeof(local_buf) ? (char*)malloc(sz) : local_buf; + if(!buf) + { + return -1; + } + strncpy(buf, env, len); +# ifdef KWSYS_PUTENV_EMPTY + buf[len] = '='; + buf[len+1] = 0; + if(putenv(buf) < 0) + { + err = errno; + } +# else + buf[len] = 0; + if(putenv(buf) < 0 && errno != EINVAL) + { + err = errno; + } +# endif + if(buf != local_buf) { - delete []*i; + free(buf); } + if(err) + { + errno = err; + return -1; + } + return 0; +} + +#else +/* Manipulate the "environ" global directly. */ +static int kwsysUnPutEnv(const char* env) +{ + const char* eq = strchr(env, '='); + size_t const len = eq? (size_t)(eq-env) : strlen(env); + int in = 0; + int out = 0; + while(environ[in]) + { + if(strlen(environ[in]) > len && + environ[in][len] == '=' && + strncmp(env, environ[in], len) == 0) + { + ++in; + } + else + { + environ[out++] = environ[in++]; + } + } + while(out < in) + { + environ[out++] = 0; + } + return 0; +} #endif + +//---------------------------------------------------------------------------- + +#if KWSYS_CXX_HAS_SETENV + +/* setenv("A", "B", 1) will set A=B in the environment and makes its + own copies of the strings. */ +bool SystemTools::PutEnv(const char* env) +{ + if(const char* eq = strchr(env, '=')) + { + std::string name(env, eq-env); + return setenv(name.c_str(), eq+1, 1) == 0; + } + else + { + return kwsysUnPutEnv(env) == 0; + } +} + +bool SystemTools::UnPutEnv(const char* env) +{ + return kwsysUnPutEnv(env) == 0; +} + +#else + +/* putenv("A=B") will set A=B in the environment. Most putenv implementations + put their argument directly in the environment. They never free the memory + on program exit. Keep an active set of pointers to memory we allocate and + pass to putenv, one per environment key. At program exit remove any + environment values that may still reference memory we allocated. Then free + the memory. This will not affect any environment values we never set. */ + +# ifdef __INTEL_COMPILER +# pragma warning disable 444 /* base has non-virtual destructor */ +# endif + +/* Order by environment key only (VAR from VAR=VALUE). */ +struct kwsysEnvCompare +{ + bool operator() (const char* l, const char* r) const + { + const char* leq = strchr(l, '='); + const char* req = strchr(r, '='); + size_t llen = leq? (leq-l) : strlen(l); + size_t rlen = req? (req-r) : strlen(r); + if(llen == rlen) + { + return strncmp(l,r,llen) < 0; + } + else + { + return strcmp(l,r) < 0; + } + } +}; + +class kwsysEnv: public kwsys_stl::set<const char*, kwsysEnvCompare> +{ + class Free + { + const char* Env; + public: + Free(const char* env): Env(env) {} + ~Free() { free(const_cast<char*>(this->Env)); } + }; +public: + typedef kwsys_stl::set<const char*, kwsysEnvCompare> derived; + ~kwsysEnv() + { + for(derived::iterator i = this->begin(); i != this->end(); ++i) + { + kwsysUnPutEnv(*i); + free(const_cast<char*>(*i)); + } + } + const char* Release(const char* env) + { + const char* old = 0; + derived::iterator i = this->find(env); + if(i != this->end()) + { + old = *i; + this->erase(i); + } + return old; + } + bool Put(const char* env) + { + Free oldEnv(this->Release(env)); + static_cast<void>(oldEnv); + char* newEnv = strdup(env); + this->insert(newEnv); + return putenv(newEnv) == 0; + } + bool UnPut(const char* env) + { + Free oldEnv(this->Release(env)); + static_cast<void>(oldEnv); + return kwsysUnPutEnv(env) == 0; + } +}; + +static kwsysEnv kwsysEnvInstance; + +bool SystemTools::PutEnv(const char* env) +{ + return kwsysEnvInstance.Put(env); } -bool SystemTools::PutEnv(const char* value) + +bool SystemTools::UnPutEnv(const char* env) { - static kwsysDeletingCharVector localEnvironment; - char* envVar = new char[strlen(value)+1]; - strcpy(envVar, value); - int ret = putenv(envVar); - // save the pointer in the static vector so that it can - // be deleted on exit - localEnvironment.push_back(envVar); - return ret == 0; + return kwsysEnvInstance.UnPut(env); } +#endif + +//---------------------------------------------------------------------------- + const char* SystemTools::GetExecutableExtension() { #if defined(_WIN32) || defined(__CYGWIN__) || defined(__VMS) diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in index 04f1978..5171125 100644 --- a/Source/kwsys/SystemTools.hxx.in +++ b/Source/kwsys/SystemTools.hxx.in @@ -749,7 +749,11 @@ public: /** Put a string into the environment of the form var=value */ - static bool PutEnv(const char* value); + static bool PutEnv(const char* env); + + /** Remove a string from the environment. + Input is of the form "var" or "var=value" (value is ignored). */ + static bool UnPutEnv(const char* env); /** * Get current working directory CWD diff --git a/Source/kwsys/hash_fun.hxx.in b/Source/kwsys/hash_fun.hxx.in index 8c5eb6a..6f787dd 100644 --- a/Source/kwsys/hash_fun.hxx.in +++ b/Source/kwsys/hash_fun.hxx.in @@ -38,7 +38,6 @@ #define @KWSYS_NAMESPACE@_hash_fun_hxx #include <@KWSYS_NAMESPACE@/Configure.hxx> -#include <@KWSYS_NAMESPACE@/FundamentalType.h> #include <@KWSYS_NAMESPACE@/cstddef> // size_t #include <@KWSYS_NAMESPACE@/stl/string> // string @@ -124,7 +123,7 @@ struct hash<unsigned long> { }; // use long long or __int64 -#if @KWSYS_NAMESPACE@_USE_LONG_LONG +#if @KWSYS_USE_LONG_LONG@ @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION struct hash<long long> { size_t operator()(long long __x) const { return __x; } @@ -134,7 +133,7 @@ struct hash<long long> { struct hash<unsigned long long> { size_t operator()(unsigned long long __x) const { return __x; } }; -#elif @KWSYS_NAMESPACE@_USE___INT64 +#elif @KWSYS_USE___INT64@ @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION struct hash<__int64> { size_t operator()(__int64 __x) const { return __x; } diff --git a/Source/kwsys/hashtable.hxx.in b/Source/kwsys/hashtable.hxx.in index db52fc8..c835503 100644 --- a/Source/kwsys/hashtable.hxx.in +++ b/Source/kwsys/hashtable.hxx.in @@ -394,7 +394,7 @@ enum { _stl_num_primes = 31 }; // create a function with a static local to that function that returns // the static -inline const unsigned long* get_stl_prime_list() { +static inline const unsigned long* get_stl_prime_list() { static const unsigned long _stl_prime_list[_stl_num_primes] = { diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake deleted file mode 100644 index f157607..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 18) 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/Source/kwsys/kwsysPlatformTestsCXX.cxx b/Source/kwsys/kwsysPlatformTestsCXX.cxx index 903be9b..7b73d06 100644 --- a/Source/kwsys/kwsysPlatformTestsCXX.cxx +++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx @@ -122,6 +122,15 @@ int main() } #endif +#ifdef TEST_KWSYS_CXX_HAS___INT64 +__int64 f(__int64 n) { return n; } +int main() +{ + __int64 n = 0; + return static_cast<int>(f(n)); +} +#endif + #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template <class T> class A; template <class T> int f(A<T>&); @@ -393,6 +402,32 @@ int main(int, char **argv) } #endif +#ifdef TEST_KWSYS_CXX_HAS_SETENV +#include <stdlib.h> +int main() +{ + return setenv("A", "B", 1); +} +#endif + +#ifdef TEST_KWSYS_CXX_HAS_UNSETENV +#include <stdlib.h> +int main() +{ + unsetenv("A"); + return 0; +} +#endif + +#ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H +#include <stdlib.h> +int main() +{ + char* e = environ[0]; + return e? 0:1; +} +#endif + #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx index c0e74af..3ac0cb3 100644 --- a/Source/kwsys/testSystemTools.cxx +++ b/Source/kwsys/testSystemTools.cxx @@ -328,6 +328,58 @@ bool CheckStringOperations() } //---------------------------------------------------------------------------- + +bool CheckPutEnv(const char* env, const char* name, const char* value) +{ + if(!kwsys::SystemTools::PutEnv(env)) + { + kwsys_ios::cerr << "PutEnv(\"" << env + << "\") failed!" << kwsys_ios::endl; + return false; + } + const char* v = kwsys::SystemTools::GetEnv(name); + v = v? v : "(null)"; + if(strcmp(v, value) != 0) + { + kwsys_ios::cerr << "GetEnv(\"" << name << "\") returned \"" + << v << "\", not \"" << value << "\"!" << kwsys_ios::endl; + return false; + } + return true; +} + +bool CheckUnPutEnv(const char* env, const char* name) +{ + if(!kwsys::SystemTools::UnPutEnv(env)) + { + kwsys_ios::cerr << "UnPutEnv(\"" << env << "\") failed!" + << kwsys_ios::endl; + return false; + } + if(const char* v = kwsys::SystemTools::GetEnv(name)) + { + kwsys_ios::cerr << "GetEnv(\"" << name << "\") returned \"" + << v << "\", not (null)!" << kwsys_ios::endl; + return false; + } + return true; +} + +bool CheckEnvironmentOperations() +{ + bool res = true; + res &= CheckPutEnv("A=B", "A", "B"); + res &= CheckPutEnv("B=C", "B", "C"); + res &= CheckPutEnv("C=D", "C", "D"); + res &= CheckPutEnv("D=E", "D", "E"); + res &= CheckUnPutEnv("A", "A"); + res &= CheckUnPutEnv("B=", "B"); + res &= CheckUnPutEnv("C=D", "C"); + /* Leave "D=E" in environment so a memory checker can test for leaks. */ + return res; +} + +//---------------------------------------------------------------------------- int testSystemTools(int, char*[]) { bool res = true; @@ -356,5 +408,7 @@ int testSystemTools(int, char*[]) res &= CheckStringOperations(); + res &= CheckEnvironmentOperations(); + return res ? 0 : 1; } diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt index ad27e57..456e496 100644 --- a/Tests/Assembler/CMakeLists.txt +++ b/Tests/Assembler/CMakeLists.txt @@ -23,6 +23,7 @@ endif("${CMAKE_GENERATOR}" MATCHES "Makefile") if(SRCS) + set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS}") enable_language(ASM OPTIONAL) else(SRCS) message(STATUS "No assembler enabled, using C") diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index aa32d67..5e36d11 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -28,6 +28,10 @@ function(help_xcode_depends) endif(HELP_XCODE) endfunction(help_xcode_depends) +if("${CMAKE_GENERATOR}" MATCHES "Ninja") + set(HELP_NINJA 1) # TODO Why is this needed? +endif() + # The Intel compiler causes the MSVC linker to crash during # incremental linking, so avoid the /INCREMENTAL:YES flag. if(WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel") @@ -154,7 +158,7 @@ try_compile(RESULT OUTPUT_VARIABLE OUTPUT) # Xcode is in serious need of help here -if(HELP_XCODE) +if(HELP_XCODE OR HELP_NINJA) try_compile(RESULT ${BuildDepends_BINARY_DIR}/Project ${BuildDepends_SOURCE_DIR}/Project @@ -165,7 +169,7 @@ if(HELP_XCODE) ${BuildDepends_SOURCE_DIR}/Project testRebuild OUTPUT_VARIABLE OUTPUT) -endif(HELP_XCODE) +endif() message("Output from second build:\n${OUTPUT}") if(NOT RESULT) diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index 3f141c5..dc1ce24 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -35,7 +35,7 @@ private: void ParseTranslationUnits() { this->TranslationUnits = TranslationUnitsType(); - ExpectOrDie('[', "at start of compile command file"); + ExpectOrDie('[', "at start of compile command file\n"); do { ParseTranslationUnit(); @@ -63,12 +63,12 @@ private: void ParseString() { - this->String.clear(); + this->String = ""; if(!Expect('"')) return; while (!Expect('"')) { Expect('\\'); - this->String.push_back(C); + this->String.append(1,C); Next(); } } diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index c0b7cd6..300ab09 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -47,7 +47,7 @@ CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in # Testing IF(BUILD_TESTING) - IF("${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles") + IF("${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles" OR ("${CMAKE_TEST_GENERATOR}" MATCHES Ninja AND NOT WIN32)) SET(TEST_CompileCommandOutput 1) ENDIF() @@ -315,6 +315,24 @@ IF(BUILD_TESTING) ADD_TEST_MACRO(Module.GenerateExportHeader GenerateExportHeader) + if (APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") + include(CheckCXXCompilerFlag) + check_cxx_compiler_flag(-fPIE run_pic_test) + else() + if (CMAKE_CXX_COMPILER_ID MATCHES "PGI" + OR CMAKE_CXX_COMPILER_ID MATCHES "PathScale" + OR CMAKE_SYSTEM_NAME MATCHES "IRIX64" + OR CMAKE_CXX_COMPILER_ID MATCHES "Intel") + set(run_pic_test 0) + else() + set(run_pic_test 1) + endif() + endif() + + if (run_pic_test) + ADD_TEST_MACRO(PositionIndependentTargets PositionIndependentTargets) + endif() + ADD_TEST(LinkFlags-prepare ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} --build-and-test @@ -699,6 +717,31 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ENDIF(CTEST_RUN_CPackComponents) IF(CTEST_RUN_CPackComponentsForAll) + # Analyze 'cpack --help' output for list of available generators: + execute_process(COMMAND ${CMAKE_CPACK_COMMAND} --help + RESULT_VARIABLE result + OUTPUT_VARIABLE stdout + ERROR_VARIABLE stderr) + + string(REPLACE ";" "\\;" stdout "${stdout}") + string(REPLACE "\n" "E;" stdout "${stdout}") + + set(collecting 0) + set(ACTIVE_CPACK_GENERATORS) + foreach(eline ${stdout}) + string(REGEX REPLACE "^(.*)E$" "\\1" line "${eline}") + if(collecting AND NOT line STREQUAL "") + string(REGEX REPLACE "^ ([^ ]+) += (.*)$" "\\1" gen "${line}") + string(REGEX REPLACE "^ ([^ ]+) += (.*)$" "\\2" doc "${line}") + list(APPEND ACTIVE_CPACK_GENERATORS ${gen}) + endif() + if(line STREQUAL "Generators") + set(collecting 1) + endif() + endforeach() + # ACTIVE_CPACK_GENERATORS variable + # now contains the list of 'active generators' + set(CPackComponentsForAll_EXTRA_OPTIONS) set(CPackRun_CPackCommand "-DCPackCommand=${CMAKE_CPACK_COMMAND}") # set up list of CPack generators @@ -706,18 +749,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(APPLE) list(APPEND GENLST "DragNDrop") endif(APPLE) - if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") - find_program(RPMBUILD NAMES rpmbuild) - endif(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") - if (RPMBUILD) - list(APPEND GENLST "RPM") - endif(RPMBUILD) - if (CMAKE_SYSTEM_NAME MATCHES "Linux") - find_program(DPKG NAMES dpkg) - if (DPKG) - list(APPEND GENLST "DEB") - endif(DPKG) - endif(CMAKE_SYSTEM_NAME MATCHES "Linux") + if (NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") + list(FIND ACTIVE_CPACK_GENERATORS "RPM" RPM_ACTIVE) + if (NOT ${RPM_ACTIVE} EQUAL -1) + list(APPEND GENLST "RPM") + endif(NOT ${RPM_ACTIVE} EQUAL -1) + endif(NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") + list(FIND ACTIVE_CPACK_GENERATORS "DEB" DEB_ACTIVE) + if (NOT ${DEB_ACTIVE} EQUAL -1) + list(APPEND GENLST "DEB") + endif(NOT ${DEB_ACTIVE} EQUAL -1) + # set up list of component packaging ways list(APPEND CWAYLST "default") list(APPEND CWAYLST "OnePackPerGroup") @@ -1708,6 +1750,42 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ PASS_REGULAR_EXPRESSION "Reading ctest configuration file: ${CTEST_TEST_ESCAPED_BINARY_DIR}.Tests.CTestTestConfigFileInBuildDir2.CTestConfig.cmake") + # test coverage for mumps + # create a MumpsCoverage dir in the binary tree under Testing to + # avoid the .NoDartCoverage files in the cmake testing tree + configure_file( + "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/DartConfiguration.tcl.in" + "${CMake_BINARY_DIR}/Testing/MumpsCoverage/DartConfiguration.tcl") + configure_file( + "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/gtm_coverage.mcov.in" + "${CMake_BINARY_DIR}/Testing/MumpsCoverage/gtm_coverage.mcov") + file(COPY "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/VistA-FOIA" + DESTINATION "${CMake_BINARY_DIR}/Testing/MumpsCoverage") + add_test(NAME CTestGTMCoverage + COMMAND cmake -E chdir + ${CMake_BINARY_DIR}/Testing/MumpsCoverage + $<TARGET_FILE:ctest> -T Coverage --debug) + set_tests_properties(CTestGTMCoverage PROPERTIES + PASS_REGULAR_EXPRESSION + "Process file.*XINDEX.m.*Total LOC:.*127.*Percentage Coverage: 85.83.*" + ENVIRONMENT COVFILE=) + + configure_file( + "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/DartConfiguration.cache.tcl.in" + "${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage/DartConfiguration.tcl") + configure_file( + "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/cache_coverage.cmcov.in" + "${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage/cache_coverage.cmcov") + file(COPY "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/VistA-FOIA" + DESTINATION "${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage") + add_test(NAME CTestCacheCoverage + COMMAND cmake -E chdir + ${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage + $<TARGET_FILE:ctest> -T Coverage --debug) + set_tests_properties(CTestCacheCoverage PROPERTIES + PASS_REGULAR_EXPRESSION + "Process file.*XINDEX.m.*Total LOC:.*125.*Percentage Coverage: 85.60.*" + ENVIRONMENT COVFILE=) # Use macro, not function so that build can still be driven by CMake 2.4. # After 2.6 is required, this could be a function without the extra 'set' # calls. @@ -1744,6 +1822,19 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ add_config_tests(Release) add_config_tests(RelWithDebInfo) + # Test -S script with some -D variable definition args to ctest: + add_test(CTestConfig.ScriptWithArgs ${CMAKE_CTEST_COMMAND} + -C "Release" + -D arg1=this + -D arg2=that + -D "arg3=the other" + "-Darg4=this is the fourth" + -Darg5=the_fifth + -Darg6:STRING=value-with-type + -S "${CMake_SOURCE_DIR}/Tests/CTestConfig/ScriptWithArgs.cmake" -VV + --output-log "${CMake_BINARY_DIR}/Tests/CTestConfig/ScriptWithArgs.log" + ) + ADD_TEST_MACRO(CMakeCommands.target_link_libraries target_link_libraries) CONFIGURE_FILE( diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 6604208..551cee3 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 LIBLZMA 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/CTestConfig/ScriptWithArgs.cmake b/Tests/CTestConfig/ScriptWithArgs.cmake new file mode 100644 index 0000000..79896a7 --- /dev/null +++ b/Tests/CTestConfig/ScriptWithArgs.cmake @@ -0,0 +1,16 @@ +set(CTEST_RUN_CURRENT_SCRIPT 0) + +macro(check_arg name expected_value) + message("${name}='${${name}}'") + if(NOT "${${name}}" STREQUAL "${expected_value}") + message(FATAL_ERROR "unexpected ${name} value '${${name}}', expected '${expected_value}'") + endif() +endmacro() + +check_arg(arg1 "this") +check_arg(arg2 "that") +check_arg(arg3 "the other") +check_arg(arg4 "this is the fourth") +check_arg(arg5 "the_fifth") +check_arg(arg6 "value-with-type") +check_arg(arg7 "") diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in index 793b987..eb9f987 100644 --- a/Tests/CTestUpdateGIT.cmake.in +++ b/Tests/CTestUpdateGIT.cmake.in @@ -91,6 +91,9 @@ run_child(WORKING_DIRECTORY ${TOP}/import COMMAND ${GIT} add . ) run_child(WORKING_DIRECTORY ${TOP}/import + COMMAND ${GIT} config core.safecrlf false + ) +run_child(WORKING_DIRECTORY ${TOP}/import COMMAND ${GIT} submodule add ${MOD_REPO} module ) run_child(WORKING_DIRECTORY ${TOP}/import diff --git a/Tests/CTestUpdateSVN.cmake.in b/Tests/CTestUpdateSVN.cmake.in index edafb4ef..15b833b 100644 --- a/Tests/CTestUpdateSVN.cmake.in +++ b/Tests/CTestUpdateSVN.cmake.in @@ -41,7 +41,6 @@ init_testing() #----------------------------------------------------------------------------- # Create the repository. message("Creating repository...") -file(MAKE_DIRECTORY ${TOP}/repo) run_child( COMMAND ${SVNADMIN} create --config-dir ${TOP}/config ${TOP}/repo ) diff --git a/Tests/CustomCommand/GeneratedHeader/main.cpp b/Tests/CustomCommand/GeneratedHeader/main.cpp index 1b3e85f..0b43ffe 100644 --- a/Tests/CustomCommand/GeneratedHeader/main.cpp +++ b/Tests/CustomCommand/GeneratedHeader/main.cpp @@ -1,5 +1,5 @@ #include "generated.h" -int main() +int mainGeneratedHeader() { return 0; } diff --git a/Tests/FindPackageModeMakefileTest/Makefile.in b/Tests/FindPackageModeMakefileTest/Makefile.in index 073d82e..f647901 100644 --- a/Tests/FindPackageModeMakefileTest/Makefile.in +++ b/Tests/FindPackageModeMakefileTest/Makefile.in @@ -1,10 +1,29 @@ +CMAKE = "@cmakeExecutable@" +CMAKE_CURRENT_BINARY_DIR = "@CMAKE_CURRENT_BINARY_DIR@" +CMAKE_CXX_COMPILER = "@CMAKE_CXX_COMPILER@" +CMAKE_CXX_COMPILER_ID = "@CMAKE_CXX_COMPILER_ID@" + +CMAKE_FOO = $(CMAKE) --find-package -DCMAKE_MODULE_PATH=$(CMAKE_CURRENT_BINARY_DIR) -DNAME=Foo -DLANGUAGE=CXX -DCOMPILER_ID=$(CMAKE_CXX_COMPILER_ID) + +tmp = tmp.txt + all: clean pngtest main.o: main.cpp - "@CMAKE_CXX_COMPILER@" $(CXXFLAGS) -c $(shell "@cmakeExecutable@" --find-package -DCMAKE_MODULE_PATH="@CMAKE_CURRENT_BINARY_DIR@" -DNAME=Foo -DLANGUAGE=CXX -DCOMPILER_ID=@CMAKE_CXX_COMPILER_ID@ -DMODE=COMPILE) main.cpp + @$(CMAKE_FOO) -DMODE=COMPILE >$(tmp) + @foo="`cat $(tmp)`"; \ + printf '"%s" %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CXXFLAGS)" "$$foo" >$(tmp) + @cat $(tmp) + @sh $(tmp) + @rm -f $(tmp) pngtest: main.o - "@CMAKE_CXX_COMPILER@" $(LDFLAGS) -o pngtest main.o $(shell "@cmakeExecutable@" --find-package -DCMAKE_MODULE_PATH="@CMAKE_CURRENT_BINARY_DIR@" -DNAME=Foo -DLANGUAGE=CXX -DCOMPILER_ID=@CMAKE_CXX_COMPILER_ID@ -DMODE=LINK) + @$(CMAKE_FOO) -DMODE=LINK >$(tmp) + @foo="`cat $(tmp)`"; \ + printf '"%s" %s %s -o pngtest main.o %s\n' $(CMAKE_CXX_COMPILER) "$(CXXFLAGS)" "$(LDFLAGS)" "$$foo" >$(tmp) + @cat $(tmp) + @sh $(tmp) + @rm -f $(tmp) clean: - rm -f *.o pngtest + rm -f $(tmp) *.o pngtest diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index 5862094..e85fb4d 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -363,10 +363,16 @@ endif() #----------------------------------------------------------------------------- # Test write_basic_config_version_file(). +# also test that an empty CMAKE_SIZEOF_VOID_P is accepted: +set(_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P}) +set(CMAKE_SIZEOF_VOID_P "") + write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/Foo123ConfigVersion.cmake VERSION 1.2.3 COMPATIBILITY AnyNewerVersion) +set(CMAKE_SIZEOF_VOID_P ${_CMAKE_SIZEOF_VOID_P}) + set(PACKAGE_FIND_VERSION 2.3.4) include(${CMAKE_CURRENT_BINARY_DIR}/Foo123ConfigVersion.cmake) if(PACKAGE_VERSION_COMPATIBLE) @@ -379,6 +385,10 @@ if(NOT PACKAGE_VERSION_COMPATIBLE) message(SEND_ERROR "Did not find Foo123 with version 1.2.3 (0.0.1 was requested) !") endif() +if(PACKAGE_VERSION_UNSUITABLE) + message(SEND_ERROR "PACKAGE_VERSION_UNSUITABLE set, but must not be !") +endif() + set(PACKAGE_FIND_VERSION 1.0.0) include(${CMAKE_CURRENT_BINARY_DIR}/Foo123ConfigVersion.cmake) if(NOT PACKAGE_VERSION_COMPATIBLE) @@ -405,6 +415,7 @@ write_basic_config_version_file(${CMAKE_CURRENT_BINARY_DIR}/Boo123ConfigVersion. VERSION 1.2.3 COMPATIBILITY SameMajorVersion) +unset(PACKAGE_VERSION_UNSUITABLE) set(PACKAGE_VERSION_EXACT FALSE) set(PACKAGE_FIND_VERSION 2.3.4) set(PACKAGE_FIND_VERSION_MAJOR 2) @@ -456,6 +467,7 @@ write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/Bar123ConfigVersion VERSION 1.2.3.17 COMPATIBILITY ExactVersion) +unset(PACKAGE_VERSION_UNSUITABLE) set(PACKAGE_VERSION_EXACT FALSE) set(PACKAGE_FIND_VERSION 2.3.4) include(${CMAKE_CURRENT_BINARY_DIR}/Bar123ConfigVersion.cmake) diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt index 2cf36f5..334b8be 100644 --- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt @@ -5,9 +5,7 @@ project(TargetIncludeDirectories) macro(create_header _name) file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_name}") - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_name}/${_name}.h" - "//${_name}.h - ") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_name}/${_name}.h" "//${_name}.h\n") endmacro() create_header(bar) diff --git a/Tests/LibName/CMakeLists.txt b/Tests/LibName/CMakeLists.txt index 3dca0b0..07499a1 100644 --- a/Tests/LibName/CMakeLists.txt +++ b/Tests/LibName/CMakeLists.txt @@ -3,11 +3,24 @@ project(LibName) # LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH work set(LIBRARY_OUTPUT_PATH lib) set(EXECUTABLE_OUTPUT_PATH lib) + add_library(bar SHARED bar.c) + add_library(foo SHARED foo.c) target_link_libraries(foo bar) + add_executable(foobar foobar.c) target_link_libraries(foobar foo) IF(UNIX) target_link_libraries(foobar -L/usr/local/lib) ENDIF(UNIX) + + +# check with lib version + +add_library(verFoo SHARED foo.c) +target_link_libraries(verFoo bar) +set_target_properties(verFoo PROPERTIES VERSION 3.1.4 SOVERSION 3) + +add_executable(verFoobar foobar.c) +target_link_libraries(verFoobar verFoo) diff --git a/Tests/MumpsCoverage/.gitattributes b/Tests/MumpsCoverage/.gitattributes new file mode 100644 index 0000000..b680612 --- /dev/null +++ b/Tests/MumpsCoverage/.gitattributes @@ -0,0 +1,2 @@ +*.cmcov -crlf -whitespace +*.mcov -crlf -whitespace diff --git a/Tests/MumpsCoverage/Accounts_ReceivableTest.cmcov b/Tests/MumpsCoverage/Accounts_ReceivableTest.cmcov new file mode 100644 index 0000000..c3b3342 --- /dev/null +++ b/Tests/MumpsCoverage/Accounts_ReceivableTest.cmcov @@ -0,0 +1,304 @@ +Routine,Line,RtnLine,Code
+DDIOL,1,0,"DDIOL ;SFISC/MKO-THE LOADER ;1:53 PM 12 Sep 1995"
+,2,0," ;;22.0;VA FileMan;;Mar 30, 1999"
+,3,0," ;Per VHA Directive 10-93-142, this routine should not be modified."
+,4,0," ;"
+,5,0,"EN(A,G,FMT) ;Write the text contained in local array A or global array G"
+,6,0," ;If one string passed, use format FMT"
+,7,0," N %,Y,DINAKED"
+,8,0," S DINAKED=$$LGR^%ZOSV"
+,9,0," ;"
+,10,0," S:'$D(A) A="""""
+,11,0," I $G(A)="""",$D(A)<9,$G(FMT)="""",$G(G)'?1""^""1A.7AN,$G(G)'?1""^""1A.7AN1""("".E1"")"" Q"
+,12,0," ;"
+,13,0," G:$D(DDS) SM"
+,14,0," G:$D(DIQUIET) LD"
+,15,0," ;"
+,16,0," N F,I,S"
+,17,0," I $D(A)=1,$G(G)="""" D"
+,18,0," . S F=$S($G(FMT)]"""":FMT,1:""!"")"
+,19,0," . W @F,A"
+,20,0," ;"
+,21,0," E I $D(A)>9 S I=0 F S I=$O(A(I)) Q:I'=+$P(I,""E"") D"
+,22,0," . S F=$G(A(I,""F""),""!"") S:F="""" F=""?0"""
+,23,0," . W @F,$G(A(I))"
+,24,0," ;"
+,25,0," E S I=0 F S I=$O(@G@(I)) Q:I'=+$P(I,""E"") D"
+,26,0," . S S=$G(@G@(I,0),$G(@G@(I)))"
+,27,0," . S F=$G(@G@(I,""F""),""!"") S:F="""" F=""?0"""
+,28,0," . W @F,S"
+,29,0," ;"
+,30,0," I DINAKED]"""" S DINAKED=$S(DINAKED["""""""""""":$O(@DINAKED),1:$D(@DINAKED))"
+,31,0," Q"
+,32,0," ;"
+,33,0,"LD ;Load text into ^TMP"
+,34,0," N I,N,T"
+,35,0," S T=$S($G(DDIOLFLG)[""H"":""DIHELP"",1:""DIMSG"")"
+,36,0," S N=$O(^TMP(T,$J,"" ""),-1)"
+,37,0," ;"
+,38,0," I $D(A)=1,$G(G)="""" D"
+,39,0," . D LD1(A,$S($G(FMT)]"""":FMT,1:""!""))"
+,40,0," ;"
+,41,0," E I $D(A)>9 S I=0 F S I=$O(A(I)) Q:I'=+$P(I,""E"") D"
+,42,0," . D LD1($G(A(I)),$G(A(I,""F""),""!""))"
+,43,0," ;"
+,44,0," E S I=0 F S I=$O(@G@(I)) Q:I'=+$P(I,""E"") D"
+,45,0," . D LD1($G(@G@(I),$G(@G@(I,0))),$G(@G@(I,""F""),""!""))"
+,46,0," ;"
+,47,0," K:'N @T S:N @T=N"
+,48,0," I DINAKED]"""" S DINAKED=$S(DINAKED["""""""""""":$O(@DINAKED),1:$D(@DINAKED))"
+,49,0," Q"
+,50,0," ;"
+,51,0,"LD1(S,F) ;Load string S, with format F"
+,52,0," ;In: N and T"
+,53,0," N C,J,L"
+,54,0," S:S[$C(7) S=$TR(S,$C(7),"""")"
+,55,0," F J=1:1:$L(F,""!"")-1 S N=N+1,^TMP(T,$J,N)="""""
+,56,0," S:'N N=1"
+,57,0," S:F[""?"" @(""C=""_$P(F,""?"",2))"
+,58,0," S L=$G(^TMP(T,$J,N))"
+,59,0," S ^TMP(T,$J,N)=L_$J("""",$G(C)-$L(L))_S"
+,60,0," Q"
+,61,0," ;"
+,62,0,"SM ;Print text in ScreenMan's Command Area"
+,63,0," I $D(DDSID),$D(DTOUT)!$D(DUOUT) G SMQ"
+,64,0," N DDIOL"
+,65,0," S DDIOL=1"
+,66,0," ;"
+,67,0," I $D(A)=1&($G(G)="""")!($D(A)>9) D"
+,68,0," . D MSG^DDSMSG(.A,"""",$G(FMT))"
+,69,0," E I $D(@G@(+$O(@G@(0)),0))#2 D"
+,70,0," . D WP^DDSMSG(G)"
+,71,0," E D HLP^DDSMSG(G)"
+,72,0," ;"
+,73,0,"SMQ I DINAKED]"""" S DINAKED=$S(DINAKED["""""""""""":$O(@DINAKED),1:$D(@DINAKED))"
+,74,0," Q"
+Totals for DDIOL,,0,
+XINDEX,1,0,"XINDEX ;ISC/REL,GFT,GRK,RWF - INDEX & CROSS-REFERENCE ;08/04/08 13:19"
+,2,1," ;;7.3;TOOLKIT;**20,27,48,61,66,68,110,121,128**;Apr 25, 1995;Build 1"
+,3,0," ; Per VHA Directive 2004-038, this routine should not be modified."
+,4,1," G ^XINDX6"
+,5,107216,"SEP F I=1:1 S CH=$E(LIN,I) D QUOTE:CH=Q Q:"" ""[CH"
+,6,107216," S ARG=$E(LIN,1,I-1) S:CH="" "" I=I+1 S LIN=$E(LIN,I,999) Q"
+,7,36371,"QUOTE F I=I+1:1 S CH=$E(LIN,I) Q:CH=""""!(CH=Q)"
+,8,36371," Q:CH]"""" S ERR=6 G ^XINDX1"
+,9,0,"ALIVE ;enter here from taskman"
+,10,1," D SETUP^XINDX7 ;Get ready to process"
+,11,468,"A2 S RTN=$O(^UTILITY($J,RTN)) G ^XINDX5:RTN="""""
+,12,467," S INDLC=(RTN?1""|""1.4L.NP) D LOAD:'INDLC"
+,13,467," I $D(ZTQUEUED),$$S^%ZTLOAD S RTN=""~"",IND(""QUIT"")=1,ZTSTOP=1 G A2"
+,14,467," I 'INDDS,INDLC W !!?10,""Data Dictionaries"",! S INDDS=1"
+,15,467," D BEG"
+,16,467," G A2"
+,17,0," ;"
+,18,467,"LOAD S X=RTN,XCNP=0,DIF=""^UTILITY(""_$J_"",1,RTN,0,"" X ^%ZOSF(""TEST"") Q:'$T X ^%ZOSF(""LOAD"") S ^UTILITY($J,1,RTN,0,0)=XCNP-1"
+,19,467," I $D(^UTILITY($J,1,RTN,0,0)) S ^UTILITY($J,1,RTN,""RSUM"")=""B""_$$SUMB^XPDRSUM($NA(^UTILITY($J,1,RTN,0)))"
+,20,467," Q"
+,21,0,"BEG ;"
+,22,467," S %=INDLC*5 W:$X+10+%>IOM ! W RTN,$J("""",10+%-$L(RTN))"
+,23,467," S (IND(""DO""),IND(""SZT""),IND(""SZC""),LABO)=0,LC=$G(^UTILITY($J,1,RTN,0,0))"
+,24,467," I LC="""" W !,"">>>Routine '"",RTN,""' not found <<<"",! Q"
+,25,467," S TXT="""",LAB=$P(^UTILITY($J,1,RTN,0,1,0),"" "") I RTN'=$P(LAB,""("") D E^XINDX1(17)"
+,26,467," I 'INDLC,LAB[""("" D E^XINDX1(55) S LAB=$P(LAB,""("")"
+,27,0," ;if M routine(not compiled template or DD) and has more than 2 lines, check lines 1 & 2"
+,28,467," I 'INDLC,LC>2 D"
+,29,467," . N LABO S LABO=1"
+,30,467," . S LIN=$G(^UTILITY($J,1,RTN,0,1,0)),TXT=1"
+,31,0," . ;check 1st line (site/dev - ) patch 128"
+,32,467," . I $P(LIN,"";"",2,4)'?.E1""/"".E.1""-"".E D E^XINDX1(62)"
+,33,467," . S LIN=$G(^UTILITY($J,1,RTN,0,2,0)),TXT=2"
+,34,0," . ;check 2nd line (;;nn.nn[TV]nn;package;.anything)"
+,35,467," . I $P(LIN,"";"",3,99)'?1.2N1"".""1.2N.1(1""T"",1""V"").2N1"";""1A.AP1"";"".E D E^XINDX1(44) ;patch 121"
+,36,467," . I $L(INP(11)) X INP(11) ;Version number check"
+,37,467," . I $L(INP(12)) X INP(12) ;Patch number check"
+,38,467,"B5 F TXT=1:1:LC S LIN=^UTILITY($J,1,RTN,0,TXT,0),LN=$L(LIN),IND(""SZT"")=IND(""SZT"")+LN+2 D LN,ST ;Process Line"
+,39,467," S LAB="""",LABO=0,TXT=0,^UTILITY($J,1,RTN,0)=IND(""SZT"")_""^""_LC_""^""_IND(""SZC"")"
+,40,467," I IND(""SZT"")>INP(""MAX""),'INDLC S ERR=35,ERR(1)=IND(""SZT"") D ^XINDX1"
+,41,467," I IND(""SZT"")-IND(""SZC"")>INP(""CMAX""),'INDLC S ERR=58,ERR(1)=IND(""SZT"")-IND(""SZC"") D ^XINDX1"
+,42,467," D POSTRTN"
+,43,467," Q"
+,44,0," ;Proccess one line, LN = Length, LIN = Line."
+,45,44620,"LN K V S (ARG,GRB,IND(""COM""),IND(""DOL""),IND(""F""))="""",X=$P(LIN,"" "")"
+,46,44620," I '$L(X) S LABO=LABO+1 G CD"
+,47,5073," S (IND(""COM""),LAB)=$P(X,""(""),ARG=$P($P(X,""("",2),"")""),LABO=0,IND(""PP"")=X?1.8E1""("".E1"")"""
+,48,5073," D:$L(ARG) NE^XINDX3 ;Process formal parameters as New list."
+,49,5073," I 'INDLC,'$$VT^XINDX2(LAB) D E^XINDX1($S(LAB=$$CASE^XINDX52(LAB):37,1:55)) ;Check for bad labels"
+,50,5073," I $D(^UTILITY($J,1,RTN,""T"",LAB)) D E^XINDX1(15) G CD ;DUP label"
+,51,5073," S ^UTILITY($J,1,RTN,""T"",LAB)="""""
+,52,44620,"CD I LN>245 D:'(LN=246&($E(RTN,1,3)=""|dd"")) E^XINDX1(19) ;patch 119"
+,53,44620," D:LIN'?1.ANP E^XINDX1(18)"
+,54,44620," S LIN=$P(LIN,"" "",2,999),IND(""LCC"")=1"
+,55,44620," I LIN="""" D E^XINDX1(42) Q ;Blank line ;p110"
+,56,44620," S I=0 ;Watch the scope of I, counts dots"
+,57,44620," I "" .""[$E(LIN) D S X=$L($E(LIN,1,I),""."")-1,LIN=$E(LIN,I,999)"
+,58,10770," . F I=1:1:245 Q:"". ""'[$E(LIN,I)"
+,59,10770," . Q"
+,60,0," ;check dots against Do level IND(""DO""), IND(""DOL"")=dot level"
+,61,44620," D:'I&$G(IND(""DO1"")) E^XINDX1(51) S IND(""DO1"")=0 S:'I IND(""DO"")=0"
+,62,44620," I I D:X>IND(""DO"") E^XINDX1(51) S (IND(""DO""),IND(""DOL""))=X"
+,63,0," ;Count Comment lines, skip ;; lines"
+,64,44620," I $E(LIN)="";"",$E(LIN,2)'="";"" S IND(""SZC"")=IND(""SZC"")+$L(LIN) ;p110"
+,65,0," ;Process commands on line."
+,66,116081,"EE I LIN="""" D ^XINDX2 Q"
+,67,71461," S COM=$E(LIN),GK="""",ARG="""""
+,68,71461," I COM="";"" S LIN="""" G EE ;p110"
+,69,54870," I COM="" "" S ERR=$S(LIN?1."" "":13,1:0),LIN=$S(ERR:"""",1:$E(LIN,2,999)) D:ERR ^XINDX1 G EE"
+,70,53608," D SEP"
+,71,53608," S CM=$P(ARG,"":"",1),POST=$P(ARG,"":"",2,999),IND(""COM"")=IND(""COM"")_$C(9)_COM,ERR=48"
+,72,53608," D:ARG["":""&(POST']"""") ^XINDX1 S:POST]"""" GRB=GRB_$C(9)_POST,IND(""COM"")=IND(""COM"")_"":"""
+,73,0," ;SAC now allows lowercase commands"
+,74,53608," I CM?.E1L.E S CM=$$CASE^XINDX52(CM),COM=$E(CM) ;I IND(""LCC"") S IND(""LCC"")=0 D E^XINDX1(47)"
+,75,53608," I CM="""" D E^XINDX1(21) G EE ;Missing command"
+,76,53608," S CX=$G(IND(""CMD"",CM)) I CX="""" D G:CX="""" EE"
+,77,0," . I $E(CM)=""Z"" S CX=""^Z"" Q ;Proccess Z commands"
+,78,0," . D E^XINDX1(1) S LIN="""" Q"
+,79,53608," S CX=$P(CX,""^"",2,9)"
+,80,53608," D SEP I '$L(LIN),CH="" "" D E^XINDX1(13) ;trailing space"
+,81,53608," I ARG="""",""CGJMORSUWX""[COM S ERR=49 G ^XINDX1"
+,82,53608," I CX>0 D E^XINDX1(CX) S CX="""""
+,83,53608," D:$L(CX) @CX S:ARG'="""" GRB=GRB_$C(9)_ARG G EE"
+,84,0,"B S ERR=25 G ^XINDX1"
+,85,0,"C S ERR=29 G ^XINDX1"
+,86,0,"D G DG1^XINDX4"
+,87,0,"E Q:ARG="""" S ERR=7 G ^XINDX1"
+,88,1559,"F G:ARG]"""" FR^XINDX4 S IND(""F"")=1 Q"
+,89,1932,"G G DG^XINDX4"
+,90,11,"H Q:ARG'="""" S ERR=32 G ^XINDX1"
+,91,0,"J S ERR=36,ARG="""" G ^XINDX1"
+,92,2218,"K S ERR=$S(ARG?1""("".E:22,ARG?."" "":23,1:0) D:ERR ^XINDX1"
+,93,2218," G KL^XINDX3"
+,94,259,"L G LO^XINDX4"
+,95,30,"M G S^XINDX3"
+,96,1721,"N G NE^XINDX3"
+,97,0,"O S ERR=34 D ^XINDX1,O^XINDX3 Q"
+,98,7762,"Q Q:ARG="""" G Q^XINDX4"
+,99,85,"R S RDTIME=0 G RD^XINDX3"
+,100,17549,"S G S^XINDX3"
+,101,0,"TR Q ;What to process. p110"
+,102,72,"U S ARG=$P(ARG,"":"") Q"
+,103,0,"V S ARG="""",ERR=20 G ^XINDX1"
+,104,4584,"W G WR^XINDX4"
+,105,220,"X G XE^XINDX4"
+,106,0,"Z S ERR=2 D ^XINDX1 G ZC^XINDX4"
+,107,0," ;"
+,108,0," ;Save off items from line."
+,109,44620,"ST S R=LAB_$S(LABO:""+""_LABO,1:"""")"
+,110,0," ;Local variable, Global, Marked Items, Naked global, Internal ref, eXternal ref., Tag ref."
+,111,44620," S LOC="""" F S LOC=$O(V(LOC)),S="""" Q:LOC="""" F S S=$O(V(LOC,S)) Q:S="""" D SET"
+,112,44620," S ^UTILITY($J,1,RTN,""COM"",TXT)=IND(""COM"")"
+,113,44620," Q"
+,114,0," ;"
+,115,85079,"SET I V(LOC,S)]"""" F %=""!"",""~"" I V(LOC,S)[%,$G(^UTILITY($J,1,RTN,LOC,S))'[% S ^(S)=$G(^(S))_%"
+,116,85079," S %=0"
+,117,86891,"SE2 S ARG=$G(^UTILITY($J,1,RTN,LOC,S,%)) I $L(ARG)>230 S %=%+1 G SE2"
+,118,85079," S ^UTILITY($J,1,RTN,LOC,S,%)=ARG_R_V(LOC,S)_"","""
+,119,85079," Q"
+,120,0," ;"
+,121,0,"POSTRTN ;Do more overall checking"
+,122,467," N V,E,T,T1,T2"
+,123,467," S T="""" ;Check for missing Labels"
+,124,467," F S T=$O(^UTILITY($J,1,RTN,""I"",T)),T2=T Q:T="""" S T1=$G(^(T,0)) D"
+,125,2091," . Q:$E(T2,1,2)=""@("""
+,126,2044," . S:$E(T2,1,2)=""$$"" T2=$E(T2,3,99)"
+,127,2044," . I T2]"""",'$D(^UTILITY($J,1,RTN,""T"",$P(T2,""+"",1))) D"
+,128,0," . . F I=1:1:$L(T1,"","")-1 S LAB=$P(T1,"","",I),LABO=+$P(LAB,""+"",2),LAB=$P(LAB,""+""),E=14,E(1)=T D E^XINDX1(.E)"
+,129,0," . . Q"
+,130,2044," . Q"
+,131,467," S LAB="""",LABO=0 ;Check for valid label names"
+,132,467," I 'INDLC F S LAB=$O(^UTILITY($J,1,RTN,""T"",LAB)) Q:LAB="""" D"
+,133,5073," . I '$$VA^XINDX2(LAB) D E^XINDX1(55) Q"
+,134,5073," . D:'$$VT^XINDX2(LAB) E^XINDX1(37)"
+,135,5073," . Q"
+,136,467," S LAB="""",LABO=0 ;Check for valid variable names."
+,137,467," F S LAB=$O(^UTILITY($J,1,RTN,""L"",LAB)) Q:LAB="""" D"
+,138,15909," . D VLNF^XINDX3($P(LAB,""(""))"
+,139,15909," . Q"
+,140,467," Q"
+,141,0," ;"
+,142,0,"QUICK ;Quick, Just get a routine an print the results"
+,143,0," D QUICK^XINDX6()"
+,144,0," Q"
+Totals for XINDEX,,2446443,
+XINDX1,1,0,"XINDX1 ;ISC/REL,GRK,RWF - ERROR ROUTINE ;08/05/08 13:59"
+,2,2," ;;7.3;TOOLKIT;**20,61,66,68,110,121,128**;Apr 25, 1995;Build 1"
+,3,0," ; Per VHA Directive 2004-038, this routine should not be modified."
+,4,2," G A"
+,5,0,"E(ERR) ;"
+,6,75,"A N %,%1 ;TXT is the line of the error."
+,7,75," S ERTX=LAB_$S(LABO:""+""_LABO,1:"""")_$C(9),%1=$T(ERROR+ERR),ERTX=ERTX_$S(ERR:$P(%1,"";"",4,9),1:ERR) ;p110"
+,8,75," I ERTX[""|"" F %=1:1 S ERTX=$P(ERTX,""|"")_$S($D(ERR(%)):ERR(%),1:""??"")_$P(ERTX,""|"",%+1,99) Q:ERTX'[""|"""
+,9,75,"B I $P(%1,"";"",3)]"""" D Q:%1]"""" ;Don't flag kernel doing kernel."
+,10,0," . S %1=$P(%1,"";"",3)"
+,11,0," . F Q:RTN[$P(%1,"","") S %1=$P(%1,"","",2,99) ;quit if RTN[%1 or null."
+,12,0," . Q"
+,13,75," I ERR=17,$E(RTN)'=""%"",$E(LAB)=""%"" Q ;Don't flag %RTN w/o %."
+,14,0," ;Global is Error Line,tab,error tag,tab,error text"
+,15,75," S %=$G(^UTILITY($J,1,RTN,""E"",0))+1,^(0)=%,^(%)=TXT_$C(9)_ERTX"
+,16,75," Q"
+,17,0," ;"
+,18,0," ;F = Fatal, S = Standard, W = Warning, I = Info"
+,19,0,"ERROR ;"
+,20,0,"1 ;;;F - UNDEFINED COMMAND (rest of line not checked)."
+,21,0,"2 ;;;F - Non-standard (Undefined) 'Z' command."
+,22,0,"3 ;;XTRMON;F - Undefined Function."
+,23,0,"4 ;;;F - Undefined Special Variable."
+,24,0,"5 ;;;F - Unmatched Parenthesis."
+,25,0,"6 ;;;F - Unmatched Quotation Marks."
+,26,0,"7 ;;;F - ELSE Command followed by only one space."
+,27,0,"8 ;;;F - FOR Command did not contain '='."
+,28,0,"9 ;;;I - QUIT Command followed by only one space."
+,29,0,"10 ;;;F - Unrecognized argument in SET command."
+,30,0,"11 ;;;W - Invalid local variable name."
+,31,0,"12 ;;;W - Invalid global variable name."
+,32,0,"13 ;;;W - Blank(s) at end of line."
+,33,0,"14 ;;;F - Call to missing label '|' in this routine."
+,34,0,"15 ;;;W - Duplicate label. (M57)"
+,35,0,"16 ;;;F - Error in pattern code."
+,36,0,"17 ;;;W - First line label NOT routine name."
+,37,0,"18 ;;;W - Line contains a CONTROL (non-graphic) character."
+,38,0,"19 ;;;S - Line is longer than 245 bytes."
+,39,0,"20 ;;;S - View command used."
+,40,0,"21 ;;;F - General Syntax Error."
+,41,0,"22 ;;;S - Exclusive Kill."
+,42,0,"23 ;;;S - Unargumented Kill."
+,43,0,"24 ;;;S - Kill of an unsubscripted global."
+,44,0,"25 ;;;S - Break command used."
+,45,0,"26 ;;;S - Exclusive or Unargumented NEW command."
+,46,0,"27 ;;;S - $View function used."
+,47,0,"28 ;;ZOSV,ZIS,ZT;S - Non-standard $Z special variable used."
+,48,0,"29 ;;ZIS,ZTM;S - 'Close' command should be invoked through 'D ^%ZISC'."
+,49,0,"30 ;;;S - LABEL+OFFSET syntax."
+,50,0,"31 ;;ZOSV,ZIS,ZT;S - Non-standard $Z function used."
+,51,0,"32 ;;;S - 'HALT' command should be invoked through 'G ^XUSCLEAN'."
+,52,0,"33 ;;;S - Read command doesn't have a timeout."
+,53,0,"34 ;;ZIS;S - 'OPEN' command should be invoked through ^%ZIS."
+,54,0,"35 ;;;S - Routine exceeds SACC maximum size of 20000 (|)."
+,55,0,"36 ;;ZTM;S - Should use 'TASKMAN' instead of 'JOB' command."
+,56,0,"37 ;;;F - Label is not valid."
+,57,0,"38 ;;;F - Call to this |"
+,58,0,"39 ;;ZIS,XUS,XUP;S - Kill of a protected variable (|)."
+,59,0,"40 ;;;S - Space where a command should be."
+,60,0,"41 ;;;I - Star or pound READ used."
+,61,0,"42 ;;;W - Null line (no commands or comment)."
+,62,0,"43 ;;;F - Invalid or wrong number of arguments to a function."
+,63,0,"44 ;;;S - 2nd line of routine violates the SAC."
+,64,0,"45 ;;ZT,ZIS,XUTM,XTER;S - Set to a '%' global."
+,65,0,"46 ;;;F - Quoted string not followed by a separator."
+,66,0,"47 ;;;S - Lowercase command(s) used in line."
+,67,0,"48 ;;;F - Missing argument to a command post-conditional."
+,68,0,"49 ;;;F - Command missing an argument."
+,69,0,"50 ;;ZTM;S - Extended reference."
+,70,0,"51 ;;;F - Block structure mismatch."
+,71,0,"52 ;;;F - Reference to routine '^|'. That isn't in this UCI."
+,72,0,"53 ;;;F - Bad Number."
+,73,0,"54 ;;XG;S - Access to SSVN's restricted to Kernel."
+,74,0,"55 ;;;S - Violates VA programming standards."
+,75,0,"56 ;;;S - Patch number '|' missing from second line."
+,76,0,"57 ;;;S - Lower/Mixed case Variable name used."
+,77,0,"58 ;;;S - Routine code exceeds SACC maximum size of 15000 (|)."
+,78,0,"59 ;;;F - Bad WRITE syntax."
+,79,0,"60 ;;;S - Lock missing Timeout."
+,80,0,"61 ;;;S - Non-Incremental Lock."
+,81,0,"62 ;;;S - First line of routine violates the SAC."
+,82,0,"63 ;;;F - GO or DO mismatch from block structure (M45)."
+Totals for XINDX1,,529,
diff --git a/Tests/MumpsCoverage/Accounts_ReceivableTest.mcov b/Tests/MumpsCoverage/Accounts_ReceivableTest.mcov new file mode 100644 index 0000000..3c585f5 --- /dev/null +++ b/Tests/MumpsCoverage/Accounts_ReceivableTest.mcov @@ -0,0 +1,1445 @@ +%GO Global Output Utility +GT.M 17-APR-2012 17:18:27 ZWR +^ZZCOVERAGE("%RSEL","SRC")="1:0:0:0" +^ZZCOVERAGE("%RSEL","SRC",1)="1:0:0:0" +^ZZCOVERAGE("%RSEL","SRC",2)="1:0:0:0" +^ZZCOVERAGE("%RSEL","SRC",3)="1:0:0:0" +^ZZCOVERAGE("%RSEL","SRC",4)="1:0:0:0" +^ZZCOVERAGE("%RSEL","SRC",5)="1:0:0:0" +^ZZCOVERAGE("%RSEL","SRC",6)="1:0:0:0" +^ZZCOVERAGE("%RSEL","SRC",7)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init")="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",1)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",3)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",4)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",5)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",6)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",7)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",8)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",8,"FOR_LOOP",1)=1 +^ZZCOVERAGE("%RSEL","init",9)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",10)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",11)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",12)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",13)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",14)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",15)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",16)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",17)="1:0:0:0" +^ZZCOVERAGE("%RSEL","init",17,"FOR_LOOP",1)=2 +^ZZCOVERAGE("%RSEL","init",18)="2:0:0:0" +^ZZCOVERAGE("%RSEL","init",19)="2:0:0:0" +^ZZCOVERAGE("%RSEL","init",20)="2:0:0:0" +^ZZCOVERAGE("%RSEL","init",40)="1:0:0:0" +^ZZCOVERAGE("%RSEL","main")="1:32001:84004:116005" +^ZZCOVERAGE("%RSEL","main",1)="1:0:0:0" +^ZZCOVERAGE("%RSEL","main",2)="1:0:0:0" +^ZZCOVERAGE("%RSEL","main",3)="1:0:0:0" +^ZZCOVERAGE("%RSEL","main",3,"FOR_LOOP",1)=468 +^ZZCOVERAGE("%RSEL","main",4)="468:0:24003:24003" +^ZZCOVERAGE("%RSEL","main",5)="468:0:0:0" +^ZZCOVERAGE("%RSEL","main",6)="468:32001:48001:80002" +^ZZCOVERAGE("%RSEL","main",7)="467:0:12000:12000" +^ZZCOVERAGE("%RSEL","main",8)="467:0:0:0" +^ZZCOVERAGE("%RSEL","main",9)="467:0:0:0" +^ZZCOVERAGE("%RSEL","main",10)="467:0:0:0" +^ZZCOVERAGE("%RSEL","main",11)="1:0:0:0" +^ZZCOVERAGE("%RSEL","main",12)="1:0:0:0" +^ZZCOVERAGE("%RSEL","main",13)="1:0:0:0" +^ZZCOVERAGE("%RSEL","main",14)="1:0:0:0" +^ZZCOVERAGE("%RSEL","next")="1403:12001:20002:32003" +^ZZCOVERAGE("%RSEL","next",0)="1403:0:0:0" +^ZZCOVERAGE("%RSEL","next",1)="1403:12001:20002:32003" +^ZZCOVERAGE("%RSEL","next",1,"FOR_LOOP",1)=1403 +^ZZCOVERAGE("%RSEL","next",2)="1403:0:0:0" +^ZZCOVERAGE("%RSEL","save")="467:0:4001:4001" +^ZZCOVERAGE("%RSEL","save",1)="467:0:0:0" +^ZZCOVERAGE("%RSEL","save",5)="467:0:0:0" +^ZZCOVERAGE("%RSEL","save",6)="467:0:0:0" +^ZZCOVERAGE("%RSEL","save",7)="467:0:0:0" +^ZZCOVERAGE("%RSEL","save",8)="467:0:4001:4001" +^ZZCOVERAGE("%RSEL","save",9)="467:0:0:0" +^ZZCOVERAGE("%RSEL","search")="934:0:16001:16001" +^ZZCOVERAGE("%RSEL","search",0)="934:0:4000:4000" +^ZZCOVERAGE("%RSEL","search",1)="934:0:0:0" +^ZZCOVERAGE("%RSEL","search",2)="934:0:4001:4001" +^ZZCOVERAGE("%RSEL","search",2,"FOR_LOOP",1)=1868 +^ZZCOVERAGE("%RSEL","search",3)="934:0:8000:8000" +^ZZCOVERAGE("%RSEL","search",4)="934:0:0:0" +^ZZCOVERAGE("%RSEL","search",5)="934:0:0:0" +^ZZCOVERAGE("%RSEL","start")="468:0:4001:4001" +^ZZCOVERAGE("%RSEL","start",0)="468:0:0:0" +^ZZCOVERAGE("%RSEL","start",1)="468:0:0:0" +^ZZCOVERAGE("%RSEL","start",2)="468:0:0:0" +^ZZCOVERAGE("%RSEL","start",2,"FOR_LOOP",1)=936 +^ZZCOVERAGE("%RSEL","start",3)="468:0:0:0" +^ZZCOVERAGE("%RSEL","work")="467:20002:24001:44003" +^ZZCOVERAGE("%RSEL","work",1)="467:0:0:0" +^ZZCOVERAGE("%RSEL","work",2)="467:0:0:0" +^ZZCOVERAGE("%RSEL","work",3)="467:0:4000:4000" +^ZZCOVERAGE("%RSEL","work",4)="467:0:0:0" +^ZZCOVERAGE("%RSEL","work",6)="467:4000:12000:16000" +^ZZCOVERAGE("%RSEL","work",6,"FOR_LOOP",1)=3421 +^ZZCOVERAGE("%RSEL","work",7)="467:0:0:0" +^ZZCOVERAGE("%RSEL","work",8)="467:4001:0:4001" +^ZZCOVERAGE("%RSEL","work",9)="467:0:0:0" +^ZZCOVERAGE("%RSEL","work",10)="467:0:0:0" +^ZZCOVERAGE("%RSEL","work",11)="467:0:0:0" +^ZZCOVERAGE("%RSEL","work",12)="467:4000:0:4000" +^ZZCOVERAGE("%RSEL","work",13)="467:0:4000:4000" +^ZZCOVERAGE("%RSEL","work",14)="467:0:0:0" +^ZZCOVERAGE("%RSEL","work",15)="467:4001:4001:8002" +^ZZCOVERAGE("%RSEL","work",15,"FOR_LOOP",1)=934 +^ZZCOVERAGE("%RSEL","work",16)="467:0:0:0" +^ZZCOVERAGE("%ZIS","%ZIS")="2:0:0:0" +^ZZCOVERAGE("%ZIS","%ZIS",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS","%ZIS",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS","A",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS","A",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS","CLEAN")="3:0:0:0" +^ZZCOVERAGE("%ZIS","CLEAN",1)="3:0:0:0" +^ZZCOVERAGE("%ZIS","CLEAN",2)="3:0:0:0" +^ZZCOVERAGE("%ZIS","CLEAN",3)="3:0:0:0" +^ZZCOVERAGE("%ZIS","CLEAN",4)="3:0:0:0" +^ZZCOVERAGE("%ZIS","GETHOME")="2:0:0:0" +^ZZCOVERAGE("%ZIS","GETHOME",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS","GETHOME",1)="1:0:0:0" +^ZZCOVERAGE("%ZIS","GETHOME",3)="1:0:0:0" +^ZZCOVERAGE("%ZIS","GETHOME",4)="1:0:0:0" +^ZZCOVERAGE("%ZIS","GETHOME",5)="1:0:0:0" +^ZZCOVERAGE("%ZIS","GETHOME",6)="1:0:0:0" +^ZZCOVERAGE("%ZIS","GETHOME",7)="1:0:0:0" +^ZZCOVERAGE("%ZIS","HOME")="1:0:0:0" +^ZZCOVERAGE("%ZIS","HOME",1)="1:0:0:0" +^ZZCOVERAGE("%ZIS","HOME",2)="1:0:0:0" +^ZZCOVERAGE("%ZIS","INIT",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS","INIT",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS","INIT",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS","INIT",5)="2:0:0:0" +^ZZCOVERAGE("%ZIS","INIT",6)="2:0:0:0" +^ZZCOVERAGE("%ZIS","INIT",8)="2:0:0:0" +^ZZCOVERAGE("%ZIS","INIT",10)="2:0:0:0" +^ZZCOVERAGE("%ZIS","INIT",11)="2:0:0:0" +^ZZCOVERAGE("%ZIS","INIT",12)="2:0:0:0" +^ZZCOVERAGE("%ZIS","INIT",13)="2:0:0:0" +^ZZCOVERAGE("%ZIS","INIT",15)="2:0:0:0" +^ZZCOVERAGE("%ZIS","K2",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS","K2",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS","K2",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS","K2",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS","VIRTUAL")="2:0:0:0" +^ZZCOVERAGE("%ZIS","VIRTUAL",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS","VIRTUAL",4,"FOR_LOOP",1)=6 +^ZZCOVERAGE("%ZIS","VIRTUAL",5)="2:0:0:0" +^ZZCOVERAGE("%ZIS","VIRTUAL",7)="2:0:0:0" +^ZZCOVERAGE("%ZIS","VTLKUP")="4:0:0:0" +^ZZCOVERAGE("%ZIS","VTLKUP",0)="4:0:0:0" +^ZZCOVERAGE("%ZIS","VTLKUP",0,"FOR_LOOP",1)=8 +^ZZCOVERAGE("%ZIS","VTLKUP",1)="4:0:0:0" +^ZZCOVERAGE("%ZIS1","EX2",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","EX2",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","EXIT",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","EXIT",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","EXIT",5)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","EXIT",6)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","EXIT",7)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","EXIT",8)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","EXIT",9)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","G",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","IOP")="1:0:0:0" +^ZZCOVERAGE("%ZIS1","IOP",1)="1:0:0:0" +^ZZCOVERAGE("%ZIS1","K2")="2:0:0:0" +^ZZCOVERAGE("%ZIS1","K2",1)="4:0:0:0" +^ZZCOVERAGE("%ZIS1","K2",2)="4:0:0:0" +^ZZCOVERAGE("%ZIS1","K2",3)="4:0:0:0" +^ZZCOVERAGE("%ZIS1","K2",4)="4:0:0:0" +^ZZCOVERAGE("%ZIS1","KIL",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","KIL",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","KIL",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","L1",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","L1",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","L1",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","L1",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","L1",5)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","L1",6)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","L1",7)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","L1",8)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","L1",9)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","L1",10)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","L1",11)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","L1",12)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","LKUP")="2:0:0:0" +^ZZCOVERAGE("%ZIS1","LKUP",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","LKUP",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","LKUP",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","MAIN",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","R")="1:0:0:0" +^ZZCOVERAGE("%ZIS1","R",0)="1:0:0:0" +^ZZCOVERAGE("%ZIS1","R",1)="1:0:0:0" +^ZZCOVERAGE("%ZIS1","R",2)="1:0:0:0" +^ZZCOVERAGE("%ZIS1","RD",0)="1:0:0:0" +^ZZCOVERAGE("%ZIS1","RD",1)="1:0:0:0" +^ZZCOVERAGE("%ZIS1","RD",2)="1:0:0:0" +^ZZCOVERAGE("%ZIS1","RD",3)="1:0:0:0" +^ZZCOVERAGE("%ZIS1","RD",4)="1:0:0:0" +^ZZCOVERAGE("%ZIS1","RD",5)="1:0:0:0" +^ZZCOVERAGE("%ZIS1","SBR")="1:0:0:0" +^ZZCOVERAGE("%ZIS1","SBR",1)="1:0:0:0" +^ZZCOVERAGE("%ZIS1","SBR",2)="1:0:0:0" +^ZZCOVERAGE("%ZIS1","SBR",3)="1:0:0:0" +^ZZCOVERAGE("%ZIS1","SETQ")="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETQ",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETQ",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETQ",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETQ",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETQ",5)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETVAR",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETVAR",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETVAR",5)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETVAR",7)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETVAR",8)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETVAR",9)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETVAR",10)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETVAR",11)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETVAR",12)="2:0:0:0" +^ZZCOVERAGE("%ZIS1","SETVAR",13)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","CHECK",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","CHECK",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","CHECK",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","CHECK",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","CHECK",5)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","CHECK",6)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","IOPAR")="4:0:0:0" +^ZZCOVERAGE("%ZIS2","IOPAR",0)="4:0:0:0" +^ZZCOVERAGE("%ZIS2","IOPAR",1)="4:0:0:0" +^ZZCOVERAGE("%ZIS2","L2")="2:0:0:0" +^ZZCOVERAGE("%ZIS2","L2",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","OCPU",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","OOS",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","OOS",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","OTHCPU")="2:0:0:0" +^ZZCOVERAGE("%ZIS2","OTHCPU",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","OTHCPU",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","OTHCPU",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","OTHCPU",2,"FOR_LOOP",1)=4 +^ZZCOVERAGE("%ZIS2","OTHCPU",3)="4:0:0:0" +^ZZCOVERAGE("%ZIS2","OTHCPU",4)="4:0:0:0" +^ZZCOVERAGE("%ZIS2","OTHCPU",5)="4:0:0:0" +^ZZCOVERAGE("%ZIS2","OTHCPU",15)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","PTIME",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","QUECHK")="2:0:0:0" +^ZZCOVERAGE("%ZIS2","QUECHK",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","QUECHK",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","QUECHK",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","QUECHK",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","QUECHK",9)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","QUECHK",13)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","SLAVE",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","T2",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","T2",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","TMPVAR",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","TMPVAR",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","TMPVAR",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","TMPVAR",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","TMPVAR",10)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","TMPVAR",11)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","TMPVAR",12)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","TMPVAR",15)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","TMPVAR",16)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","TMPVAR",18)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","VTRM",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS2","VTRM",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","%ZIS3",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","%ZIS3",5)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","%ZIS3",6)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","%ZIS3",8)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","%ZIS3",9)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","%ZIS3",11)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","ALTP",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","ASKMAR",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","ASKMAR",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","MARGN")="2:0:0:0" +^ZZCOVERAGE("%ZIS3","MARGN",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","MARGN",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","MARGN",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","MARGN",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","Q",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","Q",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","Q",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","SETPAR")="2:0:0:0" +^ZZCOVERAGE("%ZIS3","SETPAR",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","SETPAR",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","ST")="2:0:0:0" +^ZZCOVERAGE("%ZIS3","ST",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","ST",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","ST",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","ST",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","STP",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","STP",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","STP",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","STP",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","TRM",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","TRM",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","TRM",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","TRM",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","TRM",5)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","W")="2:0:0:0" +^ZZCOVERAGE("%ZIS3","W",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","W",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS3","W",2)="1:0:0:0" +^ZZCOVERAGE("%ZIS3","W",3)="1:0:0:0" +^ZZCOVERAGE("%ZIS4","O")="2:0:0:0" +^ZZCOVERAGE("%ZIS4","O",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","O",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","O1")="2:0:0:0" +^ZZCOVERAGE("%ZIS4","O1",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","O1",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","O1",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","O1",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","OPAR",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","OPAR",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","OPAR",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","OPAR",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","OPAR",4)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","OPAR",5)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","OPAR",9)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","OPAR",10)="2:0:0:0" +^ZZCOVERAGE("%ZIS4","OPAR",12)="2:0:0:0" +^ZZCOVERAGE("%ZIS6","ANSBAK",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS6","ANSBAK",2)="2:0:0:0" +^ZZCOVERAGE("%ZIS6","ANSBAK",3)="2:0:0:0" +^ZZCOVERAGE("%ZIS6","OXECUTE",1)="2:0:0:0" +^ZZCOVERAGE("%ZIS6","QUIT",0)="2:0:0:0" +^ZZCOVERAGE("%ZIS6","QUIT",1)="2:0:0:0" +^ZZCOVERAGE("%ZISC","C0")="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",1)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",3)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",5)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",6)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",8)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",9)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",10)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",13)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",16)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",17)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",21)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",26)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",27)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",29)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",32)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",33)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",34)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",37)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",41)="1:0:0:0" +^ZZCOVERAGE("%ZISC","C0",43)="1:0:0:0" +^ZZCOVERAGE("%ZISC","CIOS")="1:0:0:0" +^ZZCOVERAGE("%ZISC","CIOS",0)="1:0:0:0" +^ZZCOVERAGE("%ZISC","CIOS",1)="1:0:0:0" +^ZZCOVERAGE("%ZISC","CIOS",2)="1:0:0:0" +^ZZCOVERAGE("%ZISC","CIOS",3)="1:0:0:0" +^ZZCOVERAGE("%ZISC","CIOS",4)="1:0:0:0" +^ZZCOVERAGE("%ZISC","CIOS",5)="1:0:0:0" +^ZZCOVERAGE("%ZISC","CIOS",6)="1:0:0:0" +^ZZCOVERAGE("%ZISC","CIOS",7)="1:0:0:0" +^ZZCOVERAGE("%ZISC","CIOS",8)="1:0:0:0" +^ZZCOVERAGE("%ZISC","CLOSPP")="1:0:0:0" +^ZZCOVERAGE("%ZISC","CLOSPP",0)="1:0:0:0" +^ZZCOVERAGE("%ZISC","CLOSPP",1)="1:0:0:0" +^ZZCOVERAGE("%ZISC","CLOSPP",2)="1:0:0:0" +^ZZCOVERAGE("%ZISC","END",0)="1:0:0:0" +^ZZCOVERAGE("%ZISC","END",2)="1:0:0:0" +^ZZCOVERAGE("%ZISC","END",4)="1:0:0:0" +^ZZCOVERAGE("%ZISC","FF")="1:0:0:0" +^ZZCOVERAGE("%ZISC","FF",0)="1:0:0:0" +^ZZCOVERAGE("%ZISC","FF",1)="1:0:0:0" +^ZZCOVERAGE("%ZISC","FF",2)="1:0:0:0" +^ZZCOVERAGE("%ZISC","RM")="1:0:0:0" +^ZZCOVERAGE("%ZISC","RM",0)="1:0:0:0" +^ZZCOVERAGE("%ZISC","RM",1)="1:0:0:0" +^ZZCOVERAGE("%ZISC","S1",0)="1:0:0:0" +^ZZCOVERAGE("%ZISC","S1",1)="1:0:0:0" +^ZZCOVERAGE("%ZISC","SETIO",2)="1:0:0:0" +^ZZCOVERAGE("%ZISC","SETIO",4)="1:0:0:0" +^ZZCOVERAGE("%ZISC","SETIO",5)="1:0:0:0" +^ZZCOVERAGE("%ZISC","SETIO",6)="1:0:0:0" +^ZZCOVERAGE("%ZISC","SETIO",7)="1:0:0:0" +^ZZCOVERAGE("%ZISC","SETIO",8)="1:0:0:0" +^ZZCOVERAGE("%ZISC","SETIO",9)="1:0:0:0" +^ZZCOVERAGE("%ZISC","SETIO",10)="1:0:0:0" +^ZZCOVERAGE("%ZISC","SETIO",12)="1:0:0:0" +^ZZCOVERAGE("%ZISC","SUBTYPE")="1:0:0:0" +^ZZCOVERAGE("%ZISC","SUBTYPE",1)="1:0:0:0" +^ZZCOVERAGE("%ZISC","SUBTYPE",2)="1:0:0:0" +^ZZCOVERAGE("%ZISC","SUBTYPE",3)="1:0:0:0" +^ZZCOVERAGE("%ZISUTL","LINEPORT")="1:0:0:0" +^ZZCOVERAGE("%ZISUTL","LINEPORT",0)="1:0:0:0" +^ZZCOVERAGE("%ZISUTL","LINEPORT",2)="1:0:0:0" +^ZZCOVERAGE("%ZISUTL","LINEPORT",3)="1:0:0:0" +^ZZCOVERAGE("%ZISUTL","LINEPORT",4)="1:0:0:0" +^ZZCOVERAGE("%ZISUTL","LINEPORT",5)="1:0:0:0" +^ZZCOVERAGE("%ZISUTL","LINEPORT",6)="1:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTIEN")="3:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTIEN",0)="3:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTIEN",1)="3:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTNAM")="3:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTNAM",0)="3:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTNAM",1)="3:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTNAM",2)="3:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTNAM",3)="3:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTNAM",5)="3:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTNAM",6)="3:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTSUB")="2:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTSUB",0)="2:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTSUB",1)="2:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTSUB",2)="2:0:0:0" +^ZZCOVERAGE("%ZISUTL","LNPRTSUB",3)="2:0:0:0" +^ZZCOVERAGE("%ZISUTL","SYMBOL")="2:0:0:0" +^ZZCOVERAGE("%ZISUTL","SYMBOL",0)="2:0:0:0" +^ZZCOVERAGE("%ZISUTL","SYMBOL",1)="2:0:0:0" +^ZZCOVERAGE("%ZISUTL","SYMBOL",3)="2:0:0:0" +^ZZCOVERAGE("%ZISUTL","SYMBOL",4)="2:0:0:0" +^ZZCOVERAGE("%ZISUTL","SYMBOL",5)="2:0:0:0" +^ZZCOVERAGE("%ZISUTL","SYMBOL",5,"FOR_LOOP",1)=40 +^ZZCOVERAGE("%ZISUTL","SYMBOL",6)="40:0:0:0" +^ZZCOVERAGE("%ZISUTL","SYMBOL",10)="2:0:0:0" +^ZZCOVERAGE("%ZOSV","GETENV")="2:0:0:0" +^ZZCOVERAGE("%ZOSV","GETENV",1)="2:0:0:0" +^ZZCOVERAGE("%ZOSV","GETENV",2)="2:0:0:0" +^ZZCOVERAGE("%ZOSV","GETENV",3)="2:0:0:0" +^ZZCOVERAGE("%ZOSV","LGR")="2:0:0:0" +^ZZCOVERAGE("%ZOSV","LGR",0)="2:0:0:0" +^ZZCOVERAGE("%ZOSV","LGR",1)="2:0:0:0" +^ZZCOVERAGE("%ZOSV","PRI")="1:0:0:0" +^ZZCOVERAGE("%ZOSV","PRI",0)="1:0:0:0" +^ZZCOVERAGE("%ZOSV","PRI",3)="1:0:0:0" +^ZZCOVERAGE("%ZOSV","RETURN")="2:0:4000:4000" +^ZZCOVERAGE("%ZOSV","RETURN",0)="2:0:0:0" +^ZZCOVERAGE("%ZOSV","RETURN",2)="2:0:0:0" +^ZZCOVERAGE("%ZOSV","RETURN",3)="2:0:0:0" +^ZZCOVERAGE("%ZOSV","RETURN",4)="2:0:4000:4000" +^ZZCOVERAGE("%ZOSV","RETURN",5)="2:0:0:0" +^ZZCOVERAGE("%ZOSV","RETURN",7)="2:0:0:0" +^ZZCOVERAGE("%ZOSV","TEMP")="2:0:0:0" +^ZZCOVERAGE("%ZOSV","TEMP",0)="2:0:0:0" +^ZZCOVERAGE("%ZOSV","TEMP",2)="2:0:0:0" +^ZZCOVERAGE("%ZOSV2","LOAD")="467:1000060:340019:1340079" +^ZZCOVERAGE("%ZOSV2","LOAD",0)="467:0:0:0" +^ZZCOVERAGE("%ZOSV2","LOAD",1)="467:0:8001:8001" +^ZZCOVERAGE("%ZOSV2","LOAD",2)="467:1000060:320018:1320078" +^ZZCOVERAGE("%ZOSV2","LOAD",2,"FOR_LOOP",1)=45087 +^ZZCOVERAGE("%ZOSV2","LOAD",3)="467:0:12000:12000" +^ZZCOVERAGE("DIALOG","EZBLD")="2:0:4000:4000" +^ZZCOVERAGE("DIALOG","EZBLD",0)="2:0:0:0" +^ZZCOVERAGE("DIALOG","EZBLD",2)="2:0:0:0" +^ZZCOVERAGE("DIALOG","EZBLD",3)="2:0:0:0" +^ZZCOVERAGE("DIALOG","EZBLD",4)="2:0:0:0" +^ZZCOVERAGE("DIALOG","EZBLD",5)="2:0:0:0" +^ZZCOVERAGE("DIALOG","EZBLD",6)="2:0:0:0" +^ZZCOVERAGE("DIALOG","EZBLD",7)="2:0:0:0" +^ZZCOVERAGE("DIALOG","EZBLD",8)="2:0:0:0" +^ZZCOVERAGE("DIALOG","EZBLD",9)="2:0:0:0" +^ZZCOVERAGE("DIALOG","PARAM")="2:0:0:0" +^ZZCOVERAGE("DIALOG","PARAM",0)="4:0:0:0" +^ZZCOVERAGE("DIALOG","PARAM",1)="2:0:0:0" +^ZZCOVERAGE("DIALOG","PARAM",2)="2:0:0:0" +^ZZCOVERAGE("DIALOG","PARAM",3)="2:0:0:0" +^ZZCOVERAGE("DIALOG","Q1",0)="2:0:0:0" +^ZZCOVERAGE("DIALOG","Q2")="2:0:0:0" +^ZZCOVERAGE("DIALOG","Q2",0)="2:0:0:0" +^ZZCOVERAGE("DIALOG","QEZ",0)="2:0:4000:4000" +^ZZCOVERAGE("DIALOG","QEZ",1)="2:0:0:0" +^ZZCOVERAGE("DIALOG","QP",0)="2:0:0:0" +^ZZCOVERAGE("DIC","A1",0)="2:0:0:0" +^ZZCOVERAGE("DIC","ASK",0)="2:0:0:0" +^ZZCOVERAGE("DIC","ASK",1)="2:0:0:0" +^ZZCOVERAGE("DIC","ASK",2)="2:0:0:0" +^ZZCOVERAGE("DIC","ASK",3)="2:0:0:0" +^ZZCOVERAGE("DIC","ASK",4)="2:0:0:0" +^ZZCOVERAGE("DIC","DIC")="2:0:0:0" +^ZZCOVERAGE("DIC","DIC",3)="2:0:0:0" +^ZZCOVERAGE("DIC","DIC",4)="2:0:0:0" +^ZZCOVERAGE("DIC","DIC",5)="2:0:0:0" +^ZZCOVERAGE("DIC","DIC",6)="2:0:0:0" +^ZZCOVERAGE("DIC","EN",0)="2:0:0:0" +^ZZCOVERAGE("DIC","EN",1)="2:0:0:0" +^ZZCOVERAGE("DIC","EN",2)="2:0:0:0" +^ZZCOVERAGE("DIC","EN",3)="2:0:0:0" +^ZZCOVERAGE("DIC","EN",4)="2:0:0:0" +^ZZCOVERAGE("DIC","EN",5)="2:0:0:0" +^ZZCOVERAGE("DIC","EN",6)="2:0:0:0" +^ZZCOVERAGE("DIC","EN",7)="2:0:0:0" +^ZZCOVERAGE("DIC","EN",8)="2:0:0:0" +^ZZCOVERAGE("DIC","EN",9)="2:0:0:0" +^ZZCOVERAGE("DIC","RTN",0)="2:0:0:0" +^ZZCOVERAGE("DIC","RTN",3)="2:0:0:0" +^ZZCOVERAGE("DIC","RTN",6)="2:0:0:0" +^ZZCOVERAGE("DIC","X",1)="2:0:0:0" +^ZZCOVERAGE("DIC","X",4)="2:0:0:0" +^ZZCOVERAGE("DIC","X",5)="2:0:0:0" +^ZZCOVERAGE("DIC","X",6)="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE")="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE",0)="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE",1)="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE",2)="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE",3)="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE",4)="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE",7)="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE",8)="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE",11)="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE",12)="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE",13)="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE",14)="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE",15)="2:0:0:0" +^ZZCOVERAGE("DIC0","GETFILE",16)="2:0:0:0" +^ZZCOVERAGE("DIC0","INIT")="2:0:0:0" +^ZZCOVERAGE("DIC0","INIT",1)="2:0:0:0" +^ZZCOVERAGE("DIC0","INIT",2)="2:0:0:0" +^ZZCOVERAGE("DIC0","INIT",3)="2:0:0:0" +^ZZCOVERAGE("DIC0","INIT",4)="2:0:0:0" +^ZZCOVERAGE("DIC0","INIT",5)="2:0:0:0" +^ZZCOVERAGE("DIC0","INIT",6)="2:0:0:0" +^ZZCOVERAGE("DIC0","INIT",7)="2:0:0:0" +^ZZCOVERAGE("DIC0","INIT",8)="2:0:0:0" +^ZZCOVERAGE("DIC0","SETIEN")="2:0:0:0" +^ZZCOVERAGE("DIC0","SETIEN",0)="2:0:0:0" +^ZZCOVERAGE("DIC0","SETIEN",1)="2:0:0:0" +^ZZCOVERAGE("DIC0","SETIEN",2)="2:0:0:0" +^ZZCOVERAGE("DIC0","SETIEN",3)="2:0:0:0" +^ZZCOVERAGE("DIC0","SETIEN",4)="2:0:0:0" +^ZZCOVERAGE("DIC0","SETIEN",5)="2:0:0:0" +^ZZCOVERAGE("DIC0","SETIEN",5,"FOR_LOOP",1)=2 +^ZZCOVERAGE("DIC0","SETIEN",6)="2:0:0:0" +^ZZCOVERAGE("DIC0","SETIEN",7)="2:0:0:0" +^ZZCOVERAGE("DIC1","B",0)="2:0:0:0" +^ZZCOVERAGE("DIC1","DIC1")="2:0:0:0" +^ZZCOVERAGE("DIC1","DIC1",3)="2:0:0:0" +^ZZCOVERAGE("DIC1","DIC1",4)="2:0:0:0" +^ZZCOVERAGE("DIC1","DIC1",5)="2:0:0:0" +^ZZCOVERAGE("DIC1","DO")="4:0:0:0" +^ZZCOVERAGE("DIC1","DO",1)="4:0:0:0" +^ZZCOVERAGE("DIC1","DO",2)="2:0:0:0" +^ZZCOVERAGE("DIC1","DO2",0)="2:0:0:0" +^ZZCOVERAGE("DIC1","DO2",1)="2:0:0:0" +^ZZCOVERAGE("DIC1","DO2",2)="2:0:0:0" +^ZZCOVERAGE("DIC1","DO2",3)="2:0:0:0" +^ZZCOVERAGE("DIC1","GETFA")="4:0:0:0" +^ZZCOVERAGE("DIC1","GETFA",0)="4:0:0:0" +^ZZCOVERAGE("DIC1","GETFA",2)="4:0:0:0" +^ZZCOVERAGE("DIC1","P",1)="2:0:0:0" +^ZZCOVERAGE("DIC1","P",2)="2:0:0:0" +^ZZCOVERAGE("DIC1","PROMPT",1)="2:0:0:0" +^ZZCOVERAGE("DIC1","PROMPT",2)="2:0:0:0" +^ZZCOVERAGE("DIC1","W",0)="2:0:0:0" +^ZZCOVERAGE("DIC1","W",0,"FOR_LOOP",1)=4 +^ZZCOVERAGE("DIC1","W",1)="3:0:0:0" +^ZZCOVERAGE("DIC1","W",2)="3:0:0:0" +^ZZCOVERAGE("DIC1","W",3)="2:0:0:0" +^ZZCOVERAGE("DIC1","W",4)="2:0:0:0" +^ZZCOVERAGE("DIC1","W",5)="2:0:0:0" +^ZZCOVERAGE("DIC1","W",6)="2:0:0:0" +^ZZCOVERAGE("DIC1","WOV")="1:0:0:0" +^ZZCOVERAGE("DIC1","WOV",0)="1:0:0:0" +^ZZCOVERAGE("DIC1","WOV",1)="1:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT")="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",0)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",1)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",2)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",3)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",3,"FOR_LOOP",1)=2 +^ZZCOVERAGE("DIC11","GETPRMT",4)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",8)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",9)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",10)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",11)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",12)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",13)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",14)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",15)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",16)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",17)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",18)="2:0:0:0" +^ZZCOVERAGE("DIC11","GETPRMT",19)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",0)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",1)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",2)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",3)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",4)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",6)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",8)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",9)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",11)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",12)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",13)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",14)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",15)="2:0:0:0" +^ZZCOVERAGE("DIC11","PR1",16)="2:0:0:0" +^ZZCOVERAGE("DIC11","PROMPT")="2:0:0:0" +^ZZCOVERAGE("DIC11","PROMPT",0)="2:0:0:0" +^ZZCOVERAGE("DIC11","PROMPT",1)="2:0:0:0" +^ZZCOVERAGE("DIC11","PROMPT",1,"FOR_LOOP",1)=2 +^ZZCOVERAGE("DIC11","PROMPT",2)="2:0:0:0" +^ZZCOVERAGE("DIC11","PROMPT",3)="2:0:0:0" +^ZZCOVERAGE("DIC11","PROMPT",5)="2:0:0:0" +^ZZCOVERAGE("DIC2","PGM")="4:0:0:0" +^ZZCOVERAGE("DIC2","PGM",0)="4:0:0:0" +^ZZCOVERAGE("DIC2","PGM",1)="4:0:0:0" +^ZZCOVERAGE("DIC2","PGM",2)="4:0:0:0" +^ZZCOVERAGE("DIC2","Q")="2:0:0:0" +^ZZCOVERAGE("DIC2","Q",0)="2:0:0:0" +^ZZCOVERAGE("DIC2","Q",1)="2:0:0:0" +^ZZCOVERAGE("DIC2","Q",2)="2:0:0:0" +^ZZCOVERAGE("DICL","DINDEX")="2:0:0:0" +^ZZCOVERAGE("DICL","DINDEX",0)="2:0:0:0" +^ZZCOVERAGE("DICL","DINDEX",1)="2:0:0:0" +^ZZCOVERAGE("DICL","DINDEX",2)="2:0:0:0" +^ZZCOVERAGE("DICL","DINDEX",5)="2:0:0:0" +^ZZCOVERAGE("DICL","DINDEX",6)="2:0:0:0" +^ZZCOVERAGE("DICUIX","I1",2)="2:0:0:0" +^ZZCOVERAGE("DICUIX","I1",3)="2:0:0:0" +^ZZCOVERAGE("DICUIX","I1",4)="2:0:0:0" +^ZZCOVERAGE("DICUIX","I1",5)="2:0:0:0" +^ZZCOVERAGE("DICUIX","INDEX")="2:0:0:0" +^ZZCOVERAGE("DICUIX","INDEX",0)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X1",2)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X1",8)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X1",9)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",2)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",3)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",4)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",5)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",8)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",11)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",12)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",13)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",14)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",15)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",15,"FOR_LOOP",1)=2 +^ZZCOVERAGE("DICUIX","X2",16)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",17)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",18)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",19)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",20)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",21)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",22)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",23)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",24)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",25)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",26)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",27)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",28)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",29)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",30)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",31)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",32)="2:0:0:0" +^ZZCOVERAGE("DICUIX","X2",33)="2:0:0:0" +^ZZCOVERAGE("DICUIX","XREF")="2:0:0:0" +^ZZCOVERAGE("DICUIX","XREF",0)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G1",2)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G1",3)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G1",4)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G2",2)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G2",3)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G3",2)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G30",1)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G4",2)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G4",3)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G4",4)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G4",5)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G4",6)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G4",7)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G5",2)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G5",3)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","G5",7)="2:0:0:0" +^ZZCOVERAGE("DICUIX1","GET")="2:0:0:0" +^ZZCOVERAGE("DICUIX1","GET",0)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C1",0)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C1",1)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C2",0)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C2",1)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C3",0)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C3",1)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C3",2)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C3",5)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",0)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",1)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",2)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",3)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",4)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",5)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",6)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",7)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",8)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",9)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",10)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",11)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",12)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",17)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",18)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",23)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C4",24)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C5",0)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C5",1)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C6",0)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C6",18)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C6",19)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C6",20)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C7",0)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","C7",7)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON1")="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON1",1)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON1",2)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON1",3)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON1",4)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON1",5)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON1",6)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON1",7)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON2")="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON2",1)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON2",2)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON2",3)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON2",4)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON2",5)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON2",6)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON2",7)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON2",8)="2:0:0:0" +^ZZCOVERAGE("DICUIX2","COMMON2",9)="2:0:0:0" +^ZZCOVERAGE("DIEFU","IENX",1)="2:0:0:0" +^ZZCOVERAGE("DIEFU","IENX",2)="2:0:0:0" +^ZZCOVERAGE("DIEFU","IENX",3)="2:0:0:0" +^ZZCOVERAGE("DIEFU","IENX",3,"FOR_LOOP",1)=4 +^ZZCOVERAGE("DIEFU","IENX",4)="2:0:0:0" +^ZZCOVERAGE("DIEFU","IENX",5)="2:0:0:0" +^ZZCOVERAGE("DILF","CREF")="4:0:0:0" +^ZZCOVERAGE("DILF","CREF",0)="4:0:0:0" +^ZZCOVERAGE("DILF","IENS")="2:0:0:0" +^ZZCOVERAGE("DILF","IENS",0)="2:0:0:0" +^ZZCOVERAGE("DILF","IENS",1)="2:0:0:0" +^ZZCOVERAGE("DILF","OREF")="2:0:0:0" +^ZZCOVERAGE("DILF","OREF",0)="2:0:0:0" +^ZZCOVERAGE("DILIBF","FNO")="2:0:0:0" +^ZZCOVERAGE("DILIBF","FNO",0)="2:0:0:0" +^ZZCOVERAGE("DILIBF","FNO",1)="2:0:0:0" +^ZZCOVERAGE("DILIBF","FNO",2)="2:0:0:0" +^ZZCOVERAGE("DIQGU","ENCREF",0)="4:0:0:0" +^ZZCOVERAGE("DIQGU","ENOREF",0)="2:0:0:0" +^ZZCOVERAGE("DIQGU","OR2")="2:0:0:0" +^ZZCOVERAGE("DIQGU","OR2",0)="2:0:0:0" +^ZZCOVERAGE("XINDEX","A2",0)="468:0:4000:4000" +^ZZCOVERAGE("XINDEX","A2",1)="467:0:0:0" +^ZZCOVERAGE("XINDEX","A2",2)="467:0:0:0" +^ZZCOVERAGE("XINDEX","A2",3)="467:4000:0:4000" +^ZZCOVERAGE("XINDEX","A2",4)="467:0:4000:4000" +^ZZCOVERAGE("XINDEX","A2",5)="467:0:0:0" +^ZZCOVERAGE("XINDEX","ALIVE",1)="1:0:0:0" +^ZZCOVERAGE("XINDEX","B5",0)="467:188012:220012:408024" +^ZZCOVERAGE("XINDEX","B5",0,"FOR_LOOP",1)=44620 +^ZZCOVERAGE("XINDEX","B5",1)="467:20000:8000:28000" +^ZZCOVERAGE("XINDEX","B5",2)="467:4000:0:4000" +^ZZCOVERAGE("XINDEX","B5",3)="467:0:0:0" +^ZZCOVERAGE("XINDEX","B5",4)="467:4000:0:4000" +^ZZCOVERAGE("XINDEX","B5",5)="467:0:0:0" +^ZZCOVERAGE("XINDEX","BEG")="467:2460149:2872194:5332343" +^ZZCOVERAGE("XINDEX","BEG",1)="467:8000:0:8000" +^ZZCOVERAGE("XINDEX","BEG",2)="467:4000:0:4000" +^ZZCOVERAGE("XINDEX","BEG",3)="467:0:4000:4000" +^ZZCOVERAGE("XINDEX","BEG",4)="467:0:4000:4000" +^ZZCOVERAGE("XINDEX","BEG",5)="467:4001:0:4001" +^ZZCOVERAGE("XINDEX","BEG",7)="467:0:0:0" +^ZZCOVERAGE("XINDEX","BEG",8)="467:0:0:0" +^ZZCOVERAGE("XINDEX","BEG",9)="467:0:0:0" +^ZZCOVERAGE("XINDEX","BEG",11)="467:4000:0:4000" +^ZZCOVERAGE("XINDEX","BEG",12)="467:0:4000:4000" +^ZZCOVERAGE("XINDEX","BEG",14)="467:0:0:0" +^ZZCOVERAGE("XINDEX","BEG",15)="467:0:0:0" +^ZZCOVERAGE("XINDEX","BEG",16)="467:0:0:0" +^ZZCOVERAGE("XINDEX","CD",0)="44620:32001:36002:68003" +^ZZCOVERAGE("XINDEX","CD",1)="44620:40002:60004:100006" +^ZZCOVERAGE("XINDEX","CD",2)="44620:40001:60002:100003" +^ZZCOVERAGE("XINDEX","CD",3)="44620:36002:44004:80006" +^ZZCOVERAGE("XINDEX","CD",4)="44620:28000:40002:68002" +^ZZCOVERAGE("XINDEX","CD",5)="44620:28002:52001:80003" +^ZZCOVERAGE("XINDEX","CD",6)="10770:28003:20000:48003" +^ZZCOVERAGE("XINDEX","CD",6,"FOR_LOOP",1)=57531 +^ZZCOVERAGE("XINDEX","CD",7)="10770:24004:16000:40004" +^ZZCOVERAGE("XINDEX","CD",9)="44620:60005:40004:100009" +^ZZCOVERAGE("XINDEX","CD",10)="44620:44003:48005:92008" +^ZZCOVERAGE("XINDEX","CD",12)="44620:52004:44002:96006" +^ZZCOVERAGE("XINDEX","EE",0)="116081:148007:200014:348021" +^ZZCOVERAGE("XINDEX","EE",1)="71461:44004:44002:88006" +^ZZCOVERAGE("XINDEX","EE",2)="71461:100007:80003:180010" +^ZZCOVERAGE("XINDEX","EE",3)="54870:44001:48001:92002" +^ZZCOVERAGE("XINDEX","EE",4)="53608:88008:100009:188017" +^ZZCOVERAGE("XINDEX","EE",5)="53608:72006:68004:140010" +^ZZCOVERAGE("XINDEX","EE",6)="53608:76005:72004:148009" +^ZZCOVERAGE("XINDEX","EE",8)="53608:60003:64005:124008" +^ZZCOVERAGE("XINDEX","EE",9)="53608:48003:72003:120006" +^ZZCOVERAGE("XINDEX","EE",10)="53608:52002:96008:148010" +^ZZCOVERAGE("XINDEX","EE",13)="53608:52003:44001:96004" +^ZZCOVERAGE("XINDEX","EE",14)="53608:96007:112006:208013" +^ZZCOVERAGE("XINDEX","EE",15)="53608:24001:52004:76005" +^ZZCOVERAGE("XINDEX","EE",16)="53608:52005:88007:140012" +^ZZCOVERAGE("XINDEX","EE",17)="53608:128008:208017:336025" +^ZZCOVERAGE("XINDEX","F")="1559:4000:4001:8001" +^ZZCOVERAGE("XINDEX","F",0)="1559:4000:0:4000" +^ZZCOVERAGE("XINDEX","G")="1932:56003:96009:152012" +^ZZCOVERAGE("XINDEX","G",0)="1932:4000:8002:12002" +^ZZCOVERAGE("XINDEX","H")="11:0:0:0" +^ZZCOVERAGE("XINDEX","H",0)="11:0:0:0" +^ZZCOVERAGE("XINDEX","K")="2218:40001:24002:64003" +^ZZCOVERAGE("XINDEX","K",0)="2218:4000:4000:8000" +^ZZCOVERAGE("XINDEX","K",1)="2218:0:4001:4001" +^ZZCOVERAGE("XINDEX","L")="259:4001:4000:8001" +^ZZCOVERAGE("XINDEX","L",0)="259:0:0:0" +^ZZCOVERAGE("XINDEX","LN",0)="44620:68005:104005:172010" +^ZZCOVERAGE("XINDEX","LN",1)="44620:40001:64004:104005" +^ZZCOVERAGE("XINDEX","LN",2)="5073:12000:4001:16001" +^ZZCOVERAGE("XINDEX","LN",3)="5073:4000:8000:12000" +^ZZCOVERAGE("XINDEX","LN",4)="5073:20001:0:20001" +^ZZCOVERAGE("XINDEX","LN",5)="5073:20003:12002:32005" +^ZZCOVERAGE("XINDEX","LN",6)="5073:12002:16000:28002" +^ZZCOVERAGE("XINDEX","LOAD")="467:88003:196019:284022" +^ZZCOVERAGE("XINDEX","LOAD",0)="467:88003:196019:284022" +^ZZCOVERAGE("XINDEX","LOAD",1)="467:0:0:0" +^ZZCOVERAGE("XINDEX","LOAD",2)="467:0:0:0" +^ZZCOVERAGE("XINDEX","M")="30:4000:0:4000" +^ZZCOVERAGE("XINDEX","M",0)="30:0:0:0" +^ZZCOVERAGE("XINDEX","N")="1721:88005:80004:168009" +^ZZCOVERAGE("XINDEX","N",0)="1721:4000:0:4000" +^ZZCOVERAGE("XINDEX","POSTRTN")="467:108009:96003:204012" +^ZZCOVERAGE("XINDEX","POSTRTN",1)="467:0:0:0" +^ZZCOVERAGE("XINDEX","POSTRTN",2)="467:0:0:0" +^ZZCOVERAGE("XINDEX","POSTRTN",3)="467:12000:8000:20000" +^ZZCOVERAGE("XINDEX","POSTRTN",3,"FOR_LOOP",1)=2558 +^ZZCOVERAGE("XINDEX","POSTRTN",4)="2091:0:0:0" +^ZZCOVERAGE("XINDEX","POSTRTN",5)="2044:4000:0:4000" +^ZZCOVERAGE("XINDEX","POSTRTN",6)="2044:4000:0:4000" +^ZZCOVERAGE("XINDEX","POSTRTN",9)="2044:0:0:0" +^ZZCOVERAGE("XINDEX","POSTRTN",10)="467:0:4000:4000" +^ZZCOVERAGE("XINDEX","POSTRTN",11)="467:12002:16001:28003" +^ZZCOVERAGE("XINDEX","POSTRTN",11,"FOR_LOOP",1)=5540 +^ZZCOVERAGE("XINDEX","POSTRTN",12)="5073:0:4000:4000" +^ZZCOVERAGE("XINDEX","POSTRTN",13)="5073:8000:4000:12000" +^ZZCOVERAGE("XINDEX","POSTRTN",14)="5073:0:0:0" +^ZZCOVERAGE("XINDEX","POSTRTN",15)="467:0:0:0" +^ZZCOVERAGE("XINDEX","POSTRTN",16)="467:28001:20001:48002" +^ZZCOVERAGE("XINDEX","POSTRTN",16,"FOR_LOOP",1)=16376 +^ZZCOVERAGE("XINDEX","POSTRTN",17)="15909:40006:40001:80007" +^ZZCOVERAGE("XINDEX","POSTRTN",18)="15909:0:0:0" +^ZZCOVERAGE("XINDEX","POSTRTN",19)="467:0:0:0" +^ZZCOVERAGE("XINDEX","Q")="7762:12000:20001:32001" +^ZZCOVERAGE("XINDEX","Q",0)="7762:4000:16001:20001" +^ZZCOVERAGE("XINDEX","QUOTE")="36371:188012:232009:420021" +^ZZCOVERAGE("XINDEX","QUOTE",0)="36371:156010:192008:348018" +^ZZCOVERAGE("XINDEX","QUOTE",0,"FOR_LOOP",1)=323268 +^ZZCOVERAGE("XINDEX","QUOTE",1)="36371:20002:20001:40003" +^ZZCOVERAGE("XINDEX","R")="85:0:8001:8001" +^ZZCOVERAGE("XINDEX","R",0)="85:0:0:0" +^ZZCOVERAGE("XINDEX","S")="17549:716055:988057:1704112" +^ZZCOVERAGE("XINDEX","S",0)="17549:28003:28003:56006" +^ZZCOVERAGE("XINDEX","SE2",0)="86891:176010:272017:448027" +^ZZCOVERAGE("XINDEX","SE2",1)="85079:264015:376016:640031" +^ZZCOVERAGE("XINDEX","SE2",2)="85079:72005:112010:184015" +^ZZCOVERAGE("XINDEX","SEP")="107216:736054:648038:1384092" +^ZZCOVERAGE("XINDEX","SEP",0)="107216:580045:440030:1020075" +^ZZCOVERAGE("XINDEX","SEP",0,"FOR_LOOP",1)=1019212 +^ZZCOVERAGE("XINDEX","SEP",1)="107216:120007:144005:264012" +^ZZCOVERAGE("XINDEX","SET")="85079:772044:1124063:1896107" +^ZZCOVERAGE("XINDEX","SET",0)="85079:176007:168008:344015" +^ZZCOVERAGE("XINDEX","SET",0,"FOR_LOOP",1)=74812 +^ZZCOVERAGE("XINDEX","SET",1)="85079:64005:144010:208015" +^ZZCOVERAGE("XINDEX","ST",0)="44620:68001:56004:124005" +^ZZCOVERAGE("XINDEX","ST",2)="44620:260012:376038:636050" +^ZZCOVERAGE("XINDEX","ST",2,"FOR_LOOP",1)=85813 +^ZZCOVERAGE("XINDEX","ST",2,"FOR_LOOP",2)=126272 +^ZZCOVERAGE("XINDEX","ST",3)="44620:224014:184014:408028" +^ZZCOVERAGE("XINDEX","ST",4)="44620:0:0:0" +^ZZCOVERAGE("XINDEX","U")="72:0:0:0" +^ZZCOVERAGE("XINDEX","U",0)="72:0:0:0" +^ZZCOVERAGE("XINDEX","W")="4584:156009:200014:356023" +^ZZCOVERAGE("XINDEX","W",0)="4584:0:16001:16001" +^ZZCOVERAGE("XINDEX","X")="220:0:0:0" +^ZZCOVERAGE("XINDEX","X",0)="220:0:0:0" +^ZZCOVERAGE("XINDEX","XINDEX")="1:32002:36000:68002" +^ZZCOVERAGE("XINDEX","XINDEX",3)="1:0:0:0" +^ZZCOVERAGE("XINDX1","A",0)="75:0:4000:4000" +^ZZCOVERAGE("XINDX1","A",1)="75:0:0:0" +^ZZCOVERAGE("XINDX1","A",2)="75:0:0:0" +^ZZCOVERAGE("XINDX1","B",0)="75:0:0:0" +^ZZCOVERAGE("XINDX1","B",4)="75:0:0:0" +^ZZCOVERAGE("XINDX1","B",6)="75:0:0:0" +^ZZCOVERAGE("XINDX1","B",7)="75:0:0:0" +^ZZCOVERAGE("XINDX1","E")="73:0:4000:4000" +^ZZCOVERAGE("XINDX1","E",0)="73:0:0:0" +^ZZCOVERAGE("XINDX1","XINDX1")="2:0:0:0" +^ZZCOVERAGE("XINDX1","XINDX1",3)="2:0:0:0" +^ZZCOVERAGE("XINDX10","ASK")="1:0:0:0" +^ZZCOVERAGE("XINDX10","ASK",1)="1:0:0:0" +^ZZCOVERAGE("XINDX10","ASK",2)="1:0:0:0" +^ZZCOVERAGE("XINDX10","ASK",3)="1:0:0:0" +^ZZCOVERAGE("XINDX10","ASK",8)="1:0:0:0" +^ZZCOVERAGE("XINDX2","%")="44620:132010:232014:364024" +^ZZCOVERAGE("XINDX2","%",0)="44620:96008:92005:188013" +^ZZCOVERAGE("XINDX2","%",0,"FOR_LOOP",1)=62810 +^ZZCOVERAGE("XINDX2","%",1)="44620:16001:68003:84004" +^ZZCOVERAGE("XINDX2","ARG")="329774:1516089:2124136:3640225" +^ZZCOVERAGE("XINDX2","ARG",1)="330498:328020:360021:688041" +^ZZCOVERAGE("XINDX2","ARG",2)="262221:228015:296022:524037" +^ZZCOVERAGE("XINDX2","ARG",3)="226556:260020:468034:728054" +^ZZCOVERAGE("XINDX2","ARG",4)="126854:104004:160011:264015" +^ZZCOVERAGE("XINDX2","ARG",5)="117750:136007:148011:284018" +^ZZCOVERAGE("XINDX2","ARG",6)="88629:60001:96003:156004" +^ZZCOVERAGE("XINDX2","ARG",7)="88424:80005:100006:180011" +^ZZCOVERAGE("XINDX2","ARG",8)="86550:72002:108007:180009" +^ZZCOVERAGE("XINDX2","ARGG")="18715:288018:352019:640037" +^ZZCOVERAGE("XINDX2","ARGG",0)="18715:76007:84005:160012" +^ZZCOVERAGE("XINDX2","ARGG",0,"FOR_LOOP",1)=49672 +^ZZCOVERAGE("XINDX2","ARGS")="44410:464031:676031:1140062" +^ZZCOVERAGE("XINDX2","ARGS",1)="63125:620038:844037:1464075" +^ZZCOVERAGE("XINDX2","ARGS",1,"FOR_LOOP",1)=291597 +^ZZCOVERAGE("XINDX2","ARGS",2)="63125:24001:60004:84005" +^ZZCOVERAGE("XINDX2","DN")="44410:208011:284017:492028" +^ZZCOVERAGE("XINDX2","DN",0)="44410:44003:108008:152011" +^ZZCOVERAGE("XINDX2","DN",1)="44410:152008:144006:296014" +^ZZCOVERAGE("XINDX2","EXT",1)="1970:4000:8001:12001" +^ZZCOVERAGE("XINDX2","EXT",2)="1970:0:0:0" +^ZZCOVERAGE("XINDX2","EXT",3)="1970:8001:12001:20002" +^ZZCOVERAGE("XINDX2","EXT",4)="1970:0:4000:4000" +^ZZCOVERAGE("XINDX2","FLUSH")="94:0:0:0" +^ZZCOVERAGE("XINDX2","FLUSH",0)="94:0:0:0" +^ZZCOVERAGE("XINDX2","FLUSH",1)="94:0:0:0" +^ZZCOVERAGE("XINDX2","FLUSH",1,"FOR_LOOP",1)=415 +^ZZCOVERAGE("XINDX2","FLUSH",2)="94:0:0:0" +^ZZCOVERAGE("XINDX2","FNC")="12:0:0:0" +^ZZCOVERAGE("XINDX2","FNC",0)="12:0:0:0" +^ZZCOVERAGE("XINDX2","FNC",1)="12:0:0:0" +^ZZCOVERAGE("XINDX2","FNC",2)="12:0:0:0" +^ZZCOVERAGE("XINDX2","FNC",3)="12:0:0:0" +^ZZCOVERAGE("XINDX2","FNC",4)="12:0:0:0" +^ZZCOVERAGE("XINDX2","FUN")="29121:340019:424027:764046" +^ZZCOVERAGE("XINDX2","FUN",0)="29121:36004:40002:76006" +^ZZCOVERAGE("XINDX2","FUN",1)="23452:48002:72003:120005" +^ZZCOVERAGE("XINDX2","FUN",2)="23452:20000:44003:64003" +^ZZCOVERAGE("XINDX2","FUN",3)="23393:96004:56005:152009" +^ZZCOVERAGE("XINDX2","FUN",3,"FOR_LOOP",1)=147754 +^ZZCOVERAGE("XINDX2","FUN",4)="23393:48003:56005:104008" +^ZZCOVERAGE("XINDX2","FUN",5)="23393:60004:92005:152009" +^ZZCOVERAGE("XINDX2","GLO",0)="9104:28002:28001:56003" +^ZZCOVERAGE("XINDX2","GLO",1)="9104:12001:20001:32002" +^ZZCOVERAGE("XINDX2","GLO",2)="9104:16000:28001:44001" +^ZZCOVERAGE("XINDX2","GLO",3)="9104:36002:80004:116006" +^ZZCOVERAGE("XINDX2","GLO",4)="9104:8000:4000:12000" +^ZZCOVERAGE("XINDX2","INC")="322910:416022:652029:1068051" +^ZZCOVERAGE("XINDX2","INC",0)="365505:320019:472020:792039" +^ZZCOVERAGE("XINDX2","INC2")="42595:104006:148008:252014" +^ZZCOVERAGE("XINDX2","INC2",0)="42595:48001:40003:88004" +^ZZCOVERAGE("XINDX2","LOC")="99702:576031:736052:1312083" +^ZZCOVERAGE("XINDX2","LOC",0)="99702:144010:156013:300023" +^ZZCOVERAGE("XINDX2","LOC",1)="99702:124004:148011:272015" +^ZZCOVERAGE("XINDX2","LOC",2)="99702:212011:272014:484025" +^ZZCOVERAGE("XINDX2","LOC",3)="99702:52005:96006:148011" +^ZZCOVERAGE("XINDX2","NAK",0)="996:0:0:0" +^ZZCOVERAGE("XINDX2","NAK",1)="996:0:0:0" +^ZZCOVERAGE("XINDX2","PAT")="205:4000:0:4000" +^ZZCOVERAGE("XINDX2","PAT",0)="205:0:0:0" +^ZZCOVERAGE("XINDX2","PAT",1)="205:4000:0:4000" +^ZZCOVERAGE("XINDX2","PAT",1,"FOR_LOOP",1)=457 +^ZZCOVERAGE("XINDX2","PAT",2)="205:0:0:0" +^ZZCOVERAGE("XINDX2","PATCODE")="457:4000:4000:8000" +^ZZCOVERAGE("XINDX2","PATCODE",0)="457:0:4000:4000" +^ZZCOVERAGE("XINDX2","PATCODE",1)="358:4000:0:4000" +^ZZCOVERAGE("XINDX2","PATCODE",1,"FOR_LOOP",1)=791 +^ZZCOVERAGE("XINDX2","PATCODE",2)="358:0:0:0" +^ZZCOVERAGE("XINDX2","PATCODE",3)="358:0:0:0" +^ZZCOVERAGE("XINDX2","PATCODE",4)="358:0:0:0" +^ZZCOVERAGE("XINDX2","PATQ")="99:4000:4000:8000" +^ZZCOVERAGE("XINDX2","PATQ",0)="99:0:4000:4000" +^ZZCOVERAGE("XINDX2","PATQ",0,"FOR_LOOP",1)=247 +^ZZCOVERAGE("XINDX2","PATQ",1)="99:4000:0:4000" +^ZZCOVERAGE("XINDX2","PATQ",2)="99:0:0:0" +^ZZCOVERAGE("XINDX2","PEEK")="112687:168013:248022:416035" +^ZZCOVERAGE("XINDX2","PEEK",0)="112687:120009:164010:284019" +^ZZCOVERAGE("XINDX2","PEEKDN")="17373:56002:40000:96002" +^ZZCOVERAGE("XINDX2","PEEKDN",0)="17373:48002:32000:80002" +^ZZCOVERAGE("XINDX2","REPCNT")="457:0:0:0" +^ZZCOVERAGE("XINDX2","REPCNT",0)="457:0:0:0" +^ZZCOVERAGE("XINDX2","REPCNT",0,"FOR_LOOP",1)=1004 +^ZZCOVERAGE("XINDX2","REPCNT",1)="457:0:0:0" +^ZZCOVERAGE("XINDX2","REPCNT",2)="457:0:0:0" +^ZZCOVERAGE("XINDX2","SPV",1)="3699:0:8001:8001" +^ZZCOVERAGE("XINDX2","SPV",2)="3699:0:0:0" +^ZZCOVERAGE("XINDX2","ST")="110835:464030:648049:1112079" +^ZZCOVERAGE("XINDX2","ST",0)="110835:192009:248021:440030" +^ZZCOVERAGE("XINDX2","ST",1)="110835:100008:156011:256019" +^ZZCOVERAGE("XINDX2","ST",2)="110835:76005:116005:192010" +^ZZCOVERAGE("XINDX2","TEXT",0)="59:0:0:0" +^ZZCOVERAGE("XINDX2","TEXT",1)="59:0:0:0" +^ZZCOVERAGE("XINDX2","TEXT",2)="59:0:0:0" +^ZZCOVERAGE("XINDX2","TEXT",3)="59:0:0:0" +^ZZCOVERAGE("XINDX2","UP")="44410:116012:180012:296024" +^ZZCOVERAGE("XINDX2","UP",1)="44410:112012:116006:228018" +^ZZCOVERAGE("XINDX2","VA")="5073:16001:20000:36001" +^ZZCOVERAGE("XINDX2","VA",0)="5073:4000:12000:16000" +^ZZCOVERAGE("XINDX2","VA",1)="5073:8000:4000:12000" +^ZZCOVERAGE("XINDX2","VT")="10205:4001:24002:28003" +^ZZCOVERAGE("XINDX2","VT",0)="10205:0:8000:8000" +^ZZCOVERAGE("XINDX2","VT",1)="10205:0:4000:4000" +^ZZCOVERAGE("XINDX3","A",0)="8136:36001:12001:48002" +^ZZCOVERAGE("XINDX3","ASM")="312:12001:0:12001" +^ZZCOVERAGE("XINDX3","ASM",0)="312:0:0:0" +^ZZCOVERAGE("XINDX3","ASM",1)="312:8001:0:8001" +^ZZCOVERAGE("XINDX3","ASM",1,"FOR_LOOP",1)=2110 +^ZZCOVERAGE("XINDX3","ASM",2)="312:0:0:0" +^ZZCOVERAGE("XINDX3","DN")="498:4000:4000:8000" +^ZZCOVERAGE("XINDX3","DN",0)="498:0:4000:4000" +^ZZCOVERAGE("XINDX3","DN",1)="498:4000:0:4000" +^ZZCOVERAGE("XINDX3","FL")="63250:152007:260014:412021" +^ZZCOVERAGE("XINDX3","FL",1)="63250:72000:144009:216009" +^ZZCOVERAGE("XINDX3","FL",2)="63250:64006:80004:144010" +^ZZCOVERAGE("XINDX3","INC")="145482:224018:308026:532044" +^ZZCOVERAGE("XINDX3","INC",0)="145482:188015:196015:384030" +^ZZCOVERAGE("XINDX3","KL",1)="2218:0:4000:4000" +^ZZCOVERAGE("XINDX3","KL1")="28:0:0:0" +^ZZCOVERAGE("XINDX3","KL1",0)="28:0:0:0" +^ZZCOVERAGE("XINDX3","KL2")="724:4000:28000:32000" +^ZZCOVERAGE("XINDX3","KL2",0)="724:0:0:0" +^ZZCOVERAGE("XINDX3","KL2",1)="724:0:4000:4000" +^ZZCOVERAGE("XINDX3","KL2",2)="724:0:0:0" +^ZZCOVERAGE("XINDX3","KL3")="3320:12002:36002:48004" +^ZZCOVERAGE("XINDX3","KL3",0)="3320:4000:8000:12000" +^ZZCOVERAGE("XINDX3","KL3",1)="3320:4001:4000:8001" +^ZZCOVERAGE("XINDX3","KL5",0)="3320:0:20002:20002" +^ZZCOVERAGE("XINDX3","MULT")="498:8001:4000:12001" +^ZZCOVERAGE("XINDX3","MULT",0)="498:4001:0:4001" +^ZZCOVERAGE("XINDX3","MULT",1)="498:4000:4000:8000" +^ZZCOVERAGE("XINDX3","MULT",1,"FOR_LOOP",1)=2401 +^ZZCOVERAGE("XINDX3","MULT",2)="498:0:0:0" +^ZZCOVERAGE("XINDX3","N2",0)="23604:68004:36003:104007" +^ZZCOVERAGE("XINDX3","N2",3)="11802:16002:4000:20002" +^ZZCOVERAGE("XINDX3","N2",4)="187:0:0:0" +^ZZCOVERAGE("XINDX3","N2",5)="187:0:0:0" +^ZZCOVERAGE("XINDX3","N2",6)="11628:12001:20002:32003" +^ZZCOVERAGE("XINDX3","N2",7)="11628:12000:8000:20000" +^ZZCOVERAGE("XINDX3","NE")="779:32002:16001:48003" +^ZZCOVERAGE("XINDX3","NE",1)="2500:4000:4000:8000" +^ZZCOVERAGE("XINDX3","NE",2)="2500:4000:20000:24000" +^ZZCOVERAGE("XINDX3","PEEK")="498:0:0:0" +^ZZCOVERAGE("XINDX3","PEEK",0)="498:0:0:0" +^ZZCOVERAGE("XINDX3","PEEKDN")="39:0:0:0" +^ZZCOVERAGE("XINDX3","PEEKDN",0)="39:0:0:0" +^ZZCOVERAGE("XINDX3","RD",0)="85:0:0:0" +^ZZCOVERAGE("XINDX3","RD1",0)="278:0:4001:4001" +^ZZCOVERAGE("XINDX3","RD1",3)="193:0:4000:4000" +^ZZCOVERAGE("XINDX3","RD1",4)="85:0:0:0" +^ZZCOVERAGE("XINDX3","RD1",5)="85:0:0:0" +^ZZCOVERAGE("XINDX3","RD2")="85:0:4000:4000" +^ZZCOVERAGE("XINDX3","RD2",0)="255:0:0:0" +^ZZCOVERAGE("XINDX3","RD2",1)="170:0:0:0" +^ZZCOVERAGE("XINDX3","RD2",2)="170:0:4000:4000" +^ZZCOVERAGE("XINDX3","RD2",3)="85:0:0:0" +^ZZCOVERAGE("XINDX3","RD3")="108:0:0:0" +^ZZCOVERAGE("XINDX3","RD3",0)="161:0:0:0" +^ZZCOVERAGE("XINDX3","RD3",1)="37:0:0:0" +^ZZCOVERAGE("XINDX3","RD3",2)="37:0:0:0" +^ZZCOVERAGE("XINDX3","S",1)="17579:48005:56003:104008" +^ZZCOVERAGE("XINDX3","S2",0)="110559:164008:220011:384019" +^ZZCOVERAGE("XINDX3","S2",1)="92980:64007:96005:160012" +^ZZCOVERAGE("XINDX3","S2",2)="92980:52004:100005:152009" +^ZZCOVERAGE("XINDX3","S2",3)="87238:60005:68003:128008" +^ZZCOVERAGE("XINDX3","S2",4)="63916:68007:68004:136011" +^ZZCOVERAGE("XINDX3","S2",5)="846:0:0:0" +^ZZCOVERAGE("XINDX3","S2",6)="846:0:4000:4000" +^ZZCOVERAGE("XINDX3","S2",10)="63916:56004:60003:116007" +^ZZCOVERAGE("XINDX3","S2",11)="62481:40002:60003:100005" +^ZZCOVERAGE("XINDX3","S2",12)="62313:56003:56005:112008" +^ZZCOVERAGE("XINDX3","S2",13)="61815:76007:152010:228017" +^ZZCOVERAGE("XINDX3","UP")="498:8000:4000:12000" +^ZZCOVERAGE("XINDX3","UP",1)="498:8000:4000:12000" +^ZZCOVERAGE("XINDX3","VLN",1)="15909:32002:16001:48003" +^ZZCOVERAGE("XINDX3","VLN",2)="15909:44002:28003:72005" +^ZZCOVERAGE("XINDX3","VLNF")="15909:120006:60005:180011" +^ZZCOVERAGE("XINDX3","VLNF",0)="15909:32002:12001:44003" +^ZZCOVERAGE("XINDX4","CNG")="2186:0:24001:24001" +^ZZCOVERAGE("XINDX4","CNG",0)="2186:0:0:0" +^ZZCOVERAGE("XINDX4","CNG",2)="2186:0:8001:8001" +^ZZCOVERAGE("XINDX4","CNG",2,"FOR_LOOP",1)=2202 +^ZZCOVERAGE("XINDX4","CNG",3)="2186:0:12000:12000" +^ZZCOVERAGE("XINDX4","DG",0)="8937:20003:16000:36003" +^ZZCOVERAGE("XINDX4","DG",1)="8937:12000:16001:28001" +^ZZCOVERAGE("XINDX4","DG",2)="8937:8001:20002:28003" +^ZZCOVERAGE("XINDX4","DG",3)="8937:16000:12000:28000" +^ZZCOVERAGE("XINDX4","DG",4)="8937:4000:12001:16001" +^ZZCOVERAGE("XINDX4","DG",5)="8937:0:12002:12002" +^ZZCOVERAGE("XINDX4","DG",6)="8937:12001:12000:24001" +^ZZCOVERAGE("XINDX4","DG",7)="8937:12000:20003:32003" +^ZZCOVERAGE("XINDX4","DG",8)="8937:24001:4001:28002" +^ZZCOVERAGE("XINDX4","DG",9)="8937:4000:12001:16001" +^ZZCOVERAGE("XINDX4","DG",10)="8937:16001:28001:44002" +^ZZCOVERAGE("XINDX4","DG",11)="8937:8000:12000:20000" +^ZZCOVERAGE("XINDX4","DG",12)="8937:4000:16002:20002" +^ZZCOVERAGE("XINDX4","DG",13)="8937:8000:12002:20002" +^ZZCOVERAGE("XINDX4","DG",14)="8937:0:4000:4000" +^ZZCOVERAGE("XINDX4","DG",15)="8937:36002:32002:68004" +^ZZCOVERAGE("XINDX4","DG",16)="8937:8001:4001:12002" +^ZZCOVERAGE("XINDX4","DG",17)="8387:12002:4000:16002" +^ZZCOVERAGE("XINDX4","DG1")="8449:168011:180013:348024" +^ZZCOVERAGE("XINDX4","DG1",0)="8449:12001:16001:28002" +^ZZCOVERAGE("XINDX4","FR",0)="525:0:4001:4001" +^ZZCOVERAGE("XINDX4","FR",1)="525:0:0:0" +^ZZCOVERAGE("XINDX4","FR",2)="525:0:0:0" +^ZZCOVERAGE("XINDX4","INSIDE")="2202:4001:32001:36002" +^ZZCOVERAGE("XINDX4","INSIDE",0)="2202:0:16000:16000" +^ZZCOVERAGE("XINDX4","INSIDE",1)="2202:0:4000:4000" +^ZZCOVERAGE("XINDX4","INSIDE",2)="2202:4001:4000:8001" +^ZZCOVERAGE("XINDX4","LO",1)="259:0:0:0" +^ZZCOVERAGE("XINDX4","LO",2)="259:0:0:0" +^ZZCOVERAGE("XINDX4","LO",3)="259:0:0:0" +^ZZCOVERAGE("XINDX4","LO",4)="259:0:4000:4000" +^ZZCOVERAGE("XINDX4","LO",4,"FOR_LOOP",1)=260 +^ZZCOVERAGE("XINDX4","LO",5)="260:0:0:0" +^ZZCOVERAGE("XINDX4","LO",6)="260:0:0:0" +^ZZCOVERAGE("XINDX4","LO",7)="260:0:0:0" +^ZZCOVERAGE("XINDX4","LO",8)="89:0:0:0" +^ZZCOVERAGE("XINDX4","LO",9)="89:0:0:0" +^ZZCOVERAGE("XINDX4","LO",10)="89:4001:0:4001" +^ZZCOVERAGE("XINDX4","LO",12)="259:0:0:0" +^ZZCOVERAGE("XINDX4","LO",13)="259:0:0:0" +^ZZCOVERAGE("XINDX4","LOOP")="14735:44003:108008:152011" +^ZZCOVERAGE("XINDX4","LOOP",0)="14735:28002:72005:100007" +^ZZCOVERAGE("XINDX4","LOOP",0,"FOR_LOOP",1)=68121 +^ZZCOVERAGE("XINDX4","LOOP",1)="14735:4000:32003:36003" +^ZZCOVERAGE("XINDX4","PAREN")="2638:24000:36004:60004" +^ZZCOVERAGE("XINDX4","PAREN",0)="2638:4000:8000:12000" +^ZZCOVERAGE("XINDX4","PAREN",1)="2638:20000:16001:36001" +^ZZCOVERAGE("XINDX4","PAREN",1,"FOR_LOOP",1)=50171 +^ZZCOVERAGE("XINDX4","PAREN",2)="2638:0:8002:8002" +^ZZCOVERAGE("XINDX4","PAREN",3)="2638:0:0:0" +^ZZCOVERAGE("XINDX4","PRUNE")="2186:8001:16001:24002" +^ZZCOVERAGE("XINDX4","PRUNE",0)="2186:8001:4000:12001" +^ZZCOVERAGE("XINDX4","PRUNE",1)="2186:0:8001:8001" +^ZZCOVERAGE("XINDX4","PRUNE",1,"FOR_LOOP",1)=2186 +^ZZCOVERAGE("XINDX4","PRUNE",2)="2186:0:4000:4000" +^ZZCOVERAGE("XINDX4","PRUNE",2,"FOR_LOOP",1)=2187 +^ZZCOVERAGE("XINDX4","PRUNE",3)="2186:0:0:0" +^ZZCOVERAGE("XINDX4","Q",1)="747:8000:0:8000" +^ZZCOVERAGE("XINDX4","Q",2)="747:0:0:0" +^ZZCOVERAGE("XINDX4","QUOTE")="2402:28002:28000:56002" +^ZZCOVERAGE("XINDX4","QUOTE",0)="2402:20002:20000:40002" +^ZZCOVERAGE("XINDX4","QUOTE",0,"FOR_LOOP",1)=23674 +^ZZCOVERAGE("XINDX4","QUOTE",1)="2402:0:0:0" +^ZZCOVERAGE("XINDX4","QUOTE",2)="2402:8000:4000:12000" +^ZZCOVERAGE("XINDX4","ST")="8937:24000:16002:40002" +^ZZCOVERAGE("XINDX4","ST",0)="8937:12000:8000:20000" +^ZZCOVERAGE("XINDX4","ST",1)="8937:8000:8002:16002" +^ZZCOVERAGE("XINDX4","WR",0)="4584:12001:12000:24001" +^ZZCOVERAGE("XINDX4","WR",1)="4584:0:8000:8000" +^ZZCOVERAGE("XINDX4","WR",2)="4584:72004:56006:128010" +^ZZCOVERAGE("XINDX4","WR",2,"FOR_LOOP",1)=27607 +^ZZCOVERAGE("XINDX4","WR",3)="23023:8002:32003:40005" +^ZZCOVERAGE("XINDX4","WR",4)="20835:12000:32001:44001" +^ZZCOVERAGE("XINDX4","WR",5)="20835:24002:8001:32003" +^ZZCOVERAGE("XINDX4","WR",6)="20835:24000:36002:60002" +^ZZCOVERAGE("XINDX4","WR",7)="20835:0:0:0" +^ZZCOVERAGE("XINDX4","WR",8)="4584:4000:0:4000" +^ZZCOVERAGE("XINDX4","XE",0)="220:0:0:0" +^ZZCOVERAGE("XINDX4","XE",1)="220:0:0:0" +^ZZCOVERAGE("XINDX5","A",0)="468:0:4000:4000" +^ZZCOVERAGE("XINDX5","A",1)="467:28002:24000:52002" +^ZZCOVERAGE("XINDX5","A",1,"FOR_LOOP",1)=4011 +^ZZCOVERAGE("XINDX5","A",2)="467:0:0:0" +^ZZCOVERAGE("XINDX5","AA")="3544:48004:68006:116010" +^ZZCOVERAGE("XINDX5","AA",0)="3544:8002:16003:24005" +^ZZCOVERAGE("XINDX5","AA",1)="1902:0:4000:4000" +^ZZCOVERAGE("XINDX5","AA",2)="1902:4001:0:4001" +^ZZCOVERAGE("XINDX5","AA",3)="1902:12001:4001:16002" +^ZZCOVERAGE("XINDX5","AA",4)="1902:12000:32002:44002" +^ZZCOVERAGE("XINDX5","AA",5)="1902:0:0:0" +^ZZCOVERAGE("XINDX5","AA",6)="1209:0:0:0" +^ZZCOVERAGE("XINDX5","AA",7)="1209:8000:4000:12000" +^ZZCOVERAGE("XINDX5","AA",8)="1209:0:0:0" +^ZZCOVERAGE("XINDX5","AA",9)="1642:0:4000:4000" +^ZZCOVERAGE("XINDX5","AA",10)="1594:0:0:0" +^ZZCOVERAGE("XINDX5","AA",11)="1594:4000:4000:8000" +^ZZCOVERAGE("XINDX5","AA",12)="1642:0:0:0" +^ZZCOVERAGE("XINDX5","B",0)="1:0:0:0" +^ZZCOVERAGE("XINDX5","CLEAN",1)="1:0:0:0" +^ZZCOVERAGE("XINDX5","CLEAN",2)="1:0:0:0" +^ZZCOVERAGE("XINDX5","CLEAN",3)="1:0:0:0" +^ZZCOVERAGE("XINDX5","END",0)="1:0:0:0" +^ZZCOVERAGE("XINDX5","END",1)="1:0:0:0" +^ZZCOVERAGE("XINDX5","END",2)="1:0:0:0" +^ZZCOVERAGE("XINDX5","END",3)="1:0:0:0" +^ZZCOVERAGE("XINDX5","VTAG")="4320:12000:16001:28001" +^ZZCOVERAGE("XINDX5","VTAG",0)="4320:12000:8001:20001" +^ZZCOVERAGE("XINDX5","VTAG",1)="4320:0:4000:4000" +^ZZCOVERAGE("XINDX5","XINDX5",3)="1:0:0:0" +^ZZCOVERAGE("XINDX5","XINDX5",4)="1:0:0:0" +^ZZCOVERAGE("XINDX5","XINDX5",5)="1:0:0:0" +^ZZCOVERAGE("XINDX5","XINDX5",7)="1:0:0:0" +^ZZCOVERAGE("XINDX51","B")="1:0:4001:4001" +^ZZCOVERAGE("XINDX51","B",0)="1:0:0:0" +^ZZCOVERAGE("XINDX51","B",1)="1:0:0:0" +^ZZCOVERAGE("XINDX51","B",3)="1:0:4001:4001" +^ZZCOVERAGE("XINDX51","B",3,"FOR_LOOP",1)=468 +^ZZCOVERAGE("XINDX51","B",4)="1:0:0:0" +^ZZCOVERAGE("XINDX51","B",6)="1:0:0:0" +^ZZCOVERAGE("XINDX51","BHDR")="60:0:4000:4000" +^ZZCOVERAGE("XINDX51","BHDR",0)="60:0:4000:4000" +^ZZCOVERAGE("XINDX51","BHDR",1)="60:0:0:0" +^ZZCOVERAGE("XINDX51","END",0)="1:0:0:0" +^ZZCOVERAGE("XINDX51","HD")="60:0:0:0" +^ZZCOVERAGE("XINDX51","HD",0)="60:0:0:0" +^ZZCOVERAGE("XINDX51","HD",1)="60:0:0:0" +^ZZCOVERAGE("XINDX51","HD1")="1:0:0:0" +^ZZCOVERAGE("XINDX51","HD1",0)="1:0:0:0" +^ZZCOVERAGE("XINDX51","HD1",1)="1:0:0:0" +^ZZCOVERAGE("XINDX51","HD2")="60:4000:0:4000" +^ZZCOVERAGE("XINDX51","HD2",0)="60:4000:0:4000" +^ZZCOVERAGE("XINDX51","HD2",1)="60:0:0:0" +^ZZCOVERAGE("XINDX51","WAIT")="1:0:0:0" +^ZZCOVERAGE("XINDX51","WAIT",0)="1:0:0:0" +^ZZCOVERAGE("XINDX51","WAIT",1)="1:0:0:0" +^ZZCOVERAGE("XINDX51","WAIT",2)="1:0:0:0" +^ZZCOVERAGE("XINDX51","WERR")="60:0:0:0" +^ZZCOVERAGE("XINDX51","WERR",0)="60:0:0:0" +^ZZCOVERAGE("XINDX51","WERR",1)="60:0:0:0" +^ZZCOVERAGE("XINDX51","WERR",2)="60:0:0:0" +^ZZCOVERAGE("XINDX51","WERR",2,"FOR_LOOP",1)=135 +^ZZCOVERAGE("XINDX51","WERR",3)="75:0:0:0" +^ZZCOVERAGE("XINDX51","WERR",4)="75:0:0:0" +^ZZCOVERAGE("XINDX51","WERR",5)="75:0:0:0" +^ZZCOVERAGE("XINDX51","WERR",6)="75:0:0:0" +^ZZCOVERAGE("XINDX51","WERR",7)="60:0:0:0" +^ZZCOVERAGE("XINDX51","WORL")="70:0:0:0" +^ZZCOVERAGE("XINDX51","WORL",0)="70:0:0:0" +^ZZCOVERAGE("XINDX51","WORL",1)="70:0:0:0" +^ZZCOVERAGE("XINDX51","WORL",2)="70:0:0:0" +^ZZCOVERAGE("XINDX51","WORL",3)="70:0:0:0" +^ZZCOVERAGE("XINDX51","WORL",3,"FOR_LOOP",1)=76 +^ZZCOVERAGE("XINDX51","WORL",4)="70:0:0:0" +^ZZCOVERAGE("XINDX52","CASE")="2:0:0:0" +^ZZCOVERAGE("XINDX52","CASE",0)="2:0:0:0" +^ZZCOVERAGE("XINDX52","CASE",1)="2:0:0:0" +^ZZCOVERAGE("XINDX6","ANS")="2:0:0:0" +^ZZCOVERAGE("XINDX6","ANS",0)="2:0:0:0" +^ZZCOVERAGE("XINDX6","ANS",1)="2:0:0:0" +^ZZCOVERAGE("XINDX6","ANS",1,"FOR_LOOP",1)=2 +^ZZCOVERAGE("XINDX6","ANS",2)="2:0:0:0" +^ZZCOVERAGE("XINDX6","ASKRTN")="1:4000:0:4000" +^ZZCOVERAGE("XINDX6","ASKRTN",1)="1:0:0:0" +^ZZCOVERAGE("XINDX6","ASKRTN",1,"FOR_LOOP",1)=468 +^ZZCOVERAGE("XINDX6","ASKRTN",2)="1:4000:0:4000" +^ZZCOVERAGE("XINDX6","ASKRTN",2,"FOR_LOOP",1)=468 +^ZZCOVERAGE("XINDX6","ASKRTN",3)="1:0:0:0" +^ZZCOVERAGE("XINDX6","DEVICE",0)="1:0:0:0" +^ZZCOVERAGE("XINDX6","DEVICE",2)="1:0:0:0" +^ZZCOVERAGE("XINDX6","DEVICE",3)="1:0:0:0" +^ZZCOVERAGE("XINDX6","L7",0)="1:0:0:0" +^ZZCOVERAGE("XINDX6","L7",1)="1:0:0:0" +^ZZCOVERAGE("XINDX6","NY")="1:0:0:0" +^ZZCOVERAGE("XINDX6","NY",0)="1:0:0:0" +^ZZCOVERAGE("XINDX6","PARAM")="1:0:0:0" +^ZZCOVERAGE("XINDX6","PARAM",1)="1:0:0:0" +^ZZCOVERAGE("XINDX6","PARAM",2)="1:0:0:0" +^ZZCOVERAGE("XINDX6","PARAM",2,"FOR_LOOP",1)=10 +^ZZCOVERAGE("XINDX6","PARAM",3)="1:0:0:0" +^ZZCOVERAGE("XINDX6","PARAM",4)="1:0:0:0" +^ZZCOVERAGE("XINDX6","PARAM",5)="1:0:0:0" +^ZZCOVERAGE("XINDX6","PARAM",6)="1:0:0:0" +^ZZCOVERAGE("XINDX6","PARAM",7)="1:0:0:0" +^ZZCOVERAGE("XINDX6","RD")="2:0:0:0" +^ZZCOVERAGE("XINDX6","RD",0)="2:0:0:0" +^ZZCOVERAGE("XINDX6","XINDX6",5)="1:0:0:0" +^ZZCOVERAGE("XINDX6","XINDX6",6)="1:0:0:0" +^ZZCOVERAGE("XINDX6","XINDX6",7)="1:0:0:0" +^ZZCOVERAGE("XINDX6","XINDX6",8)="1:0:0:0" +^ZZCOVERAGE("XINDX6","XINDX6",9)="1:0:0:0" +^ZZCOVERAGE("XINDX6","XINDX6",10)="1:0:0:0" +^ZZCOVERAGE("XINDX6","XINDX6",11)="1:0:0:0" +^ZZCOVERAGE("XINDX6","XINDX6",12)="1:0:0:0" +^ZZCOVERAGE("XINDX6","XINDX6",13)="1:0:0:0" +^ZZCOVERAGE("XINDX6","YN")="1:0:0:0" +^ZZCOVERAGE("XINDX6","YN",0)="1:0:0:0" +^ZZCOVERAGE("XINDX7","BUILD")="1:0:0:0" +^ZZCOVERAGE("XINDX7","BUILD",0)="1:0:0:0" +^ZZCOVERAGE("XINDX7","BUILD",1)="1:0:0:0" +^ZZCOVERAGE("XINDX7","BUILD",1,"FOR_LOOP",1)=10 +^ZZCOVERAGE("XINDX7","BUILD",2)="9:0:0:0" +^ZZCOVERAGE("XINDX7","BUILD",3)="6:0:0:0" +^ZZCOVERAGE("XINDX7","BUILD",3,"FOR_LOOP",1)=85 +^ZZCOVERAGE("XINDX7","BUILD",4)="79:0:0:0" +^ZZCOVERAGE("XINDX7","BUILD",5)="79:0:0:0" +^ZZCOVERAGE("XINDX7","BUILD",6)="6:0:0:0" +^ZZCOVERAGE("XINDX7","BUILD",7)="1:0:0:0" +^ZZCOVERAGE("XINDX7","HDR")="2:0:0:0" +^ZZCOVERAGE("XINDX7","HDR",0)="2:0:0:0" +^ZZCOVERAGE("XINDX7","HDR",1)="2:0:0:0" +^ZZCOVERAGE("XINDX7","HDR",2)="1:0:0:0" +^ZZCOVERAGE("XINDX7","HDR",3)="1:0:0:0" +^ZZCOVERAGE("XINDX7","HDR",4)="1:0:0:0" +^ZZCOVERAGE("XINDX7","HDR",5)="1:0:0:0" +^ZZCOVERAGE("XINDX7","HDR",6)="2:0:0:0" +^ZZCOVERAGE("XINDX7","HDR",7)="2:0:0:0" +^ZZCOVERAGE("XINDX7","SETUP")="1:0:0:0" +^ZZCOVERAGE("XINDX7","SETUP",1)="1:0:0:0" +^ZZCOVERAGE("XINDX7","SETUP",2)="1:0:0:0" +^ZZCOVERAGE("XINDX7","SETUP",3)="1:0:0:0" +^ZZCOVERAGE("XINDX7","SETUP",4)="1:0:0:0" +^ZZCOVERAGE("XINDX7","SETUP",6)="1:0:0:0" +^ZZCOVERAGE("XINDX7","SETUP",7)="1:0:0:0" +^ZZCOVERAGE("XINDX7","SETUP",7,"FOR_LOOP",1)=468 +^ZZCOVERAGE("XINDX7","SETUP",8)="1:0:0:0" +^ZZCOVERAGE("XINDX7","SETUP",9)="1:0:0:0" +^ZZCOVERAGE("XINDX7","SETUP",10)="1:0:0:0" +^ZZCOVERAGE("XINDX9","ADD")="406841:436032:684041:1120073" +^ZZCOVERAGE("XINDX9","ADD",0)="598820:552042:692040:1244082" +^ZZCOVERAGE("XINDX9","AR")="197699:748039:1052073:1800112" +^ZZCOVERAGE("XINDX9","AR",0)="197699:708036:936061:1644097" +^ZZCOVERAGE("XINDX9","CASE")="23461:28003:92005:120008" +^ZZCOVERAGE("XINDX9","CASE",0)="23461:12002:48003:60005" +^ZZCOVERAGE("XINDX9","CASE",1)="23461:12001:28000:40001" +^ZZCOVERAGE("XINDX9","DN")="45002:204010:248016:452026" +^ZZCOVERAGE("XINDX9","DN",0)="45002:176008:196011:372019" +^ZZCOVERAGE("XINDX9","DN",1)="45002:16001:24003:40004" +^ZZCOVERAGE("XINDX9","EXT",1)="1970:4000:12001:16001" +^ZZCOVERAGE("XINDX9","FNC")="29146:96005:104009:200014" +^ZZCOVERAGE("XINDX9","FNC",0)="29146:28001:20003:48004" +^ZZCOVERAGE("XINDX9","FNC",1)="29146:44002:72005:116007" +^ZZCOVERAGE("XINDX9","FNC",2)="12:0:0:0" +^ZZCOVERAGE("XINDX9","FNC",3)="12:0:0:0" +^ZZCOVERAGE("XINDX9","FUNC")="29134:284015:400024:684039" +^ZZCOVERAGE("XINDX9","FUNC",1)="29134:112005:120007:232012" +^ZZCOVERAGE("XINDX9","FUNC",2)="23461:48003:72004:120007" +^ZZCOVERAGE("XINDX9","FUNC",3)="23461:20000:32001:52001" +^ZZCOVERAGE("XINDX9","FX",0)="23461:68004:116009:184013" +^ZZCOVERAGE("XINDX9","GVAR")="29134:96004:180015:276019" +^ZZCOVERAGE("XINDX9","GVAR",0)="29134:28000:44003:72003" +^ZZCOVERAGE("XINDX9","GVAR",1)="29134:32001:72005:104006" +^ZZCOVERAGE("XINDX9","GVAR",2)="29134:16000:24002:40002" +^ZZCOVERAGE("XINDX9","INC")="29134:64003:64007:128010" +^ZZCOVERAGE("XINDX9","INC",0)="29134:20001:12001:32002" +^ZZCOVERAGE("XINDX9","INC",1)="29134:32002:40004:72006" +^ZZCOVERAGE("XINDX9","NEW")="287703:532032:660032:1192064" +^ZZCOVERAGE("XINDX9","NEW",0)="287703:200012:244014:444026" +^ZZCOVERAGE("XINDX9","NEW",1)="287703:220014:248008:468022" +^ZZCOVERAGE("XINDX9","NUM")="45379:292023:340026:632049" +^ZZCOVERAGE("XINDX9","NUM",0)="45379:92006:84006:176012" +^ZZCOVERAGE("XINDX9","NUM",0,"FOR_LOOP",1)=71145 +^ZZCOVERAGE("XINDX9","NUM",1)="45379:40005:48002:88007" +^ZZCOVERAGE("XINDX9","NUM",2)="45379:40004:56005:96009" +^ZZCOVERAGE("XINDX9","NUM",3)="45379:76003:88008:164011" +^ZZCOVERAGE("XINDX9","NUM",4)="45379:24003:40003:64006" +^ZZCOVERAGE("XINDX9","PA2",0)="518346:544028:668032:1212060" +^ZZCOVERAGE("XINDX9","PA2",1)="472665:532043:620035:1152078" +^ZZCOVERAGE("XINDX9","PA2",2)="317803:264019:292021:556040" +^ZZCOVERAGE("XINDX9","PA2",3)="317803:200013:324018:524031" +^ZZCOVERAGE("XINDX9","PA2",4)="307072:348020:492025:840045" +^ZZCOVERAGE("XINDX9","PA2",5)="197397:160015:296011:456026" +^ZZCOVERAGE("XINDX9","PA2",6)="152018:120016:132005:252021" +^ZZCOVERAGE("XINDX9","PA2",7)="152018:116009:112008:228017" +^ZZCOVERAGE("XINDX9","PA2",8)="151813:96008:168010:264018" +^ZZCOVERAGE("XINDX9","PA2",9)="151813:100008:172009:272017" +^ZZCOVERAGE("XINDX9","PA2",10)="151813:220008:324022:544030" +^ZZCOVERAGE("XINDX9","PA2",11)="151813:168011:152010:320021" +^ZZCOVERAGE("XINDX9","PA2",12)="151813:128009:148012:276021" +^ZZCOVERAGE("XINDX9","PA2",13)="151813:136005:104009:240014" +^ZZCOVERAGE("XINDX9","PARSE")="45681:3356226:4340257:7696483" +^ZZCOVERAGE("XINDX9","PARSE",0)="45681:104007:108007:212014" +^ZZCOVERAGE("XINDX9","PAT")="205:0:0:0" +^ZZCOVERAGE("XINDX9","PAT",0)="205:0:0:0" +^ZZCOVERAGE("XINDX9","PAT",1)="205:0:0:0" +^ZZCOVERAGE("XINDX9","PAT",1,"FOR_LOOP",1)=1185 +^ZZCOVERAGE("XINDX9","PAT",2)="205:0:0:0" +^ZZCOVERAGE("XINDX9","PAT",3)="205:0:0:0" +^ZZCOVERAGE("XINDX9","PAT",4)="205:0:0:0" +^ZZCOVERAGE("XINDX9","PATC")="28:0:0:0" +^ZZCOVERAGE("XINDX9","PATC",0)="28:0:0:0" +^ZZCOVERAGE("XINDX9","PATQ")="99:0:8000:8000" +^ZZCOVERAGE("XINDX9","PATQ",0)="99:0:0:0" +^ZZCOVERAGE("XINDX9","PATQ",0,"FOR_LOOP",1)=247 +^ZZCOVERAGE("XINDX9","PATQ",1)="99:0:0:0" +^ZZCOVERAGE("XINDX9","PATQ",2)="99:0:8000:8000" +^ZZCOVERAGE("XINDX9","PATU")="15:0:0:0" +^ZZCOVERAGE("XINDX9","PATU",0)="15:0:0:0" +^ZZCOVERAGE("XINDX9","PEND",0)="45681:68001:140014:208015" +^ZZCOVERAGE("XINDX9","PEND",1)="45681:36004:52005:88009" +^ZZCOVERAGE("XINDX9","QUOTE")="35724:244013:304019:548032" +^ZZCOVERAGE("XINDX9","QUOTE",0)="36272:172010:140009:312019" +^ZZCOVERAGE("XINDX9","QUOTE",0,"FOR_LOOP",1)=323021 +^ZZCOVERAGE("XINDX9","QUOTE",1)="36272:28001:72004:100005" +^ZZCOVERAGE("XINDX9","QUOTE",2)="35724:28001:24003:52004" +^ZZCOVERAGE("XINDX9","QUOTE",3)="35724:16001:52002:68003" +^ZZCOVERAGE("XINDX9","SPV",0)="3703:4000:12000:16000" +^ZZCOVERAGE("XINDX9","SPV",1)="3703:8001:4000:12001" +^ZZCOVERAGE("XINDX9","SPV",2)="3703:8001:4000:12001" +^ZZCOVERAGE("XINDX9","SPV",3)="3703:4000:8001:12001" +^ZZCOVERAGE("XINDX9","STR")="287703:560037:724043:1284080" +^ZZCOVERAGE("XINDX9","STR",0)="287703:300018:312020:612038" +^ZZCOVERAGE("XINDX9","SUM")="213322:612034:916052:1528086" +^ZZCOVERAGE("XINDX9","SUM",0)="213322:160009:208011:368020" +^ZZCOVERAGE("XINDX9","SUM",1)="213322:212007:280018:492025" +^ZZCOVERAGE("XINDX9","SUM",2)="213322:136012:268012:404024" +^ZZCOVERAGE("XINDX9","UP")="45002:396026:440029:836055" +^ZZCOVERAGE("XINDX9","UP",0)="45002:24003:44001:68004" +^ZZCOVERAGE("XINDX9","UP",1)="45002:180008:192016:372024" +^ZZCOVERAGE("XINDX9","UP",2)="45002:136010:128005:264015" +^ZZCOVERAGE("XINDX9","UP",3)="45002:40003:52003:92006" +^ZZCOVERAGE("XINDX9","VAR")="138809:828044:1004072:1832116" +^ZZCOVERAGE("XINDX9","VAR",0)="138809:376018:336017:712035" +^ZZCOVERAGE("XINDX9","VAR",0,"FOR_LOOP",1)=462128 +^ZZCOVERAGE("XINDX9","VAR",1)="138809:292018:376034:668052" +^ZZCOVERAGE("XINDX9","VAR",2)="138809:116003:144008:260011" +^ZZCOVERAGE("XINDX9","XINDX9")="45681:296016:320021:616037" +^ZZCOVERAGE("XINDX9","XINDX9",3)="45681:52003:128006:180009" +^ZZCOVERAGE("XINDX9","XINDX9",4)="45681:164006:112008:276014" +^ZZCOVERAGE("XINDX9","XINDX9",4,"FOR_LOOP",1)=128269 +^ZZCOVERAGE("XINDX9","XINDX9",5)="45681:48004:52005:100009" +^ZZCOVERAGE("XLFDT","DT")="1:0:0:0" +^ZZCOVERAGE("XLFDT","DT",0)="1:0:0:0" +^ZZCOVERAGE("XLFDT","DT",1)="1:0:0:0" +^ZZCOVERAGE("XLFDT","HR")="3:0:0:0" +^ZZCOVERAGE("XLFDT","HR",0)="3:0:0:0" +^ZZCOVERAGE("XLFDT","HR",1)="3:0:0:0" +^ZZCOVERAGE("XLFDT","HTE")="1:0:0:0" +^ZZCOVERAGE("XLFDT","HTE",0)="1:0:0:0" +^ZZCOVERAGE("XLFDT","HTE",1)="1:0:0:0" +^ZZCOVERAGE("XLFDT","HTE",2)="1:0:0:0" +^ZZCOVERAGE("XLFDT","HTE",3)="1:0:0:0" +^ZZCOVERAGE("XLFDT","HTFM")="2:0:0:0" +^ZZCOVERAGE("XLFDT","HTFM",0)="2:0:0:0" +^ZZCOVERAGE("XLFDT","HTFM",1)="2:0:0:0" +^ZZCOVERAGE("XLFDT","HTFM",2)="2:0:0:0" +^ZZCOVERAGE("XLFDT","HTFM",3)="2:0:0:0" +^ZZCOVERAGE("XLFDT","HTFM",4)="2:0:0:0" +^ZZCOVERAGE("XLFDT","HTFM",5)="2:0:0:0" +^ZZCOVERAGE("XLFDT","T2",0)="1:0:0:0" +^ZZCOVERAGE("XLFDT","T2",1)="1:0:0:0" +^ZZCOVERAGE("XLFDT","YMD")="2:0:0:0" +^ZZCOVERAGE("XLFDT","YMD",1)="2:0:0:0" +^ZZCOVERAGE("XLFDT","YMD",2)="2:0:0:0" +^ZZCOVERAGE("XLFDT","YMD",3)="2:0:0:0" +^ZZCOVERAGE("XLFDT","YMD",4)="2:0:0:0" +^ZZCOVERAGE("XLFDT","YMD",5)="2:0:0:0" +^ZZCOVERAGE("XLFDT1","F1",1)="1:0:0:0" +^ZZCOVERAGE("XLFDT1","FMT")="1:0:0:0" +^ZZCOVERAGE("XLFDT1","FMT",1)="1:0:0:0" +^ZZCOVERAGE("XLFDT1","FMT",2)="1:0:0:0" +^ZZCOVERAGE("XLFDT1","M")="1:0:0:0" +^ZZCOVERAGE("XLFDT1","M",0)="1:0:0:0" +^ZZCOVERAGE("XLFDT1","TM",1)="1:0:0:0" +^ZZCOVERAGE("XLFDT1","TM",2)="1:0:0:0" +^ZZCOVERAGE("XLFDT1","TM",3)="1:0:0:0" +^ZZCOVERAGE("XLFDT1","TM",7)="1:0:0:0" +^ZZCOVERAGE("XPDRSUM","SUMB")="467:1808124:180014:1988138" +^ZZCOVERAGE("XPDRSUM","SUMB",0)="467:8000:0:8000" +^ZZCOVERAGE("XPDRSUM","SUMB",2)="467:0:0:0" +^ZZCOVERAGE("XPDRSUM","SUMB",3)="467:1796124:180014:1976138" +^ZZCOVERAGE("XPDRSUM","SUMB",3,"FOR_LOOP",1)=44620 +^ZZCOVERAGE("XPDRSUM","SUMB",3,"FOR_LOOP",2)=1566704 +^ZZCOVERAGE("XPDRSUM","SUMB",4)="467:0:0:0" +^ZZCOVERAGE("XTRUTL1","BUILD")="1:0:0:0" +^ZZCOVERAGE("XTRUTL1","BUILD",0)="1:0:0:0" +^ZZCOVERAGE("XTRUTL1","BUILD",1)="1:0:0:0" +^ZZCOVERAGE("XTRUTL1","BUILD",2)="1:0:0:0" +^ZZCOVERAGE("XTRUTL1","BUILD",3)="1:0:0:0" + + diff --git a/Tests/MumpsCoverage/DartConfiguration.cache.tcl.in b/Tests/MumpsCoverage/DartConfiguration.cache.tcl.in new file mode 100644 index 0000000..a1c6b17 --- /dev/null +++ b/Tests/MumpsCoverage/DartConfiguration.cache.tcl.in @@ -0,0 +1,8 @@ +# This file is configured by CMake automatically as DartConfiguration.tcl +# If you choose not to use CMake, this file may be hand configured, by +# filling in the required variables. + + +# Configuration directories and files +SourceDirectory: ${CMake_SOURCE_DIR}/Testing/MumpsCoverage +BuildDirectory: ${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage diff --git a/Tests/MumpsCoverage/DartConfiguration.tcl.in b/Tests/MumpsCoverage/DartConfiguration.tcl.in new file mode 100644 index 0000000..2d7eaa5 --- /dev/null +++ b/Tests/MumpsCoverage/DartConfiguration.tcl.in @@ -0,0 +1,8 @@ +# This file is configured by CMake automatically as DartConfiguration.tcl +# If you choose not to use CMake, this file may be hand configured, by +# filling in the required variables. + + +# Configuration directories and files +SourceDirectory: ${CMake_SOURCE_DIR}/Testing/MumpsCoverage +BuildDirectory: ${CMake_BINARY_DIR}/Testing/MumpsCoverage diff --git a/Tests/MumpsCoverage/VistA-FOIA/Packages/Toolkit/Routines/XINDEX.m b/Tests/MumpsCoverage/VistA-FOIA/Packages/Toolkit/Routines/XINDEX.m new file mode 100644 index 0000000..b045221 --- /dev/null +++ b/Tests/MumpsCoverage/VistA-FOIA/Packages/Toolkit/Routines/XINDEX.m @@ -0,0 +1,144 @@ +XINDEX ;ISC/REL,GFT,GRK,RWF - INDEX & CROSS-REFERENCE ;08/04/08 13:19 + ;;7.3;TOOLKIT;**20,27,48,61,66,68,110,121,128**;Apr 25, 1995;Build 1 + ; Per VHA Directive 2004-038, this routine should not be modified. + G ^XINDX6 +SEP F I=1:1 S CH=$E(LIN,I) D QUOTE:CH=Q Q:" "[CH + S ARG=$E(LIN,1,I-1) S:CH=" " I=I+1 S LIN=$E(LIN,I,999) Q +QUOTE F I=I+1:1 S CH=$E(LIN,I) Q:CH=""!(CH=Q) + Q:CH]"" S ERR=6 G ^XINDX1 +ALIVE ;enter here from taskman + D SETUP^XINDX7 ;Get ready to process +A2 S RTN=$O(^UTILITY($J,RTN)) G ^XINDX5:RTN="" + S INDLC=(RTN?1"|"1.4L.NP) D LOAD:'INDLC + I $D(ZTQUEUED),$$S^%ZTLOAD S RTN="~",IND("QUIT")=1,ZTSTOP=1 G A2 + I 'INDDS,INDLC W !!?10,"Data Dictionaries",! S INDDS=1 + D BEG + G A2 + ; +LOAD S X=RTN,XCNP=0,DIF="^UTILITY("_$J_",1,RTN,0," X ^%ZOSF("TEST") Q:'$T X ^%ZOSF("LOAD") S ^UTILITY($J,1,RTN,0,0)=XCNP-1 + I $D(^UTILITY($J,1,RTN,0,0)) S ^UTILITY($J,1,RTN,"RSUM")="B"_$$SUMB^XPDRSUM($NA(^UTILITY($J,1,RTN,0))) + Q +BEG ; + S %=INDLC*5 W:$X+10+%>IOM ! W RTN,$J("",10+%-$L(RTN)) + S (IND("DO"),IND("SZT"),IND("SZC"),LABO)=0,LC=$G(^UTILITY($J,1,RTN,0,0)) + I LC="" W !,">>>Routine '",RTN,"' not found <<<",! Q + S TXT="",LAB=$P(^UTILITY($J,1,RTN,0,1,0)," ") I RTN'=$P(LAB,"(") D E^XINDX1(17) + I 'INDLC,LAB["(" D E^XINDX1(55) S LAB=$P(LAB,"(") + ;if M routine(not compiled template or DD) and has more than 2 lines, check lines 1 & 2 + I 'INDLC,LC>2 D + . N LABO S LABO=1 + . S LIN=$G(^UTILITY($J,1,RTN,0,1,0)),TXT=1 + . ;check 1st line (site/dev - ) patch 128 + . I $P(LIN,";",2,4)'?.E1"/".E.1"-".E D E^XINDX1(62) + . S LIN=$G(^UTILITY($J,1,RTN,0,2,0)),TXT=2 + . ;check 2nd line (;;nn.nn[TV]nn;package;.anything) + . I $P(LIN,";",3,99)'?1.2N1"."1.2N.1(1"T",1"V").2N1";"1A.AP1";".E D E^XINDX1(44) ;patch 121 + . I $L(INP(11)) X INP(11) ;Version number check + . I $L(INP(12)) X INP(12) ;Patch number check +B5 F TXT=1:1:LC S LIN=^UTILITY($J,1,RTN,0,TXT,0),LN=$L(LIN),IND("SZT")=IND("SZT")+LN+2 D LN,ST ;Process Line + S LAB="",LABO=0,TXT=0,^UTILITY($J,1,RTN,0)=IND("SZT")_"^"_LC_"^"_IND("SZC") + I IND("SZT")>INP("MAX"),'INDLC S ERR=35,ERR(1)=IND("SZT") D ^XINDX1 + I IND("SZT")-IND("SZC")>INP("CMAX"),'INDLC S ERR=58,ERR(1)=IND("SZT")-IND("SZC") D ^XINDX1 + D POSTRTN + Q + ;Proccess one line, LN = Length, LIN = Line. +LN K V S (ARG,GRB,IND("COM"),IND("DOL"),IND("F"))="",X=$P(LIN," ") + I '$L(X) S LABO=LABO+1 G CD + S (IND("COM"),LAB)=$P(X,"("),ARG=$P($P(X,"(",2),")"),LABO=0,IND("PP")=X?1.8E1"(".E1")" + D:$L(ARG) NE^XINDX3 ;Process formal parameters as New list. + I 'INDLC,'$$VT^XINDX2(LAB) D E^XINDX1($S(LAB=$$CASE^XINDX52(LAB):37,1:55)) ;Check for bad labels + I $D(^UTILITY($J,1,RTN,"T",LAB)) D E^XINDX1(15) G CD ;DUP label + S ^UTILITY($J,1,RTN,"T",LAB)="" +CD I LN>245 D:'(LN=246&($E(RTN,1,3)="|dd")) E^XINDX1(19) ;patch 119 + D:LIN'?1.ANP E^XINDX1(18) + S LIN=$P(LIN," ",2,999),IND("LCC")=1 + I LIN="" D E^XINDX1(42) Q ;Blank line ;p110 + S I=0 ;Watch the scope of I, counts dots + I " ."[$E(LIN) D S X=$L($E(LIN,1,I),".")-1,LIN=$E(LIN,I,999) + . F I=1:1:245 Q:". "'[$E(LIN,I) + . Q + ;check dots against Do level IND("DO"), IND("DOL")=dot level + D:'I&$G(IND("DO1")) E^XINDX1(51) S IND("DO1")=0 S:'I IND("DO")=0 + I I D:X>IND("DO") E^XINDX1(51) S (IND("DO"),IND("DOL"))=X + ;Count Comment lines, skip ;; lines + I $E(LIN)=";",$E(LIN,2)'=";" S IND("SZC")=IND("SZC")+$L(LIN) ;p110 + ;Process commands on line. +EE I LIN="" D ^XINDX2 Q + S COM=$E(LIN),GK="",ARG="" + I COM=";" S LIN="" G EE ;p110 + I COM=" " S ERR=$S(LIN?1." ":13,1:0),LIN=$S(ERR:"",1:$E(LIN,2,999)) D:ERR ^XINDX1 G EE + D SEP + S CM=$P(ARG,":",1),POST=$P(ARG,":",2,999),IND("COM")=IND("COM")_$C(9)_COM,ERR=48 + D:ARG[":"&(POST']"") ^XINDX1 S:POST]"" GRB=GRB_$C(9)_POST,IND("COM")=IND("COM")_":" + ;SAC now allows lowercase commands + I CM?.E1L.E S CM=$$CASE^XINDX52(CM),COM=$E(CM) ;I IND("LCC") S IND("LCC")=0 D E^XINDX1(47) + I CM="" D E^XINDX1(21) G EE ;Missing command + S CX=$G(IND("CMD",CM)) I CX="" D G:CX="" EE + . I $E(CM)="Z" S CX="^Z" Q ;Proccess Z commands + . D E^XINDX1(1) S LIN="" Q + S CX=$P(CX,"^",2,9) + D SEP I '$L(LIN),CH=" " D E^XINDX1(13) ;trailing space + I ARG="","CGJMORSUWX"[COM S ERR=49 G ^XINDX1 + I CX>0 D E^XINDX1(CX) S CX="" + D:$L(CX) @CX S:ARG'="" GRB=GRB_$C(9)_ARG G EE +B S ERR=25 G ^XINDX1 +C S ERR=29 G ^XINDX1 +D G DG1^XINDX4 +E Q:ARG="" S ERR=7 G ^XINDX1 +F G:ARG]"" FR^XINDX4 S IND("F")=1 Q +G G DG^XINDX4 +H Q:ARG'="" S ERR=32 G ^XINDX1 +J S ERR=36,ARG="" G ^XINDX1 +K S ERR=$S(ARG?1"(".E:22,ARG?." ":23,1:0) D:ERR ^XINDX1 + G KL^XINDX3 +L G LO^XINDX4 +M G S^XINDX3 +N G NE^XINDX3 +O S ERR=34 D ^XINDX1,O^XINDX3 Q +Q Q:ARG="" G Q^XINDX4 +R S RDTIME=0 G RD^XINDX3 +S G S^XINDX3 +TR Q ;What to process. p110 +U S ARG=$P(ARG,":") Q +V S ARG="",ERR=20 G ^XINDX1 +W G WR^XINDX4 +X G XE^XINDX4 +Z S ERR=2 D ^XINDX1 G ZC^XINDX4 + ; + ;Save off items from line. +ST S R=LAB_$S(LABO:"+"_LABO,1:"") + ;Local variable, Global, Marked Items, Naked global, Internal ref, eXternal ref., Tag ref. + S LOC="" F S LOC=$O(V(LOC)),S="" Q:LOC="" F S S=$O(V(LOC,S)) Q:S="" D SET + S ^UTILITY($J,1,RTN,"COM",TXT)=IND("COM") + Q + ; +SET I V(LOC,S)]"" F %="!","~" I V(LOC,S)[%,$G(^UTILITY($J,1,RTN,LOC,S))'[% S ^(S)=$G(^(S))_% + S %=0 +SE2 S ARG=$G(^UTILITY($J,1,RTN,LOC,S,%)) I $L(ARG)>230 S %=%+1 G SE2 + S ^UTILITY($J,1,RTN,LOC,S,%)=ARG_R_V(LOC,S)_"," + Q + ; +POSTRTN ;Do more overall checking + N V,E,T,T1,T2 + S T="" ;Check for missing Labels + F S T=$O(^UTILITY($J,1,RTN,"I",T)),T2=T Q:T="" S T1=$G(^(T,0)) D + . Q:$E(T2,1,2)="@(" + . S:$E(T2,1,2)="$$" T2=$E(T2,3,99) + . I T2]"",'$D(^UTILITY($J,1,RTN,"T",$P(T2,"+",1))) D + . . F I=1:1:$L(T1,",")-1 S LAB=$P(T1,",",I),LABO=+$P(LAB,"+",2),LAB=$P(LAB,"+"),E=14,E(1)=T D E^XINDX1(.E) + . . Q + . Q + S LAB="",LABO=0 ;Check for valid label names + I 'INDLC F S LAB=$O(^UTILITY($J,1,RTN,"T",LAB)) Q:LAB="" D + . I '$$VA^XINDX2(LAB) D E^XINDX1(55) Q + . D:'$$VT^XINDX2(LAB) E^XINDX1(37) + . Q + S LAB="",LABO=0 ;Check for valid variable names. + F S LAB=$O(^UTILITY($J,1,RTN,"L",LAB)) Q:LAB="" D + . D VLNF^XINDX3($P(LAB,"(")) + . Q + Q + ; +QUICK ;Quick, Just get a routine an print the results + D QUICK^XINDX6() + Q diff --git a/Tests/MumpsCoverage/cache_coverage.cmcov.in b/Tests/MumpsCoverage/cache_coverage.cmcov.in new file mode 100644 index 0000000..b431dbd --- /dev/null +++ b/Tests/MumpsCoverage/cache_coverage.cmcov.in @@ -0,0 +1,2 @@ +packages:${CMake_BINARY_DIR}/Testing/MumpsCoverage/VistA-FOIA/Packages +coverage_dir:${CMake_SOURCE_DIR}/Tests/MumpsCoverage diff --git a/Tests/MumpsCoverage/gtm_coverage.mcov.in b/Tests/MumpsCoverage/gtm_coverage.mcov.in new file mode 100644 index 0000000..b431dbd --- /dev/null +++ b/Tests/MumpsCoverage/gtm_coverage.mcov.in @@ -0,0 +1,2 @@ +packages:${CMake_BINARY_DIR}/Testing/MumpsCoverage/VistA-FOIA/Packages +coverage_dir:${CMake_SOURCE_DIR}/Tests/MumpsCoverage diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt index b0942c0..31ca59c 100644 --- a/Tests/Plugin/CMakeLists.txt +++ b/Tests/Plugin/CMakeLists.txt @@ -39,6 +39,50 @@ TARGET_LINK_LIBRARIES(example_exe kwsys) ADD_LIBRARY(example_mod_1 MODULE src/example_mod_1.c) TARGET_LINK_LIBRARIES(example_mod_1 example_exe) + +IF(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG AND + "${CMAKE_C_CREATE_SHARED_MODULE}" MATCHES "SONAME_FLAG") + # Add a second plugin that should not have any soname. + ADD_LIBRARY(example_mod_2 MODULE src/example_mod_1.c) + TARGET_LINK_LIBRARIES(example_mod_2 example_exe) + SET_PROPERTY(TARGET example_mod_2 PROPERTY NO_SONAME 1) + + # Verify that targets export with proper IMPORTED SONAME properties. + EXPORT(TARGETS example_mod_1 example_mod_2 NAMESPACE exp_ + FILE ${CMAKE_CURRENT_BINARY_DIR}/mods.cmake) + INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/mods.cmake) + GET_PROPERTY(configs TARGET exp_example_mod_1 PROPERTY IMPORTED_CONFIGURATIONS) + FOREACH(c ${configs}) + STRING(TOUPPER "${c}" CONFIG) + GET_PROPERTY(soname1 TARGET exp_example_mod_1 PROPERTY IMPORTED_SONAME_${CONFIG}) + GET_PROPERTY(soname2 TARGET exp_example_mod_2 PROPERTY IMPORTED_NO_SONAME_${CONFIG}) + IF(soname1) + MESSAGE(STATUS "exp_example_mod_1 has IMPORTED_SONAME_${CONFIG} as expected: ${soname1}") + ELSE() + MESSAGE(SEND_ERROR "exp_example_mod_1 does not have IMPORTED_SONAME_${CONFIG} but should") + ENDIF() + IF(soname2) + MESSAGE(STATUS "exp_example_mod_2 has IMPORTED_NO_SONAME_${CONFIG} as expected: ${soname2}") + ELSE() + MESSAGE(SEND_ERROR "exp_example_mod_2 does not have IMPORTED_NO_SONAME_${CONFIG} but should") + ENDIF() + ENDFOREACH() + + # Parse the binary to check for SONAME if possible. + IF("${CMAKE_EXECUTABLE_FORMAT}" MATCHES "ELF") + FIND_PROGRAM(READELF_EXE readelf) + IF(READELF_EXE) + ADD_CUSTOM_TARGET(check_mod_soname ALL COMMAND + ${CMAKE_COMMAND} -Dreadelf=${READELF_EXE} + -Dmod1=$<TARGET_FILE:example_mod_1> + -Dmod2=$<TARGET_FILE:example_mod_2> + -P ${CMAKE_CURRENT_SOURCE_DIR}/check_mod_soname.cmake + ) + ADD_DEPENDENCIES(check_mod_soname example_mod_1 example_mod_2) + ENDIF() + ENDIF() +ENDIF() + # TODO: # - create a plugin that links to a static lib # - create a plugin that links to a shared lib diff --git a/Tests/Plugin/check_mod_soname.cmake b/Tests/Plugin/check_mod_soname.cmake new file mode 100644 index 0000000..3737b45 --- /dev/null +++ b/Tests/Plugin/check_mod_soname.cmake @@ -0,0 +1,14 @@ +execute_process(COMMAND ${readelf} -d ${mod1} OUTPUT_FILE ${mod1}.readelf.txt) +execute_process(COMMAND ${readelf} -d ${mod2} OUTPUT_FILE ${mod2}.readelf.txt) +file(STRINGS ${mod1}.readelf.txt soname1 REGEX "\\(SONAME\\)") +file(STRINGS ${mod2}.readelf.txt soname2 REGEX "\\(SONAME\\)") +if(soname1) + message(STATUS "${mod1} has soname as expected: ${soname1}") +else() + message(FATAL_ERROR "${mod1} has no soname but should:\n ${soname1}") +endif() +if(soname2) + message(FATAL_ERROR "${mod2} has soname but should not:\n ${soname2}") +else() + message(STATUS "${mod2} has no soname as expected") +endif() diff --git a/Tests/PositionIndependentTargets/CMakeLists.txt b/Tests/PositionIndependentTargets/CMakeLists.txt new file mode 100644 index 0000000..eec893d --- /dev/null +++ b/Tests/PositionIndependentTargets/CMakeLists.txt @@ -0,0 +1,13 @@ + +cmake_minimum_required(VERSION 2.8) + +project(PositionIndependentTargets) + +include(CheckCXXSourceCompiles) + +include_directories("${CMAKE_CURRENT_SOURCE_DIR}") # For pic_test.h + +add_subdirectory(global) +add_subdirectory(targets) + +add_executable(PositionIndependentTargets main.cpp) diff --git a/Tests/PositionIndependentTargets/global/CMakeLists.txt b/Tests/PositionIndependentTargets/global/CMakeLists.txt new file mode 100644 index 0000000..1d662f8 --- /dev/null +++ b/Tests/PositionIndependentTargets/global/CMakeLists.txt @@ -0,0 +1,37 @@ + +set(CMAKE_POSITION_INDEPENDENT_CODE True) + +add_executable(test_target_executable_global + "${CMAKE_CURRENT_SOURCE_DIR}/../pic_main.cpp" +) + +add_library(test_target_shared_library_global + SHARED "${CMAKE_CURRENT_SOURCE_DIR}/../pic_lib.cpp" +) +set_target_properties(test_target_shared_library_global + PROPERTIES DEFINE_SYMBOL PIC_TEST_BUILD_DLL +) + +add_library(test_target_static_library_global + STATIC "${CMAKE_CURRENT_SOURCE_DIR}/../pic_lib.cpp" +) +set_target_properties(test_target_static_library_global + PROPERTIES COMPILE_DEFINITIONS PIC_TEST_STATIC_BUILD +) + + +file(READ + "${CMAKE_CURRENT_SOURCE_DIR}/../pic_test.h" + PIC_HEADER_CONTENT +) + +check_cxx_source_compiles( + " +${PIC_HEADER_CONTENT} +int main(int,char**) { return 0; }\n" + PIC_TRY_COMPILE_RESULT +) + +if (NOT PIC_TRY_COMPILE_RESULT) + message(SEND_ERROR "TRY_COMPILE with content requiring __PIC__ failed. ${OUTPUT}") +endif() diff --git a/Tests/PositionIndependentTargets/main.cpp b/Tests/PositionIndependentTargets/main.cpp new file mode 100644 index 0000000..e72cef7 --- /dev/null +++ b/Tests/PositionIndependentTargets/main.cpp @@ -0,0 +1,2 @@ + +int main(int,char**) { return 0; } diff --git a/Tests/PositionIndependentTargets/pic_lib.cpp b/Tests/PositionIndependentTargets/pic_lib.cpp new file mode 100644 index 0000000..b8b25a3 --- /dev/null +++ b/Tests/PositionIndependentTargets/pic_lib.cpp @@ -0,0 +1,12 @@ + +#include "pic_test.h" + +class PIC_TEST_EXPORT Dummy +{ + int dummy(); +}; + +int Dummy::dummy() +{ + return 0; +} diff --git a/Tests/PositionIndependentTargets/pic_main.cpp b/Tests/PositionIndependentTargets/pic_main.cpp new file mode 100644 index 0000000..6a41a7a --- /dev/null +++ b/Tests/PositionIndependentTargets/pic_main.cpp @@ -0,0 +1,4 @@ + +#include "pic_test.h" + +int main(int,char**) { return 0; } diff --git a/Tests/PositionIndependentTargets/pic_test.h b/Tests/PositionIndependentTargets/pic_test.h new file mode 100644 index 0000000..13cf8f7 --- /dev/null +++ b/Tests/PositionIndependentTargets/pic_test.h @@ -0,0 +1,20 @@ + +#if defined(__ELF__) +# if !defined(__PIC__) && !defined(__PIE__) +# error "The POSITION_INDEPENDENT_CODE property should cause __PIC__ or __PIE__ to be defined on ELF platforms." +# endif +#endif + +#if defined(PIC_TEST_STATIC_BUILD) +# define PIC_TEST_EXPORT +#else +# if defined(_WIN32) || defined(WIN32) /* Win32 version */ +# ifdef PIC_TEST_BUILD_DLL +# define PIC_TEST_EXPORT __declspec(dllexport) +# else +# define PIC_TEST_EXPORT __declspec(dllimport) +# endif +# else +# define PIC_TEST_EXPORT +# endif +#endif diff --git a/Tests/PositionIndependentTargets/targets/CMakeLists.txt b/Tests/PositionIndependentTargets/targets/CMakeLists.txt new file mode 100644 index 0000000..4724c85 --- /dev/null +++ b/Tests/PositionIndependentTargets/targets/CMakeLists.txt @@ -0,0 +1,20 @@ + +add_executable(test_target_executable_properties "${CMAKE_CURRENT_SOURCE_DIR}/../pic_main.cpp") +set_target_properties(test_target_executable_properties + PROPERTIES + POSITION_INDEPENDENT_CODE True +) + +add_library(test_target_shared_library_properties SHARED "${CMAKE_CURRENT_SOURCE_DIR}/../pic_lib.cpp") +set_target_properties(test_target_shared_library_properties + PROPERTIES + POSITION_INDEPENDENT_CODE True + DEFINE_SYMBOL PIC_TEST_BUILD_DLL +) + +add_library(test_target_static_library_properties STATIC "${CMAKE_CURRENT_SOURCE_DIR}/../pic_lib.cpp") +set_target_properties(test_target_static_library_properties + PROPERTIES + POSITION_INDEPENDENT_CODE True + COMPILE_DEFINITIONS PIC_TEST_STATIC_BUILD +) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 0b79efa..eca96f9 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} @@ -40,7 +45,14 @@ macro(add_RunCMake_test test) ) endmacro() +add_RunCMake_test(Languages) add_RunCMake_test(ObjectLibrary) add_RunCMake_test(build_command) add_RunCMake_test(find_package) +add_RunCMake_test(include) +add_RunCMake_test(list) + +if("${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [^6]") + add_RunCMake_test(include_external_msproject) +endif() diff --git a/Tests/RunCMake/Languages/CMakeLists.txt b/Tests/RunCMake/Languages/CMakeLists.txt new file mode 100644 index 0000000..e8db6b0 --- /dev/null +++ b/Tests/RunCMake/Languages/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/Languages/NoLangSHARED-result.txt b/Tests/RunCMake/Languages/NoLangSHARED-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Languages/NoLangSHARED-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Languages/NoLangSHARED-stderr.txt b/Tests/RunCMake/Languages/NoLangSHARED-stderr.txt new file mode 100644 index 0000000..3f93cf8 --- /dev/null +++ b/Tests/RunCMake/Languages/NoLangSHARED-stderr.txt @@ -0,0 +1 @@ +CMake Error: CMake can not determine linker language for target:NoLang diff --git a/Tests/RunCMake/Languages/NoLangSHARED.cmake b/Tests/RunCMake/Languages/NoLangSHARED.cmake new file mode 100644 index 0000000..de6adf7 --- /dev/null +++ b/Tests/RunCMake/Languages/NoLangSHARED.cmake @@ -0,0 +1 @@ +add_library(NoLang SHARED foo.nolang) diff --git a/Tests/RunCMake/Languages/RunCMakeTest.cmake b/Tests/RunCMake/Languages/RunCMakeTest.cmake new file mode 100644 index 0000000..a99548f --- /dev/null +++ b/Tests/RunCMake/Languages/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(NoLangSHARED) diff --git a/Tests/RunCMake/Languages/foo.nolang b/Tests/RunCMake/Languages/foo.nolang new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/Languages/foo.nolang 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/CMakeLists.txt b/Tests/RunCMake/include/CMakeLists.txt new file mode 100644 index 0000000..e8db6b0 --- /dev/null +++ b/Tests/RunCMake/include/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/EmptyString-stderr.txt b/Tests/RunCMake/include/EmptyString-stderr.txt new file mode 100644 index 0000000..006c647 --- /dev/null +++ b/Tests/RunCMake/include/EmptyString-stderr.txt @@ -0,0 +1,5 @@ +CMake Warning \(dev\) at EmptyString.cmake:1 \(include\): + include\(\) given empty file name \(ignored\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/include/EmptyString.cmake b/Tests/RunCMake/include/EmptyString.cmake new file mode 100644 index 0000000..4285cb3 --- /dev/null +++ b/Tests/RunCMake/include/EmptyString.cmake @@ -0,0 +1 @@ +include("") diff --git a/Tests/RunCMake/include/EmptyStringOptional-stderr.txt b/Tests/RunCMake/include/EmptyStringOptional-stderr.txt new file mode 100644 index 0000000..b61c679 --- /dev/null +++ b/Tests/RunCMake/include/EmptyStringOptional-stderr.txt @@ -0,0 +1,5 @@ +CMake Warning \(dev\) at EmptyStringOptional.cmake:1 \(include\): + include\(\) given empty file name \(ignored\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/include/EmptyStringOptional.cmake b/Tests/RunCMake/include/EmptyStringOptional.cmake new file mode 100644 index 0000000..549d46b --- /dev/null +++ b/Tests/RunCMake/include/EmptyStringOptional.cmake @@ -0,0 +1 @@ +include("" OPTIONAL) diff --git a/Tests/RunCMake/include/RunCMakeTest.cmake b/Tests/RunCMake/include/RunCMakeTest.cmake new file mode 100644 index 0000000..59b87ca --- /dev/null +++ b/Tests/RunCMake/include/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(EmptyString) +run_cmake(EmptyStringOptional) 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/Tests/SystemInformation/SystemInformation.in b/Tests/SystemInformation/SystemInformation.in index 90ae20a..ecbc054 100644 --- a/Tests/SystemInformation/SystemInformation.in +++ b/Tests/SystemInformation/SystemInformation.in @@ -30,6 +30,9 @@ CMAKE_SHARED_LIBRARY_RUNTIME_FLAG == "${CMAKE_SHARED_LIBRARY_RUNTIME_FLAG}" CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP == "${CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP}" CMAKE_SHARED_LIBRARY_LINK_STATIC_C_FLAGS == "${CMAKE_SHARED_LIBRARY_LINK_STATIC_C_FLAGS}" CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_C_FLAGS == "${CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_C_FLAGS}" +CMAKE_C_COMPILE_OPTIONS_PIC == "${CMAKE_C_COMPILE_OPTIONS_PIC}" +CMAKE_C_COMPILE_OPTIONS_PIE == "${CMAKE_C_COMPILE_OPTIONS_PIE}" +CMAKE_C_COMPILE_OPTIONS_DLL == "${CMAKE_C_COMPILE_OPTIONS_DLL}" // C shared module flags CMAKE_SHARED_MODULE_C_FLAGS == "${CMAKE_SHARED_MODULE_C_FLAGS}" @@ -49,6 +52,9 @@ CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG == "${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLA CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP == "${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP}" CMAKE_SHARED_LIBRARY_LINK_STATIC_CXX_FLAGS == "${CMAKE_SHARED_LIBRARY_LINK_STATIC_CXX_FLAGS}" CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_CXX_FLAGS == "${CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_CXX_FLAGS}" +CMAKE_CXX_COMPILE_OPTIONS_PIC == "${CMAKE_CXX_COMPILE_OPTIONS_PIC}" +CMAKE_CXX_COMPILE_OPTIONS_PIE == "${CMAKE_CXX_COMPILE_OPTIONS_PIE}" +CMAKE_CXX_COMPILE_OPTIONS_DLL == "${CMAKE_CXX_COMPILE_OPTIONS_DLL}" // CXX shared module flags CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS == "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS}" diff --git a/Tests/VSGNUFortran/c_code/main.c b/Tests/VSGNUFortran/c_code/main.c index 391bf26..9157cc5 100644 --- a/Tests/VSGNUFortran/c_code/main.c +++ b/Tests/VSGNUFortran/c_code/main.c @@ -1,4 +1,4 @@ -#include <HelloWorldFCMangle.h> // created by FortranCInterface +#include <HelloWorldFCMangle.h> /* created by FortranCInterface */ extern void FC_hello(void); int main() { diff --git a/Utilities/.gitattributes b/Utilities/.gitattributes new file mode 100644 index 0000000..e3a9e61 --- /dev/null +++ b/Utilities/.gitattributes @@ -0,0 +1,2 @@ +/Git export-ignore +SetupForDevelopment.sh export-ignore diff --git a/Utilities/GitSetup/.gitattributes b/Utilities/GitSetup/.gitattributes new file mode 100644 index 0000000..facbbb2 --- /dev/null +++ b/Utilities/GitSetup/.gitattributes @@ -0,0 +1,7 @@ +.git* export-ignore + +# Exclude from source archives files specific to Git work tree. +* export-ignore + +tips eol=lf whitespace=indent-with-non-tab +setup-* eol=lf whitespace=indent-with-non-tab diff --git a/Utilities/GitSetup/LICENSE b/Utilities/GitSetup/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/Utilities/GitSetup/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Utilities/GitSetup/NOTICE b/Utilities/GitSetup/NOTICE new file mode 100644 index 0000000..0d32c02 --- /dev/null +++ b/Utilities/GitSetup/NOTICE @@ -0,0 +1,5 @@ +Kitware Local Git Setup Scripts +Copyright 2010-2012 Kitware, Inc. + +This product includes software developed at Kitware, Inc. +(http://www.kitware.com/). diff --git a/Utilities/GitSetup/README b/Utilities/GitSetup/README new file mode 100644 index 0000000..cf468fb --- /dev/null +++ b/Utilities/GitSetup/README @@ -0,0 +1,80 @@ +Kitware Local Git Setup Scripts + + +Introduction +------------ + +This is a collection of local Git development setup scripts meant for +inclusion in project source trees to aid their development workflow. +Project-specific information needed by the scripts may be configured +in a "config" file added next to them in the project. + + +Import +------ + +A project may import these scripts into their source tree by +initializing a subtree merge. Bring up a Git prompt and set the +current working directory inside a clone of the target project. +Fetch the "setup" branch from the GitSetup repository: + + $ git fetch ../GitSetup setup:setup + +Prepare to merge the branch but place the content in a subdirectory. +Any prefix (with trailing '/') may be chosen so long as it is used +consistently within a project through the rest of these instructions: + + $ git merge -s ours --no-commit setup + $ git read-tree -u --prefix=Utilities/GitSetup/ setup + +Commit the merge with an informative message: + + $ git commit + ------------------------------------------------------------------------ + Merge branch 'setup' + + Add Utilities/GitSetup/ directory using subtree merge from + the general GitSetup repository "setup" branch. + ------------------------------------------------------------------------ + + +Configuration +------------- + +Read the "Project configuration instructions" comment in each script. +Add a "config" file next to the scripts with desired configuration +(optionally copy and modify "config.sample"). For example, to +configure the "setup-hooks" script: + + $ git config -f Utilities/GitSetup/config hooks.url "$url" + +where "$url" is the project repository publishing the "hooks" branch. +When finished, add and commit the configuration file: + + $ git add Utilities/GitSetup/config + $ git commit + + +Update +------ + +A project may update these scripts from the GitSetup repository. +Bring up a Git prompt and set the current working directory inside a +clone of the target project. Fetch the "setup" branch from the +GitSetup repository: + + $ git fetch ../GitSetup setup:setup + +Merge the "setup" branch into the subtree: + + $ git merge -X subtree=Utilities/GitSetup setup + +where "Utilities/GitSetup" is the same prefix used during the import +setup, but without a trailing '/'. + + +License +------- + +Distributed under the Apache License 2.0. +See LICENSE and NOTICE for details. diff --git a/Utilities/GitSetup/config b/Utilities/GitSetup/config new file mode 100644 index 0000000..b7d5423 --- /dev/null +++ b/Utilities/GitSetup/config @@ -0,0 +1,9 @@ +[hooks] + url = http://cmake.org/cmake.git +[ssh] + host = cmake.org + key = id_git_cmake + request-url = https://www.kitware.com/Admin/SendPassword.cgi +[stage] + url = git://cmake.org/stage/cmake.git + pushurl = git@cmake.org:stage/cmake.git diff --git a/Utilities/GitSetup/config.sample b/Utilities/GitSetup/config.sample new file mode 100644 index 0000000..bba2382 --- /dev/null +++ b/Utilities/GitSetup/config.sample @@ -0,0 +1,22 @@ +# Kitware Local Git Setup Scripts - Sample Project Configuration +# +# Copy to "config" and edit as necessary. + +[hooks] + url = http://public.kitware.com/GitSetup.git + #branch = hooks + +[ssh] + host = public.kitware.com + key = id_git_public + request-url = https://www.kitware.com/Admin/SendPassword.cgi + +[stage] + #url = git://public.kitware.com/stage/Project.git + #pushurl = git@public.kitware.com:stage/Project.git + +[gerrit] + #project = Project + site = http://review.source.kitware.com + # pushurl placeholder "$username" is literal + pushurl = $username@review.source.kitware.com:Project diff --git a/Utilities/GitSetup/setup-gerrit b/Utilities/GitSetup/setup-gerrit new file mode 100755 index 0000000..9e8fa62 --- /dev/null +++ b/Utilities/GitSetup/setup-gerrit @@ -0,0 +1,142 @@ +#!/usr/bin/env bash +#============================================================================= +# Copyright 2010-2012 Kitware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============================================================================= + +# Run this script to set up the local Git repository to push to +# a Gerrit Code Review instance for this project. + +# Project configuration instructions: +# +# - Run a Gerrit Code Review server +# +# - Populate adjacent "config" file with: +# gerrit.site = Top Gerrit URL (not project-specific) +# gerrit.project = Name of project in Gerrit +# gerrit.pushurl = Review site push URL with "$username" placeholder +# gerrit.remote = Gerrit remote name, if not "gerrit" +# gerrit.url = Gerrit project URL, if not "$site/p/$project" + +die() { + echo 1>&2 "$@" ; exit 1 +} + +# Make sure we are inside the repository. +cd "${BASH_SOURCE%/*}" && + +# Load the project configuration. +site=$(git config -f config --get gerrit.site) && +project=$(git config -f config --get gerrit.project) && +pushurl_=$(git config -f config --get gerrit.pushurl) && +remote=$(git config -f config --get gerrit.remote || + echo "gerrit") && +fetchurl=$(git config -f config --get gerrit.url || + echo "$site/p/$project") || +die 'This project is not configured to use Gerrit.' + +# Get current gerrit 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 Gerrit? [y/N]: ' ans && + if [ "$ans" == "y" ] || [ "$ans" == "Y" ]; then + setup=1 + else + setup='' + fi +else + echo 'Remote "'"$remote"'" is not yet configured. + +'"$project"' changes must be pushed to our Gerrit Code Review site: + + '"$fetchurl"' + +Register a Gerrit account and select a username (used below). +You will need an OpenID: + + http://openid.net/get-an-openid/ +' && + read -ep 'Configure Gerrit? [Y/n]: ' ans && + if [ "$ans" == "n" ] || [ "$ans" == "N" ]; then + exit 0 + else + setup=1 + fi +fi && + +# Perform setup if necessary. +if test -n "$setup"; then + echo 'Sign-in to Gerrit to get/set your username at + + '"$site"'/#/settings + +Add your SSH public keys at + + '"$site"'/#/settings/ssh-keys +' && + read -ep "Gerrit username? [$USER]: " gu && + if test -z "$gu"; then + gu="$USER" + fi && + if test -z "$pushurl"; then + git remote add "$remote" "$fetchurl" + else + git config remote."$remote".url "$fetchurl" + fi && + pushurl="${pushurl_/\$username/$gu}" && + git config remote."$remote".pushurl "$pushurl" && + echo 'Remote "'"$remote"'" is now configured to push to + + '"$pushurl"' +' +fi && + +# Optionally test Gerrit access. +if test -n "$pushurl"; then + read -ep 'Test access to Gerrit (SSH)? [y/N]: ' ans && + if [ "$ans" == "y" ] || [ "$ans" == "Y" ]; then + echo -n 'Testing Gerrit access by SSH...' + if git ls-remote --heads "$pushurl" >/dev/null; then + echo 'passed.' + else + echo 'failed.' && + die 'Could not access Gerrit. Add your SSH public keys at + + '"$site"'/#/settings/ssh-keys +' + fi + fi +fi && + +# Set up GerritId hook. +hook=$(git config --get hooks.GerritId || echo '') && +if test -z "$hook"; then + echo ' +Enabling GerritId hook to add a "Change-Id" footer to commit +messages for interaction with Gerrit. Run + + git config hooks.GerritId false + +to disable this feature (but you will be on your own).' && + git config hooks.GerritId true +else + echo 'GerritId hook already configured to "'"$hook"'".' +fi diff --git a/Utilities/GitSetup/setup-hooks b/Utilities/GitSetup/setup-hooks new file mode 100755 index 0000000..c07985a --- /dev/null +++ b/Utilities/GitSetup/setup-hooks @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +#============================================================================= +# Copyright 2010-2012 Kitware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============================================================================= + +# Run this script to set up local Git hooks for this project. + +# Project configuration instructions: +# +# - Publish a "hooks" branch in the project repository such that +# clones will have "refs/remotes/origin/hooks". +# +# - Populate adjacent "config" file with: +# hooks.url = Repository URL publishing "hooks" branch +# hooks.branch = Repository branch instead of "hooks" + +egrep-q() { + egrep "$@" >/dev/null 2>/dev/null +} + +die() { + echo 1>&2 "$@" ; exit 1 +} + +# Make sure we are inside the repository. +cd "${BASH_SOURCE%/*}" && + +# Select a hooks branch. +if url=$(git config --get hooks.url); then + # Fetch hooks from locally configured repository. + branch=$(git config hooks.branch || echo hooks) +elif git for-each-ref refs/remotes/origin/hooks 2>/dev/null | + egrep-q 'refs/remotes/origin/hooks$'; then + # Use hooks cloned from origin. + url=.. && branch=remotes/origin/hooks +elif url=$(git config -f config --get hooks.url); then + # Fetch hooks from project-configured repository. + branch=$(git config -f config hooks.branch || echo hooks) +else + die 'This project is not configured to install local hooks.' +fi && + +# Populate ".git/hooks". +echo 'Setting up git hooks...' && +git_dir=$(git rev-parse --git-dir) && +cd "$git_dir/hooks" && +if ! test -e .git; then + git init -q || die 'Could not run git init for hooks.' +fi && +git fetch -q "$url" "$branch" && +git reset -q --hard FETCH_HEAD || die 'Failed to install hooks' diff --git a/Utilities/GitSetup/setup-ssh b/Utilities/GitSetup/setup-ssh new file mode 100755 index 0000000..8920a5b --- /dev/null +++ b/Utilities/GitSetup/setup-ssh @@ -0,0 +1,111 @@ +#!/usr/bin/env bash +#============================================================================= +# Copyright 2010-2012 Kitware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============================================================================= + +# Run this script to set up ssh push access to the repository host. + +# Project configuration instructions: +# +# - Populate adjacent "config" file with: +# ssh.host = Repository host name +# ssh.user = Username on host, if not "git" +# ssh.key = Local ssh key name +# ssh.request-url = Web page URL to request ssh access + +egrep-q() { + egrep "$@" >/dev/null 2>/dev/null +} + +die() { + echo 1>&2 "$@" ; exit 1 +} + +# Make sure we are inside the repository. +cd "${BASH_SOURCE%/*}" && + +# Load the project configuration. +host=$(git config -f config --get ssh.host) && +user=$(git config -f config --get ssh.user || echo git) && +key=$(git config -f config --get ssh.key) && +request_url=$(git config -f config --get ssh.request-url) || +die 'This project is not configured for ssh push access.' + +# Check for existing configuration. +if test -r ~/.ssh/config && + egrep-q 'Host[= ]'"${host//\./\\.}" ~/.ssh/config; then + echo 'Host "'"$host"'" is already in ~/.ssh/config' && + setup= && + question='Test' +else + echo 'Host "'"$host"'" not found in ~/.ssh/config' && + setup=1 && + question='Setup and test' +fi && + +# Ask the user whether to make changes. +echo '' && +read -ep "${question} push access by ssh to $user@$host? [y/N]: " access && +if test "$access" != "y" -a "$access" != "Y"; then + exit 0 +fi && + +# Setup host configuration if necessary. +if test -n "$setup"; then + if ! test -d ~/.ssh; then + mkdir -p ~/.ssh && + chmod 700 ~/.ssh + fi && + if ! test -f ~/.ssh/config; then + touch ~/.ssh/config && + chmod 600 ~/.ssh/config + fi && + ssh_config='Host='"$host"' + IdentityFile ~/.ssh/'"$key" && + echo "Adding to ~/.ssh/config: + +$ssh_config +" && + echo "$ssh_config" >> ~/.ssh/config && + if ! test -e ~/.ssh/"$key"; then + if test -f ~/.ssh/id_rsa; then + # Take care of the common case. + ln -s id_rsa ~/.ssh/"$key" + echo ' +Assuming ~/.ssh/id_rsa is the private key corresponding to the public key for + + '"$user@$host"' + +If this is incorrect place private key at "~/.ssh/'"$key"'".' + else + echo ' +Place the private key corresponding to the public key registered for + + '"$user@$host"' + +at "~/.ssh/'"$key"'".' + fi + read -e -n 1 -p 'Press any key to continue...' + fi +fi || exit 1 + +# Test access configuration. +echo 'Testing ssh push access to "'"$user@$host"'"...' && +if ! ssh "$user@$host" info; then + die 'No ssh push access to "'"$user@$host"'". You may need to request access at + + '"$request_url"' +' +fi diff --git a/Utilities/GitSetup/setup-stage b/Utilities/GitSetup/setup-stage new file mode 100755 index 0000000..323e47a --- /dev/null +++ b/Utilities/GitSetup/setup-stage @@ -0,0 +1,79 @@ +#!/usr/bin/env bash +#============================================================================= +# Copyright 2010-2012 Kitware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============================================================================= + +# Run this script to set up the topic stage for pushing changes. + +# Project configuration instructions: +# +# - Run a Topic Stage repository next to the main project repository. +# +# - Populate adjacent "config" file with: +# stage.url = Topic Stage repository URL +# stage.pushurl = Topic Stage push URL if not "$url" + +egrep-q() { + egrep "$@" >/dev/null 2>/dev/null +} + +die() { + echo 1>&2 "$@" ; exit 1 +} + +# Make sure we are inside the repository. +cd "${BASH_SOURCE%/*}" && + +# Load the project configuration. +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.' + +# 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...' && + 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/GitSetup/setup-user b/Utilities/GitSetup/setup-user new file mode 100755 index 0000000..1af439c --- /dev/null +++ b/Utilities/GitSetup/setup-user @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +#============================================================================= +# Copyright 2010-2012 Kitware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============================================================================= + +# Run this script to configure Git user info in this repository. + +# Project configuration instructions: NONE + +for (( ; ; )); do + user_name=$(git config user.name || echo '') && + user_email=$(git config user.email || echo '') && + if test -n "$user_name" -a -n "$user_email"; then + echo 'Your commits will record as Author: + + '"$user_name <$user_email>"' +' && + read -ep 'Is the author name and email address above correct? [Y/n] ' correct && + if test "$correct" != "n" -a "$correct" != "N"; then + break + fi + fi && + read -ep 'Enter your full name e.g. "John Doe": ' name && + read -ep 'Enter your email address e.g. "john@gmail.com": ' email && + git config user.name "$name" && + git config user.email "$email" +done diff --git a/Utilities/GitSetup/tips b/Utilities/GitSetup/tips new file mode 100755 index 0000000..784e1ed --- /dev/null +++ b/Utilities/GitSetup/tips @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +#============================================================================= +# Copyright 2010-2012 Kitware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============================================================================= + +# This script makes optional suggestions for working with Git. + +# Project configuration instructions: NONE + +egrep-q() { + egrep "$@" >/dev/null 2>/dev/null +} + +# Suggest color configuration. +if test -z "$(git config --get color.ui)"; then + echo ' +One may enable color output from Git commands with + + git config --global color.ui auto +' +fi + +# Suggest bash completion. +if ! bash -i -c 'echo $PS1' | egrep-q '__git_ps1'; then + echo ' +A dynamic, informative Git shell prompt can be obtained by sourcing +the git bash-completion script in your "~/.bashrc". Set the PS1 +environmental variable as suggested in the comments at the top of the +bash-completion script. You may need to install the bash-completion +package from your distribution to obtain it. +' +fi + +# Suggest merge tool. +if test -z "$(git config --get merge.tool)"; then + echo ' +One may configure Git to load a merge tool with + + git config merge.tool <toolname> + +See "git help mergetool" for more information. +' +fi diff --git a/Utilities/KWIML/ABI.h.in b/Utilities/KWIML/ABI.h.in index e85a1c5..060a520 100644 --- a/Utilities/KWIML/ABI.h.in +++ b/Utilities/KWIML/ABI.h.in @@ -156,6 +156,8 @@ suppression macro @KWIML@_ABI_NO_VERIFY was defined. # define @KWIML@_ABI_CHAR_IS_UNSIGNED 1 # elif defined(__BORLANDC__) /* Borland default */ # define @KWIML@_ABI_CHAR_IS_SIGNED 1 +# elif defined(__hpux) /* Old HP: no __HP_cc/__HP_aCC/__GNUC__ above */ +# define @KWIML@_ABI_CHAR_IS_SIGNED 1 /* (unless +uc) */ # endif #endif #if !defined(@KWIML@_ABI_CHAR_IS_UNSIGNED) && !defined(@KWIML@_ABI_CHAR_IS_SIGNED) \ @@ -251,6 +253,8 @@ suppression macro @KWIML@_ABI_NO_VERIFY was defined. # else # define @KWIML@_ABI_SIZEOF_LONG_LONG 0 # endif +# elif defined(__hpux) && !defined(__GNUC__) /* Old HP: no __HP_cc/__HP_aCC above */ +# define @KWIML@_ABI_SIZEOF_LONG_LONG 8 # endif #endif #if !defined(@KWIML@_ABI_SIZEOF_LONG_LONG) && !defined(@KWIML@_ABI_NO_ERROR_LONG_LONG) diff --git a/Utilities/KWIML/INT.h.in b/Utilities/KWIML/INT.h.in index 3c1f05d..d2eda63 100644 --- a/Utilities/KWIML/INT.h.in +++ b/Utilities/KWIML/INT.h.in @@ -87,10 +87,15 @@ An includer may test the following macros after inclusion: The SCN*8 and SCN*64 format macros will not be defined on systems with scanf implementations known not to support them. - @KWIML@_INT_BROKEN_INT64_C = macro INT64_C is incorrect if defined - @KWIML@_INT_BROKEN_UINT64_C = macro UINT64_C is incorrect if defined + @KWIML@_INT_BROKEN_<fmt># = macro <fmt># is incorrect if defined + Some compilers define integer format macros incorrectly for their + own formatted print/scan implementations. + + @KWIML@_INT_BROKEN_INT#_C = macro INT#_C is incorrect if defined + @KWIML@_INT_BROKEN_UINT#_C = macro UINT#_C is incorrect if defined Some compilers define integer constant macros incorrectly and - cannot handle literals as large as the integer type. + cannot handle literals as large as the integer type or even + produce bad preprocessor syntax. @KWIML@_INT_BROKEN_INT8_T = type 'int8_t' is available but incorrect Some compilers have a flag to make 'char' (un)signed but do not account @@ -172,6 +177,65 @@ An includer may test the following macros after inclusion: #define @KWIML@_INT_HAVE_UINTPTR_T 1 #endif +#if defined(_AIX43) && !defined(_AIX50) && !defined(_AIX51) + /* AIX 4.3 defines these incorrectly with % and no quotes. */ +# define @KWIML@_INT_BROKEN_PRId8 +# define @KWIML@_INT_BROKEN_SCNd8 +# define @KWIML@_INT_BROKEN_PRIi8 +# define @KWIML@_INT_BROKEN_SCNi8 +# define @KWIML@_INT_BROKEN_PRIo8 +# define @KWIML@_INT_BROKEN_SCNo8 +# define @KWIML@_INT_BROKEN_PRIu8 +# define @KWIML@_INT_BROKEN_SCNu8 +# define @KWIML@_INT_BROKEN_PRIx8 +# define @KWIML@_INT_BROKEN_SCNx8 +# define @KWIML@_INT_BROKEN_PRIX8 +# define @KWIML@_INT_BROKEN_PRId16 +# define @KWIML@_INT_BROKEN_SCNd16 +# define @KWIML@_INT_BROKEN_PRIi16 +# define @KWIML@_INT_BROKEN_SCNi16 +# define @KWIML@_INT_BROKEN_PRIo16 +# define @KWIML@_INT_BROKEN_SCNo16 +# define @KWIML@_INT_BROKEN_PRIu16 +# define @KWIML@_INT_BROKEN_SCNu16 +# define @KWIML@_INT_BROKEN_PRIx16 +# define @KWIML@_INT_BROKEN_SCNx16 +# define @KWIML@_INT_BROKEN_PRIX16 +# define @KWIML@_INT_BROKEN_PRId32 +# define @KWIML@_INT_BROKEN_SCNd32 +# define @KWIML@_INT_BROKEN_PRIi32 +# define @KWIML@_INT_BROKEN_SCNi32 +# define @KWIML@_INT_BROKEN_PRIo32 +# define @KWIML@_INT_BROKEN_SCNo32 +# define @KWIML@_INT_BROKEN_PRIu32 +# define @KWIML@_INT_BROKEN_SCNu32 +# define @KWIML@_INT_BROKEN_PRIx32 +# define @KWIML@_INT_BROKEN_SCNx32 +# define @KWIML@_INT_BROKEN_PRIX32 +# define @KWIML@_INT_BROKEN_PRId64 +# define @KWIML@_INT_BROKEN_SCNd64 +# define @KWIML@_INT_BROKEN_PRIi64 +# define @KWIML@_INT_BROKEN_SCNi64 +# define @KWIML@_INT_BROKEN_PRIo64 +# define @KWIML@_INT_BROKEN_SCNo64 +# define @KWIML@_INT_BROKEN_PRIu64 +# define @KWIML@_INT_BROKEN_SCNu64 +# define @KWIML@_INT_BROKEN_PRIx64 +# define @KWIML@_INT_BROKEN_SCNx64 +# define @KWIML@_INT_BROKEN_PRIX64 +# define @KWIML@_INT_BROKEN_PRIdPTR +# define @KWIML@_INT_BROKEN_SCNdPTR +# define @KWIML@_INT_BROKEN_PRIiPTR +# define @KWIML@_INT_BROKEN_SCNiPTR +# define @KWIML@_INT_BROKEN_PRIoPTR +# define @KWIML@_INT_BROKEN_SCNoPTR +# define @KWIML@_INT_BROKEN_PRIuPTR +# define @KWIML@_INT_BROKEN_SCNuPTR +# define @KWIML@_INT_BROKEN_PRIxPTR +# define @KWIML@_INT_BROKEN_SCNxPTR +# define @KWIML@_INT_BROKEN_PRIXPTR +#endif + #if (defined(__SUNPRO_C)||defined(__SUNPRO_CC)) && defined(_CHAR_IS_UNSIGNED) # define @KWIML@_INT_BROKEN_INT8_T /* system type defined incorrectly */ #elif defined(__BORLANDC__) && defined(_CHAR_UNSIGNED) @@ -196,8 +260,6 @@ An includer may test the following macros after inclusion: # endif #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) # define @KWIML@_INT__NO_SCN8 -#elif defined(__HP_cc) || defined(__HP_aCC) -# define @KWIML@_INT__NO_SCN8 #elif defined(__BORLANDC__) # define @KWIML@_INT__NO_SCN8 # define @KWIML@_INT__NO_SCN64 @@ -205,74 +267,87 @@ An includer may test the following macros after inclusion: # define @KWIML@_INT__NO_SCN8 #elif defined(__WATCOMC__) # define @KWIML@_INT__NO_SCN8 +# elif defined(__hpux) /* HP runtime lacks support (any compiler) */ +# define @KWIML@_INT__NO_SCN8 #endif /* 8-bit d, i */ -#if defined(@KWIML@_INT_HAVE_INT8_T) && defined(PRId8) +#if defined(@KWIML@_INT_HAVE_INT8_T) && defined(PRId8) \ + && !defined(@KWIML@_INT_BROKEN_PRId8) # define @KWIML@_INT_PRId8 PRId8 #else # define @KWIML@_INT_PRId8 "d" #endif -#if defined(@KWIML@_INT_HAVE_INT8_T) && defined(SCNd8) +#if defined(@KWIML@_INT_HAVE_INT8_T) && defined(SCNd8) \ + && !defined(@KWIML@_INT_BROKEN_SCNd8) # define @KWIML@_INT_SCNd8 SCNd8 #elif !defined(@KWIML@_INT__NO_SCN8) # define @KWIML@_INT_SCNd8 "hhd" #endif -#if defined(@KWIML@_INT_HAVE_INT8_T) && defined(PRIi8) +#if defined(@KWIML@_INT_HAVE_INT8_T) && defined(PRIi8) \ + && !defined(@KWIML@_INT_BROKEN_PRIi8) # define @KWIML@_INT_PRIi8 PRIi8 #else # define @KWIML@_INT_PRIi8 "i" #endif -#if defined(@KWIML@_INT_HAVE_INT8_T) && defined(SCNi8) +#if defined(@KWIML@_INT_HAVE_INT8_T) && defined(SCNi8) \ + && !defined(@KWIML@_INT_BROKEN_SCNi8) # define @KWIML@_INT_SCNi8 SCNi8 #elif !defined(@KWIML@_INT__NO_SCN8) # define @KWIML@_INT_SCNi8 "hhi" #endif /* 8-bit o, u, x, X */ -#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(PRIo8) +#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(PRIo8) \ + && !defined(@KWIML@_INT_BROKEN_PRIo8) # define @KWIML@_INT_PRIo8 PRIo8 #else # define @KWIML@_INT_PRIo8 "o" #endif -#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(SCNo8) +#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(SCNo8) \ + && !defined(@KWIML@_INT_BROKEN_SCNo8) # define @KWIML@_INT_SCNo8 SCNo8 #elif !defined(@KWIML@_INT__NO_SCN8) # define @KWIML@_INT_SCNo8 "hho" #endif -#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(PRIu8) +#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(PRIu8) \ + && !defined(@KWIML@_INT_BROKEN_PRIu8) # define @KWIML@_INT_PRIu8 PRIu8 #else # define @KWIML@_INT_PRIu8 "u" #endif -#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(SCNu8) +#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(SCNu8) \ + && !defined(@KWIML@_INT_BROKEN_SCNu8) # define @KWIML@_INT_SCNu8 SCNu8 #elif !defined(@KWIML@_INT__NO_SCN8) # define @KWIML@_INT_SCNu8 "hhu" #endif -#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(PRIx8) +#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(PRIx8) \ + && !defined(@KWIML@_INT_BROKEN_PRIx8) # define @KWIML@_INT_PRIx8 PRIx8 #else # define @KWIML@_INT_PRIx8 "x" #endif -#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(SCNx8) +#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(SCNx8) \ + && !defined(@KWIML@_INT_BROKEN_SCNx8) # define @KWIML@_INT_SCNx8 SCNx8 #elif !defined(@KWIML@_INT__NO_SCN8) # define @KWIML@_INT_SCNx8 "hhx" #endif -#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(PRIX8) +#if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(PRIX8) \ + && !defined(@KWIML@_INT_BROKEN_PRIX8) # define @KWIML@_INT_PRIX8 PRIX8 #else # define @KWIML@_INT_PRIX8 "X" #endif /* 8-bit constants */ -#if defined(INT8_C) +#if defined(INT8_C) && !defined(@KWIML@_INT_BROKEN_INT8_C) # define @KWIML@_INT_INT8_C(c) INT8_C(c) #else # define @KWIML@_INT_INT8_C(c) c #endif -#if defined(UINT8_C) +#if defined(UINT8_C) && !defined(@KWIML@_INT_BROKEN_UINT8_C) # define @KWIML@_INT_UINT8_C(c) UINT8_C(c) #else # define @KWIML@_INT_UINT8_C(c) c ## u @@ -291,71 +366,82 @@ An includer may test the following macros after inclusion: #endif /* 16-bit d, i */ -#if defined(@KWIML@_INT_HAVE_INT16_T) && defined(PRId16) +#if defined(@KWIML@_INT_HAVE_INT16_T) && defined(PRId16) \ + && !defined(@KWIML@_INT_BROKEN_PRId16) # define @KWIML@_INT_PRId16 PRId16 #else # define @KWIML@_INT_PRId16 "d" #endif -#if defined(@KWIML@_INT_HAVE_INT16_T) && defined(SCNd16) +#if defined(@KWIML@_INT_HAVE_INT16_T) && defined(SCNd16) \ + && !defined(@KWIML@_INT_BROKEN_SCNd16) # define @KWIML@_INT_SCNd16 SCNd16 #else # define @KWIML@_INT_SCNd16 "hd" #endif -#if defined(@KWIML@_INT_HAVE_INT16_T) && defined(PRIi16) +#if defined(@KWIML@_INT_HAVE_INT16_T) && defined(PRIi16) \ + && !defined(@KWIML@_INT_BROKEN_PRIi16) # define @KWIML@_INT_PRIi16 PRIi16 #else # define @KWIML@_INT_PRIi16 "i" #endif -#if defined(@KWIML@_INT_HAVE_INT16_T) && defined(SCNi16) +#if defined(@KWIML@_INT_HAVE_INT16_T) && defined(SCNi16) \ + && !defined(@KWIML@_INT_BROKEN_SCNi16) # define @KWIML@_INT_SCNi16 SCNi16 #else # define @KWIML@_INT_SCNi16 "hi" #endif /* 16-bit o, u, x, X */ -#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(PRIo16) +#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(PRIo16) \ + && !defined(@KWIML@_INT_BROKEN_PRIo16) # define @KWIML@_INT_PRIo16 PRIo16 #else # define @KWIML@_INT_PRIo16 "o" #endif -#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(SCNo16) +#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(SCNo16) \ + && !defined(@KWIML@_INT_BROKEN_SCNo16) # define @KWIML@_INT_SCNo16 SCNo16 #else # define @KWIML@_INT_SCNo16 "ho" #endif -#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(PRIu16) +#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(PRIu16) \ + && !defined(@KWIML@_INT_BROKEN_PRIu16) # define @KWIML@_INT_PRIu16 PRIu16 #else # define @KWIML@_INT_PRIu16 "u" #endif -#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(SCNu16) +#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(SCNu16) \ + && !defined(@KWIML@_INT_BROKEN_SCNu16) # define @KWIML@_INT_SCNu16 SCNu16 #else # define @KWIML@_INT_SCNu16 "hu" #endif -#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(PRIx16) +#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(PRIx16) \ + && !defined(@KWIML@_INT_BROKEN_PRIx16) # define @KWIML@_INT_PRIx16 PRIx16 #else # define @KWIML@_INT_PRIx16 "x" #endif -#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(SCNx16) +#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(SCNx16) \ + && !defined(@KWIML@_INT_BROKEN_SCNx16) # define @KWIML@_INT_SCNx16 SCNx16 #else # define @KWIML@_INT_SCNx16 "hx" #endif -#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(PRIX16) +#if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(PRIX16) \ + && !defined(@KWIML@_INT_BROKEN_PRIX16) # define @KWIML@_INT_PRIX16 PRIX16 #else # define @KWIML@_INT_PRIX16 "X" #endif /* 16-bit constants */ -#if defined(INT16_C) +#if defined(INT16_C) && !defined(@KWIML@_INT_BROKEN_INT16_C) # define @KWIML@_INT_INT16_C(c) INT16_C(c) #else # define @KWIML@_INT_INT16_C(c) c #endif -#if defined(UINT16_C) +#if defined(UINT16_C) && !defined(@KWIML@_INT_BROKEN_UINT16_C) # define @KWIML@_INT_UINT16_C(c) UINT16_C(c) #else # define @KWIML@_INT_UINT16_C(c) c ## u @@ -374,71 +460,88 @@ An includer may test the following macros after inclusion: #endif /* 32-bit d, i */ -#if defined(@KWIML@_INT_HAVE_INT32_T) && defined(PRId32) +#if defined(@KWIML@_INT_HAVE_INT32_T) && defined(PRId32) \ + && !defined(@KWIML@_INT_BROKEN_PRId32) # define @KWIML@_INT_PRId32 PRId32 #else # define @KWIML@_INT_PRId32 "d" #endif -#if defined(@KWIML@_INT_HAVE_INT32_T) && defined(SCNd32) +#if defined(@KWIML@_INT_HAVE_INT32_T) && defined(SCNd32) \ + && !defined(@KWIML@_INT_BROKEN_SCNd32) # define @KWIML@_INT_SCNd32 SCNd32 #else # define @KWIML@_INT_SCNd32 "d" #endif -#if defined(@KWIML@_INT_HAVE_INT32_T) && defined(PRIi32) +#if defined(@KWIML@_INT_HAVE_INT32_T) && defined(PRIi32) \ + && !defined(@KWIML@_INT_BROKEN_PRIi32) # define @KWIML@_INT_PRIi32 PRIi32 #else # define @KWIML@_INT_PRIi32 "i" #endif -#if defined(@KWIML@_INT_HAVE_INT32_T) && defined(SCNi32) +#if defined(@KWIML@_INT_HAVE_INT32_T) && defined(SCNi32) \ + && !defined(@KWIML@_INT_BROKEN_SCNi32) # define @KWIML@_INT_SCNi32 SCNi32 #else # define @KWIML@_INT_SCNi32 "i" #endif /* 32-bit o, u, x, X */ -#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(PRIo32) +#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(PRIo32) \ + && !defined(@KWIML@_INT_BROKEN_PRIo32) # define @KWIML@_INT_PRIo32 PRIo32 #else # define @KWIML@_INT_PRIo32 "o" #endif -#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(SCNo32) +#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(SCNo32) \ + && !defined(@KWIML@_INT_BROKEN_SCNo32) # define @KWIML@_INT_SCNo32 SCNo32 #else # define @KWIML@_INT_SCNo32 "o" #endif -#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(PRIu32) +#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(PRIu32) \ + && !defined(@KWIML@_INT_BROKEN_PRIu32) # define @KWIML@_INT_PRIu32 PRIu32 #else # define @KWIML@_INT_PRIu32 "u" #endif -#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(SCNu32) +#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(SCNu32) \ + && !defined(@KWIML@_INT_BROKEN_SCNu32) # define @KWIML@_INT_SCNu32 SCNu32 #else # define @KWIML@_INT_SCNu32 "u" #endif -#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(PRIx32) +#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(PRIx32) \ + && !defined(@KWIML@_INT_BROKEN_PRIx32) # define @KWIML@_INT_PRIx32 PRIx32 #else # define @KWIML@_INT_PRIx32 "x" #endif -#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(SCNx32) +#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(SCNx32) \ + && !defined(@KWIML@_INT_BROKEN_SCNx32) # define @KWIML@_INT_SCNx32 SCNx32 #else # define @KWIML@_INT_SCNx32 "x" #endif -#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(PRIX32) +#if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(PRIX32) \ + && !defined(@KWIML@_INT_BROKEN_PRIX32) # define @KWIML@_INT_PRIX32 PRIX32 #else # define @KWIML@_INT_PRIX32 "X" #endif +#if defined(__hpux) && defined(__GNUC__) && !defined(__LP64__) \ + && defined(__CONCAT__) && defined(__CONCAT_U__) + /* Some HPs define UINT32_C incorrectly and break GNU. */ +# define @KWIML@_INT_BROKEN_UINT32_C +#endif + /* 32-bit constants */ -#if defined(INT32_C) +#if defined(INT32_C) && !defined(@KWIML@_INT_BROKEN_INT32_C) # define @KWIML@_INT_INT32_C(c) INT32_C(c) #else # define @KWIML@_INT_INT32_C(c) c #endif -#if defined(UINT32_C) +#if defined(UINT32_C) && !defined(@KWIML@_INT_BROKEN_UINT32_C) # define @KWIML@_INT_UINT32_C(c) UINT32_C(c) #else # define @KWIML@_INT_UINT32_C(c) c ## u @@ -498,59 +601,70 @@ An includer may test the following macros after inclusion: #endif /* 64-bit d, i */ -#if defined(@KWIML@_INT_HAVE_INT64_T) && defined(PRId64) +#if defined(@KWIML@_INT_HAVE_INT64_T) && defined(PRId64) \ + && !defined(@KWIML@_INT_BROKEN_PRId64) # define @KWIML@_INT_PRId64 PRId64 #elif defined(@KWIML@_INT__FMT64) # define @KWIML@_INT_PRId64 @KWIML@_INT__FMT64 "d" #endif -#if defined(@KWIML@_INT_HAVE_INT64_T) && defined(SCNd64) +#if defined(@KWIML@_INT_HAVE_INT64_T) && defined(SCNd64) \ + && !defined(@KWIML@_INT_BROKEN_SCNd64) # define @KWIML@_INT_SCNd64 SCNd64 #elif defined(@KWIML@_INT__FMT64) && !defined(@KWIML@_INT__NO_SCN64) # define @KWIML@_INT_SCNd64 @KWIML@_INT__FMT64 "d" #endif -#if defined(@KWIML@_INT_HAVE_INT64_T) && defined(PRIi64) +#if defined(@KWIML@_INT_HAVE_INT64_T) && defined(PRIi64) \ + && !defined(@KWIML@_INT_BROKEN_PRIi64) # define @KWIML@_INT_PRIi64 PRIi64 #elif defined(@KWIML@_INT__FMT64) # define @KWIML@_INT_PRIi64 @KWIML@_INT__FMT64 "d" #endif -#if defined(@KWIML@_INT_HAVE_INT64_T) && defined(SCNi64) +#if defined(@KWIML@_INT_HAVE_INT64_T) && defined(SCNi64) \ + && !defined(@KWIML@_INT_BROKEN_SCNi64) # define @KWIML@_INT_SCNi64 SCNi64 #elif defined(@KWIML@_INT__FMT64) && !defined(@KWIML@_INT__NO_SCN64) # define @KWIML@_INT_SCNi64 @KWIML@_INT__FMT64 "d" #endif /* 64-bit o, u, x, X */ -#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(PRIo64) +#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(PRIo64) \ + && !defined(@KWIML@_INT_BROKEN_PRIo64) # define @KWIML@_INT_PRIo64 PRIo64 #elif defined(@KWIML@_INT__FMT64) # define @KWIML@_INT_PRIo64 @KWIML@_INT__FMT64 "o" #endif -#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(SCNo64) +#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(SCNo64) \ + && !defined(@KWIML@_INT_BROKEN_SCNo64) # define @KWIML@_INT_SCNo64 SCNo64 #elif defined(@KWIML@_INT__FMT64) && !defined(@KWIML@_INT__NO_SCN64) # define @KWIML@_INT_SCNo64 @KWIML@_INT__FMT64 "o" #endif -#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(PRIu64) +#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(PRIu64) \ + && !defined(@KWIML@_INT_BROKEN_PRIu64) # define @KWIML@_INT_PRIu64 PRIu64 #elif defined(@KWIML@_INT__FMT64) # define @KWIML@_INT_PRIu64 @KWIML@_INT__FMT64 "u" #endif -#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(SCNu64) +#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(SCNu64) \ + && !defined(@KWIML@_INT_BROKEN_SCNu64) # define @KWIML@_INT_SCNu64 SCNu64 #elif defined(@KWIML@_INT__FMT64) && !defined(@KWIML@_INT__NO_SCN64) # define @KWIML@_INT_SCNu64 @KWIML@_INT__FMT64 "u" #endif -#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(PRIx64) +#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(PRIx64) \ + && !defined(@KWIML@_INT_BROKEN_PRIx64) # define @KWIML@_INT_PRIx64 PRIx64 #elif defined(@KWIML@_INT__FMT64) # define @KWIML@_INT_PRIx64 @KWIML@_INT__FMT64 "x" #endif -#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(SCNx64) +#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(SCNx64) \ + && !defined(@KWIML@_INT_BROKEN_SCNx64) # define @KWIML@_INT_SCNx64 SCNx64 #elif defined(@KWIML@_INT__FMT64) && !defined(@KWIML@_INT__NO_SCN64) # define @KWIML@_INT_SCNx64 @KWIML@_INT__FMT64 "x" #endif -#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(PRIX64) +#if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(PRIX64) \ + && !defined(@KWIML@_INT_BROKEN_PRIX64) # define @KWIML@_INT_PRIX64 PRIX64 #elif defined(@KWIML@_INT__FMT64) # define @KWIML@_INT_PRIX64 @KWIML@_INT__FMT64 "X" @@ -602,28 +716,32 @@ An includer may test the following macros after inclusion: # error "No type known for 'uintptr_t'." #endif -#if defined(@KWIML@_INT_HAVE_INTPTR_T) && defined(PRIdPTR) +#if defined(@KWIML@_INT_HAVE_INTPTR_T) && defined(PRIdPTR) \ + && !defined(@KWIML@_INT_BROKEN_PRIdPTR) # define @KWIML@_INT_PRIdPTR PRIdPTR #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4 # define @KWIML@_INT_PRIdPTR @KWIML@_INT_PRId32 #elif !defined(@KWIML@_INT_NO_UINT64_T) # define @KWIML@_INT_PRIdPTR @KWIML@_INT_PRId64 #endif -#if defined(@KWIML@_INT_HAVE_INTPTR_T) && defined(SCNdPTR) +#if defined(@KWIML@_INT_HAVE_INTPTR_T) && defined(SCNdPTR) \ + && !defined(@KWIML@_INT_BROKEN_SCNdPTR) # define @KWIML@_INT_SCNdPTR SCNdPTR #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4 # define @KWIML@_INT_SCNdPTR @KWIML@_INT_SCNd32 #elif !defined(@KWIML@_INT_NO_UINT64_T) # define @KWIML@_INT_SCNdPTR @KWIML@_INT_SCNd64 #endif -#if defined(@KWIML@_INT_HAVE_INTPTR_T) && defined(PRIiPTR) +#if defined(@KWIML@_INT_HAVE_INTPTR_T) && defined(PRIiPTR) \ + && !defined(@KWIML@_INT_BROKEN_PRIiPTR) # define @KWIML@_INT_PRIiPTR PRIiPTR #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4 # define @KWIML@_INT_PRIiPTR @KWIML@_INT_PRIi32 #elif !defined(@KWIML@_INT_NO_UINT64_T) # define @KWIML@_INT_PRIiPTR @KWIML@_INT_PRIi64 #endif -#if defined(@KWIML@_INT_HAVE_INTPTR_T) && defined(SCNiPTR) +#if defined(@KWIML@_INT_HAVE_INTPTR_T) && defined(SCNiPTR) \ + && !defined(@KWIML@_INT_BROKEN_SCNiPTR) # define @KWIML@_INT_SCNiPTR SCNiPTR #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4 # define @KWIML@_INT_SCNiPTR @KWIML@_INT_SCNi32 @@ -631,49 +749,56 @@ An includer may test the following macros after inclusion: # define @KWIML@_INT_SCNiPTR @KWIML@_INT_SCNi64 #endif -#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(PRIoPTR) +#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(PRIoPTR) \ + && !defined(@KWIML@_INT_BROKEN_PRIoPTR) # define @KWIML@_INT_PRIoPTR PRIoPTR #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4 # define @KWIML@_INT_PRIoPTR @KWIML@_INT_PRIo32 #elif !defined(@KWIML@_INT_NO_UINT64_T) # define @KWIML@_INT_PRIoPTR @KWIML@_INT_PRIo64 #endif -#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(SCNoPTR) +#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(SCNoPTR) \ + && !defined(@KWIML@_INT_BROKEN_SCNoPTR) # define @KWIML@_INT_SCNoPTR SCNoPTR #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4 # define @KWIML@_INT_SCNoPTR @KWIML@_INT_SCNo32 #elif !defined(@KWIML@_INT_NO_UINT64_T) # define @KWIML@_INT_SCNoPTR @KWIML@_INT_SCNo64 #endif -#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(PRIuPTR) +#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(PRIuPTR) \ + && !defined(@KWIML@_INT_BROKEN_PRIuPTR) # define @KWIML@_INT_PRIuPTR PRIuPTR #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4 # define @KWIML@_INT_PRIuPTR @KWIML@_INT_PRIu32 #elif !defined(@KWIML@_INT_NO_UINT64_T) # define @KWIML@_INT_PRIuPTR @KWIML@_INT_PRIu64 #endif -#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(SCNuPTR) +#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(SCNuPTR) \ + && !defined(@KWIML@_INT_BROKEN_SCNuPTR) # define @KWIML@_INT_SCNuPTR SCNuPTR #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4 # define @KWIML@_INT_SCNuPTR @KWIML@_INT_SCNu32 #elif !defined(@KWIML@_INT_NO_UINT64_T) # define @KWIML@_INT_SCNuPTR @KWIML@_INT_SCNu64 #endif -#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(PRIxPTR) +#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(PRIxPTR) \ + && !defined(@KWIML@_INT_BROKEN_PRIxPTR) # define @KWIML@_INT_PRIxPTR PRIxPTR #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4 # define @KWIML@_INT_PRIxPTR @KWIML@_INT_PRIx32 #elif !defined(@KWIML@_INT_NO_UINT64_T) # define @KWIML@_INT_PRIxPTR @KWIML@_INT_PRIx64 #endif -#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(SCNxPTR) +#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(SCNxPTR) \ + && !defined(@KWIML@_INT_BROKEN_SCNxPTR) # define @KWIML@_INT_SCNxPTR SCNxPTR #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4 # define @KWIML@_INT_SCNxPTR @KWIML@_INT_SCNx32 #elif !defined(@KWIML@_INT_NO_UINT64_T) # define @KWIML@_INT_SCNxPTR @KWIML@_INT_SCNx64 #endif -#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(PRIXPTR) +#if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(PRIXPTR) \ + && !defined(@KWIML@_INT_BROKEN_PRIXPTR) # define @KWIML@_INT_PRIXPTR PRIXPTR #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4 # define @KWIML@_INT_PRIXPTR @KWIML@_INT_PRIX32 diff --git a/Utilities/SetupForDevelopment.sh b/Utilities/SetupForDevelopment.sh new file mode 100755 index 0000000..0a9df7e --- /dev/null +++ b/Utilities/SetupForDevelopment.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +cd "${BASH_SOURCE%/*}/.." && +Utilities/GitSetup/setup-user && echo && +Utilities/GitSetup/setup-hooks && echo && +Utilities/GitSetup/setup-stage && echo && +(Utilities/GitSetup/setup-ssh || + echo 'Failed to setup SSH. Run this again to retry.') && echo && +Utilities/GitSetup/tips + +# Rebase master by default +git config rebase.stat true +git config branch.master.rebase true diff --git a/Utilities/cmbzip2/sample1.bz2 b/Utilities/cmbzip2/sample1.bz2 Binary files differdeleted file mode 100644 index 4edda36..0000000 --- a/Utilities/cmbzip2/sample1.bz2 +++ /dev/null diff --git a/Utilities/cmbzip2/sample2.bz2 b/Utilities/cmbzip2/sample2.bz2 Binary files differdeleted file mode 100644 index 8e54297..0000000 --- a/Utilities/cmbzip2/sample2.bz2 +++ /dev/null diff --git a/Utilities/cmbzip2/sample3.bz2 b/Utilities/cmbzip2/sample3.bz2 Binary files differdeleted file mode 100644 index 1ebcc2a..0000000 --- a/Utilities/cmbzip2/sample3.bz2 +++ /dev/null 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..bbf58fd 100644 --- a/Utilities/cmlibarchive/libarchive/archive_endian.h +++ b/Utilities/cmlibarchive/libarchive/archive_endian.h @@ -44,9 +44,15 @@ * - Watcom C++ in C code. (For any version?) * - SGI MIPSpro * - Microsoft Visual C++ 6.0 (supposedly newer versions too) + * - IBM VisualAge 6 (XL v6) + * - Sun WorkShop C (SunPro) before 5.9 */ #if defined(__WATCOMC__) || defined(__sgi) || defined(__hpux) || defined(__BORLANDC__) #define inline +#elif defined(__IBMC__) && __IBMC__ < 700 +#define inline +#elif defined(__SUNPRO_C) && __SUNPRO_C < 0x590 +#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, @@ -18,18 +18,11 @@ die() { # Version number extraction function. cmake_version_component() { - cat "${cmake_source_dir}/CMakeLists.txt" | sed -n " + cat "${cmake_source_dir}/Source/CMakeVersion.cmake" | sed -n " /^SET(CMake_VERSION_${1}/ {s/SET(CMake_VERSION_${1} *\([0-9]*\))/\1/;p;} " } -cmake_date_stamp_component() -{ - cat "${cmake_source_dir}/Source/kwsys/kwsysDateStamp.cmake" | sed -n " -/KWSYS_DATE_STAMP_${1}/ {s/^.* \([0-9][0-9]*\))$/\1/;p;} -" -} - cmake_toupper() { echo "$1" | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' @@ -46,9 +39,6 @@ cmake_version_minor="`cmake_version_component MINOR`" cmake_version_patch="`cmake_version_component PATCH`" cmake_version="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}" cmake_version_tweak="`cmake_version_component TWEAK`" -if [ "x$cmake_version_tweak" = "x" ]; then - cmake_version_tweak="`cmake_date_stamp_component YEAR``cmake_date_stamp_component MONTH``cmake_date_stamp_component DAY`" -fi if [ "$cmake_version_tweak" != "0" ]; then cmake_version="${cmake_version}.${cmake_version_tweak}" fi @@ -405,7 +395,6 @@ cmake_kwsys_config_replace_string () echo "${APPEND}" > "${OUTFILE}${_tmp}" cat "${INFILE}" | sed "/./ {s/\@KWSYS_NAMESPACE\@/cmsys/g; - s/@KWSYS_DO_NOT_CLEAN_PUTENV@/0/g; s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g; s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g; s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g; @@ -460,6 +449,12 @@ cmake_escape () echo $1 | sed "s/ /\\\\ /g" } +# Strip prefix from argument +cmake_arg () +{ + echo "$1" | sed "s/^${2-[^=]*=}//" +} + # Write message to the log cmake_log () { @@ -544,21 +539,24 @@ cmake_ccache_enabled= cmake_prefix_dir="${cmake_default_prefix}" while test $# != 0; do case "$1" in - --prefix=*) cmake_prefix_dir=`cmake_fix_slashes "${1#*=}"` ;; - --parallel=*) cmake_parallel_make="${1#*=}" ;; - --datadir=*) cmake_data_dir="${1#*=}" ;; - --docdir=*) cmake_doc_dir="${1#*=}" ;; - --mandir=*) cmake_man_dir="${1#*=}" ;; - --init=*) cmake_init_file="${1#*=}" ;; + --prefix=*) dir=`cmake_arg "$1"` + cmake_prefix_dir=`cmake_fix_slashes "$dir"` ;; + --parallel=*) cmake_parallel_make=`cmake_arg "$1"` ;; + --datadir=*) cmake_data_dir=`cmake_arg "$1"` ;; + --docdir=*) cmake_doc_dir=`cmake_arg "$1"` ;; + --mandir=*) cmake_man_dir=`cmake_arg "$1"` ;; + --init=*) cmake_init_file=`cmake_arg "$1"` ;; --system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=1" ;; --no-system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=0" ;; --system-bzip2|--system-curl|--system-expat|--system-libarchive|--system-zlib) - cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper ${1#--system-}`=1" ;; + lib=`cmake_arg "$1" "--system-"` + cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=1" ;; --no-system-bzip2|--no-system-curl|--no-system-expat|--no-system-libarchive|--no-system-zlib) - cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper ${1#--no-system-}`=0" ;; + lib=`cmake_arg "$1" "--no-system-"` + cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=0" ;; --qt-gui) cmake_bootstrap_qt_gui="1" ;; --no-qt-gui) cmake_bootstrap_qt_gui="0" ;; - --qt-qmake=*) cmake_bootstrap_qt_qmake="${1#*=}" ;; + --qt-qmake=*) cmake_bootstrap_qt_qmake=`cmake_arg "$1"` ;; --help) cmake_usage ;; --version) cmake_version_display ; exit 2 ;; --verbose) cmake_verbose=TRUE ;; @@ -1049,6 +1047,9 @@ KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE=0 KWSYS_STL_HAS_ALLOCATOR_REBIND=0 KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT=0 KWSYS_STL_HAS_ALLOCATOR_OBJECTS=0 +KWSYS_CXX_HAS_SETENV=0 +KWSYS_CXX_HAS_UNSETENV=0 +KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=0 KWSYS_CXX_HAS_CSTDDEF=0 KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS=0 KWSYS_CXX_HAS_MEMBER_TEMPLATES=0 @@ -1060,6 +1061,33 @@ KWSYS_STL_STRING_HAVE_ISTREAM=1 KWSYS_STL_STRING_HAVE_OSTREAM=1 if cmake_try_run "${cmake_cxx_compiler}" \ + "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_SETENV" \ + "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then + KWSYS_CXX_HAS_SETENV=1 + echo "${cmake_cxx_compiler} has setenv" +else + echo "${cmake_cxx_compiler} does not have setenv" +fi + +if cmake_try_run "${cmake_cxx_compiler}" \ + "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_UNSETENV" \ + "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then + KWSYS_CXX_HAS_UNSETENV=1 + echo "${cmake_cxx_compiler} has unsetenv" +else + echo "${cmake_cxx_compiler} does not have unsetenv" +fi + +if cmake_try_run "${cmake_cxx_compiler}" \ + "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H" \ + "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then + KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=1 + echo "${cmake_cxx_compiler} has environ in stdlib.h" +else + echo "${cmake_cxx_compiler} does not have environ in stdlib.h" +fi + +if cmake_try_run "${cmake_cxx_compiler}" \ "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAVE_STD" \ "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then KWSYS_STL_HAVE_STD=1 @@ -1375,7 +1403,7 @@ cmake_replace_string "${cmake_source_dir}/Source/kwsys/kwsys_stl.hxx.in" \ cmake_replace_string "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx_a" \ "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx_b" KWSYS_NAMESPACE cmsys -for a in string vector map algorithm; do +for a in string vector set map algorithm; do cmake_replace_string "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx_b" \ "${cmake_bootstrap_dir}/cmsys/stl/${a}" KWSYS_STL_HEADER ${a} done @@ -1406,6 +1434,7 @@ if [ "x${cmake_cxx_flags}" != "x" ]; then fi cmake_c_flags_String="-DKWSYS_STRING_C" +cmake_cxx_flags_SystemTools="-DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV} -DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV} -DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}" cmake_c_flags="${cmake_c_flags}-I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \ -I`cmake_escape \"${cmake_bootstrap_dir}\"`" cmake_cxx_flags="${cmake_cxx_flags} -I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \ @@ -1431,8 +1460,9 @@ for a in ${KWSYS_C_SOURCES} ${KWSYS_C_MINGW_SOURCES}; do done for a in ${KWSYS_CXX_SOURCES}; do src=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.cxx"` + src_flags=`eval echo \\${cmake_cxx_flags_\${a}}` echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile" - echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile" + echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile" done if ${cmake_system_mingw}; then src=`cmake_escape "${cmake_bootstrap_dir}/cmsysProcessFwd9xEnc.c"` |