parent
60ee04bd10
commit
c35ced89e6
@ -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)
|
@ -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)
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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()
|
@ -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 )
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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"
|
@ -0,0 +1,6 @@
|
||||
# CMake version number components.
|
||||
SET(CMake_VERSION_MAJOR 2)
|
||||
SET(CMake_VERSION_MINOR 8)
|
||||
SET(CMake_VERSION_PATCH 9)
|
||||
SET(CMake_VERSION_TWEAK 0)
|
||||
SET(CMake_VERSION_RC 1)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue