mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Merge pull request #10403 from Icinga/drop-superfluous-cmake-modules
Drop superfluous cmake modules
This commit is contained in:
commit
cfca8909ae
221
third-party/cmake/FindBISON.cmake
vendored
221
third-party/cmake/FindBISON.cmake
vendored
@ -1,221 +0,0 @@
|
||||
# - Find bison executable and provides macros to generate custom build rules
|
||||
# The module defines the following variables:
|
||||
#
|
||||
# BISON_EXECUTABLE - path to the bison program
|
||||
# BISON_VERSION - version of bison
|
||||
# BISON_FOUND - true if the program was found
|
||||
#
|
||||
# If bison is found, the module defines the macros:
|
||||
# BISON_TARGET(<Name> <YaccInput> <CodeOutput> [VERBOSE <file>]
|
||||
# [COMPILE_FLAGS <string>] [HEADER <FILE>])
|
||||
# which will create a custom rule to generate a parser. <YaccInput> is
|
||||
# the path to a yacc file. <CodeOutput> is the name of the source file
|
||||
# generated by bison. A header file containing the token list is also
|
||||
# generated according to bison's -d option by default or if the HEADER
|
||||
# option is used, the argument is passed to bison's --defines option to
|
||||
# specify output file. If COMPILE_FLAGS option is specified, the next
|
||||
# parameter is added in the bison command line. if VERBOSE option is
|
||||
# specified, <file> is created and contains verbose descriptions of the
|
||||
# grammar and parser. The macro defines a set of variables:
|
||||
# BISON_${Name}_DEFINED - true is the macro ran successfully
|
||||
# BISON_${Name}_INPUT - The input source file, an alias for <YaccInput>
|
||||
# BISON_${Name}_OUTPUT_SOURCE - The source file generated by bison
|
||||
# BISON_${Name}_OUTPUT_HEADER - The header file generated by bison
|
||||
# BISON_${Name}_OUTPUTS - The sources files generated by bison
|
||||
# BISON_${Name}_COMPILE_FLAGS - Options used in the bison command line
|
||||
#
|
||||
# ====================================================================
|
||||
# Example:
|
||||
#
|
||||
# find_package(BISON)
|
||||
# BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
|
||||
# add_executable(Foo main.cpp ${BISON_MyParser_OUTPUTS})
|
||||
# ====================================================================
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
# Modified 2010 by Jon Siwek, adding HEADER option
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License"):
|
||||
# CMake - Cross Platform Makefile Generator
|
||||
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
||||
# All rights reserved.
|
||||
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
|
||||
# nor the names of their contributors may be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# 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.
|
||||
#=============================================================================
|
||||
|
||||
FIND_PROGRAM(BISON_EXECUTABLE bison DOC "path to the bison executable")
|
||||
MARK_AS_ADVANCED(BISON_EXECUTABLE)
|
||||
|
||||
IF(BISON_EXECUTABLE)
|
||||
|
||||
EXECUTE_PROCESS(COMMAND ${BISON_EXECUTABLE} --version
|
||||
OUTPUT_VARIABLE BISON_version_output
|
||||
ERROR_VARIABLE BISON_version_error
|
||||
RESULT_VARIABLE BISON_version_result
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
IF(NOT ${BISON_version_result} EQUAL 0)
|
||||
MESSAGE(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
|
||||
ELSE()
|
||||
STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
|
||||
BISON_VERSION "${BISON_version_output}")
|
||||
ENDIF()
|
||||
|
||||
# internal macro
|
||||
MACRO(BISON_TARGET_option_verbose Name BisonOutput filename)
|
||||
LIST(APPEND BISON_TARGET_cmdopt "--verbose")
|
||||
GET_FILENAME_COMPONENT(BISON_TARGET_output_path "${BisonOutput}" PATH)
|
||||
GET_FILENAME_COMPONENT(BISON_TARGET_output_name "${BisonOutput}" NAME_WE)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${filename}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
ARGS -E copy
|
||||
"${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
|
||||
"${filename}"
|
||||
DEPENDS
|
||||
"${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
|
||||
COMMENT "[BISON][${Name}] Copying bison verbose table to ${filename}"
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||
SET(BISON_${Name}_VERBOSE_FILE ${filename})
|
||||
LIST(APPEND BISON_TARGET_extraoutputs
|
||||
"${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output")
|
||||
ENDMACRO(BISON_TARGET_option_verbose)
|
||||
|
||||
# internal macro
|
||||
MACRO(BISON_TARGET_option_extraopts Options)
|
||||
SET(BISON_TARGET_extraopts "${Options}")
|
||||
SEPARATE_ARGUMENTS(BISON_TARGET_extraopts)
|
||||
LIST(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts})
|
||||
ENDMACRO(BISON_TARGET_option_extraopts)
|
||||
|
||||
#============================================================
|
||||
# BISON_TARGET (public macro)
|
||||
#============================================================
|
||||
#
|
||||
MACRO(BISON_TARGET Name BisonInput BisonOutput)
|
||||
SET(BISON_TARGET_output_header "")
|
||||
#SET(BISON_TARGET_command_opt "")
|
||||
SET(BISON_TARGET_cmdopt "")
|
||||
SET(BISON_TARGET_outputs "${BisonOutput}")
|
||||
IF(NOT ${ARGC} EQUAL 3 AND
|
||||
NOT ${ARGC} EQUAL 5 AND
|
||||
NOT ${ARGC} EQUAL 7 AND
|
||||
NOT ${ARGC} EQUAL 9)
|
||||
MESSAGE(SEND_ERROR "Usage")
|
||||
ELSE()
|
||||
# Parsing parameters
|
||||
IF(${ARGC} GREATER 5 OR ${ARGC} EQUAL 5)
|
||||
IF("${ARGV3}" STREQUAL "VERBOSE")
|
||||
BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV4}")
|
||||
ENDIF()
|
||||
IF("${ARGV3}" STREQUAL "COMPILE_FLAGS")
|
||||
BISON_TARGET_option_extraopts("${ARGV4}")
|
||||
ENDIF()
|
||||
IF("${ARGV3}" STREQUAL "HEADER")
|
||||
set(BISON_TARGET_output_header "${ARGV4}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(${ARGC} GREATER 7 OR ${ARGC} EQUAL 7)
|
||||
IF("${ARGV5}" STREQUAL "VERBOSE")
|
||||
BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV6}")
|
||||
ENDIF()
|
||||
|
||||
IF("${ARGV5}" STREQUAL "COMPILE_FLAGS")
|
||||
BISON_TARGET_option_extraopts("${ARGV6}")
|
||||
ENDIF()
|
||||
|
||||
IF("${ARGV5}" STREQUAL "HEADER")
|
||||
set(BISON_TARGET_output_header "${ARGV6}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(${ARGC} EQUAL 9)
|
||||
IF("${ARGV7}" STREQUAL "VERBOSE")
|
||||
BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV8}")
|
||||
ENDIF()
|
||||
|
||||
IF("${ARGV7}" STREQUAL "COMPILE_FLAGS")
|
||||
BISON_TARGET_option_extraopts("${ARGV8}")
|
||||
ENDIF()
|
||||
|
||||
IF("${ARGV7}" STREQUAL "HEADER")
|
||||
set(BISON_TARGET_output_header "${ARGV8}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(BISON_TARGET_output_header)
|
||||
# Header's name passed in as argument to be used in --defines option
|
||||
LIST(APPEND BISON_TARGET_cmdopt
|
||||
"--defines=${BISON_TARGET_output_header}")
|
||||
set(BISON_${Name}_OUTPUT_HEADER ${BISON_TARGET_output_header})
|
||||
ELSE()
|
||||
# Header's name generated by bison (see option -d)
|
||||
LIST(APPEND BISON_TARGET_cmdopt "-d")
|
||||
STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${ARGV2}")
|
||||
STRING(REPLACE "c" "h" _fileext ${_fileext})
|
||||
STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}"
|
||||
BISON_${Name}_OUTPUT_HEADER "${ARGV2}")
|
||||
ENDIF()
|
||||
|
||||
LIST(APPEND BISON_TARGET_outputs "${BISON_${Name}_OUTPUT_HEADER}")
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${BISON_TARGET_outputs}
|
||||
${BISON_TARGET_extraoutputs}
|
||||
COMMAND ${BISON_EXECUTABLE}
|
||||
ARGS ${BISON_TARGET_cmdopt} -o ${ARGV2} ${ARGV1}
|
||||
DEPENDS ${ARGV1}
|
||||
COMMENT "[BISON][${Name}] Building parser with bison ${BISON_VERSION}"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# define target variables
|
||||
SET(BISON_${Name}_DEFINED TRUE)
|
||||
SET(BISON_${Name}_INPUT ${ARGV1})
|
||||
SET(BISON_${Name}_OUTPUTS ${BISON_TARGET_outputs})
|
||||
SET(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
|
||||
SET(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
|
||||
|
||||
ENDIF(NOT ${ARGC} EQUAL 3 AND
|
||||
NOT ${ARGC} EQUAL 5 AND
|
||||
NOT ${ARGC} EQUAL 7 AND
|
||||
NOT ${ARGC} EQUAL 9)
|
||||
ENDMACRO(BISON_TARGET)
|
||||
#
|
||||
#============================================================
|
||||
|
||||
ENDIF(BISON_EXECUTABLE)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON DEFAULT_MSG BISON_EXECUTABLE)
|
||||
|
||||
# FindBISON.cmake ends here
|
185
third-party/cmake/FindFLEX.cmake
vendored
185
third-party/cmake/FindFLEX.cmake
vendored
@ -1,185 +0,0 @@
|
||||
# - Find flex executable and provides a macro to generate custom build rules
|
||||
#
|
||||
# The module defines the following variables:
|
||||
# FLEX_FOUND - true is flex executable is found
|
||||
# FLEX_EXECUTABLE - the path to the flex executable
|
||||
# FLEX_VERSION - the version of flex
|
||||
# FLEX_LIBRARIES - The flex libraries
|
||||
#
|
||||
# The minimum required version of flex can be specified using the
|
||||
# standard syntax, e.g. FIND_PACKAGE(FLEX 2.5.13)
|
||||
#
|
||||
#
|
||||
# If flex is found on the system, the module provides the macro:
|
||||
# FLEX_TARGET(Name FlexInput FlexOutput [COMPILE_FLAGS <string>])
|
||||
# which creates a custom command to generate the <FlexOutput> file from
|
||||
# the <FlexInput> file. If COMPILE_FLAGS option is specified, the next
|
||||
# parameter is added to the flex command line. Name is an alias used to
|
||||
# get details of this custom command. Indeed the macro defines the
|
||||
# following variables:
|
||||
# FLEX_${Name}_DEFINED - true is the macro ran successfully
|
||||
# FLEX_${Name}_OUTPUTS - the source file generated by the custom rule, an
|
||||
# alias for FlexOutput
|
||||
# FLEX_${Name}_INPUT - the flex source file, an alias for ${FlexInput}
|
||||
#
|
||||
# Flex scanners oftenly use tokens defined by Bison: the code generated
|
||||
# by Flex depends of the header generated by Bison. This module also
|
||||
# defines a macro:
|
||||
# ADD_FLEX_BISON_DEPENDENCY(FlexTarget BisonTarget)
|
||||
# which adds the required dependency between a scanner and a parser
|
||||
# where <FlexTarget> and <BisonTarget> are the first parameters of
|
||||
# respectively FLEX_TARGET and BISON_TARGET macros.
|
||||
#
|
||||
# ====================================================================
|
||||
# Example:
|
||||
#
|
||||
# find_package(BISON)
|
||||
# find_package(FLEX)
|
||||
#
|
||||
# BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp
|
||||
# FLEX_TARGET(MyScanner lexer.l ${CMAKE_CURRENT_BIANRY_DIR}/lexer.cpp)
|
||||
# ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
|
||||
#
|
||||
# include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
# add_executable(Foo
|
||||
# Foo.cc
|
||||
# ${BISON_MyParser_OUTPUTS}
|
||||
# ${FLEX_MyScanner_OUTPUTS}
|
||||
# )
|
||||
# ====================================================================
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
# Modified 2010 by Jon Siwek, backporting for CMake 2.6 compat
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License"):
|
||||
# CMake - Cross Platform Makefile Generator
|
||||
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
||||
# All rights reserved.
|
||||
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
|
||||
# nor the names of their contributors may be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# 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.
|
||||
#=============================================================================
|
||||
|
||||
FIND_PROGRAM(FLEX_EXECUTABLE flex DOC "path to the flex executable")
|
||||
MARK_AS_ADVANCED(FLEX_EXECUTABLE)
|
||||
|
||||
FIND_LIBRARY(FL_LIBRARY NAMES fl
|
||||
DOC "path to the fl library")
|
||||
MARK_AS_ADVANCED(FL_LIBRARY)
|
||||
SET(FLEX_LIBRARIES ${FL_LIBRARY})
|
||||
|
||||
IF(FLEX_EXECUTABLE)
|
||||
GET_FILENAME_COMPONENT(FLEX_EXECUTABLE_NAME ${FLEX_EXECUTABLE} NAME)
|
||||
EXECUTE_PROCESS(COMMAND ${FLEX_EXECUTABLE} --version
|
||||
OUTPUT_VARIABLE FLEX_version_output
|
||||
ERROR_VARIABLE FLEX_version_error
|
||||
RESULT_VARIABLE FLEX_version_result
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
IF(NOT ${FLEX_version_result} EQUAL 0)
|
||||
IF(FLEX_FIND_REQUIRED)
|
||||
MESSAGE(SEND_ERROR "Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}")
|
||||
ELSE()
|
||||
MESSAGE("Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}\nFLEX_VERSION will not be available")
|
||||
ENDIF()
|
||||
ELSE()
|
||||
STRING(REGEX REPLACE "^${FLEX_EXECUTABLE_NAME}[^ ]* (.*)$" "\\1"
|
||||
FLEX_VERSION "${FLEX_version_output}")
|
||||
ENDIF()
|
||||
|
||||
IF(FLEX_FIND_VERSION)
|
||||
IF("${FLEX_VERSION}" VERSION_LESS "${FLEX_FIND_VERSION}")
|
||||
MESSAGE(SEND_ERROR "Your version of flex is too old. You can specify an alternative path using -DFLEX_EXECUTABLE=/path/to/flex")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
#============================================================
|
||||
# FLEX_TARGET (public macro)
|
||||
#============================================================
|
||||
#
|
||||
MACRO(FLEX_TARGET Name Input Output)
|
||||
SET(FLEX_TARGET_usage "FLEX_TARGET(<Name> <Input> <Output> [COMPILE_FLAGS <string>]")
|
||||
IF(${ARGC} GREATER 3)
|
||||
IF(${ARGC} EQUAL 5)
|
||||
IF("${ARGV3}" STREQUAL "COMPILE_FLAGS")
|
||||
SET(FLEX_EXECUTABLE_opts "${ARGV4}")
|
||||
SEPARATE_ARGUMENTS(FLEX_EXECUTABLE_opts)
|
||||
ELSE()
|
||||
MESSAGE(SEND_ERROR ${FLEX_TARGET_usage})
|
||||
ENDIF()
|
||||
ELSE()
|
||||
MESSAGE(SEND_ERROR ${FLEX_TARGET_usage})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${Output}
|
||||
COMMAND ${FLEX_EXECUTABLE}
|
||||
ARGS ${FLEX_EXECUTABLE_opts} -o${Output} ${Input}
|
||||
DEPENDS ${Input}
|
||||
COMMENT "[FLEX][${Name}] Building scanner with flex ${FLEX_VERSION}"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
SET(FLEX_${Name}_DEFINED TRUE)
|
||||
SET(FLEX_${Name}_OUTPUTS ${Output})
|
||||
SET(FLEX_${Name}_INPUT ${Input})
|
||||
SET(FLEX_${Name}_COMPILE_FLAGS ${FLEX_EXECUTABLE_opts})
|
||||
ENDMACRO(FLEX_TARGET)
|
||||
#============================================================
|
||||
|
||||
|
||||
#============================================================
|
||||
# ADD_FLEX_BISON_DEPENDENCY (public macro)
|
||||
#============================================================
|
||||
#
|
||||
MACRO(ADD_FLEX_BISON_DEPENDENCY FlexTarget BisonTarget)
|
||||
|
||||
IF(NOT FLEX_${FlexTarget}_OUTPUTS)
|
||||
MESSAGE(SEND_ERROR "Flex target `${FlexTarget}' does not exists.")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT BISON_${BisonTarget}_OUTPUT_HEADER)
|
||||
MESSAGE(SEND_ERROR "Bison target `${BisonTarget}' does not exists.")
|
||||
ENDIF()
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${FLEX_${FlexTarget}_OUTPUTS}
|
||||
PROPERTIES OBJECT_DEPENDS ${BISON_${BisonTarget}_OUTPUT_HEADER})
|
||||
ENDMACRO(ADD_FLEX_BISON_DEPENDENCY)
|
||||
#============================================================
|
||||
|
||||
ENDIF(FLEX_EXECUTABLE)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX FLEX_EXECUTABLE
|
||||
FLEX_VERSION)
|
||||
|
||||
# FindFLEX.cmake ends here
|
73
third-party/cmake/FindGit.cmake
vendored
73
third-party/cmake/FindGit.cmake
vendored
@ -1,73 +0,0 @@
|
||||
#.rst:
|
||||
# FindGit
|
||||
# -------
|
||||
#
|
||||
#
|
||||
#
|
||||
# The module defines the following variables:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# GIT_EXECUTABLE - path to git command line client
|
||||
# GIT_FOUND - true if the command line client was found
|
||||
# GIT_VERSION_STRING - the version of git found (since CMake 2.8.8)
|
||||
#
|
||||
# Example usage:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# find_package(Git)
|
||||
# if(GIT_FOUND)
|
||||
# message("git found: ${GIT_EXECUTABLE}")
|
||||
# endif()
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2010 Kitware, Inc.
|
||||
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
|
||||
#
|
||||
# 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.)
|
||||
|
||||
# Look for 'git' or 'eg' (easy git)
|
||||
#
|
||||
set(git_names git eg)
|
||||
|
||||
# Prefer .cmd variants on Windows unless running in a Makefile
|
||||
# in the MSYS shell.
|
||||
#
|
||||
if(WIN32)
|
||||
if(NOT CMAKE_GENERATOR MATCHES "MSYS")
|
||||
set(git_names git.cmd git eg.cmd eg)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_program(GIT_EXECUTABLE
|
||||
NAMES ${git_names}
|
||||
PATH_SUFFIXES Git/cmd Git/bin
|
||||
DOC "git command line client"
|
||||
)
|
||||
mark_as_advanced(GIT_EXECUTABLE)
|
||||
|
||||
if(GIT_EXECUTABLE)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} --version
|
||||
OUTPUT_VARIABLE git_version
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (git_version MATCHES "^git version [0-9]")
|
||||
string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Git GIT_EXECUTABLE
|
||||
GIT_VERSION_STRING)
|
245
third-party/cmake/GNUInstallDirs.cmake
vendored
245
third-party/cmake/GNUInstallDirs.cmake
vendored
@ -1,245 +0,0 @@
|
||||
#.rst:
|
||||
# GNUInstallDirs
|
||||
# --------------
|
||||
#
|
||||
# Define GNU standard installation directories
|
||||
#
|
||||
# Provides install directory variables as defined for GNU software:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
|
||||
#
|
||||
# Inclusion of this module defines the following variables:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CMAKE_INSTALL_<dir> - destination for files of a given type
|
||||
# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path
|
||||
#
|
||||
# where <dir> is one of:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# BINDIR - user executables (bin)
|
||||
# SBINDIR - system admin executables (sbin)
|
||||
# LIBEXECDIR - program executables (libexec)
|
||||
# SYSCONFDIR - read-only single-machine data (etc)
|
||||
# SHAREDSTATEDIR - modifiable architecture-independent data (com)
|
||||
# LOCALSTATEDIR - modifiable single-machine data (var)
|
||||
# LIBDIR - object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian)
|
||||
# INCLUDEDIR - C header files (include)
|
||||
# OLDINCLUDEDIR - C header files for non-gcc (/usr/include)
|
||||
# DATAROOTDIR - read-only architecture-independent data root (share)
|
||||
# DATADIR - read-only architecture-independent data (DATAROOTDIR)
|
||||
# INFODIR - info documentation (DATAROOTDIR/info)
|
||||
# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale)
|
||||
# MANDIR - man documentation (DATAROOTDIR/man)
|
||||
# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME)
|
||||
#
|
||||
# Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION
|
||||
# options of install() commands for the corresponding file type. If the
|
||||
# includer does not define a value the above-shown default will be used
|
||||
# and the value will appear in the cache for editing by the user. Each
|
||||
# CMAKE_INSTALL_FULL_<dir> value contains an absolute path constructed
|
||||
# from the corresponding destination by prepending (if necessary) the
|
||||
# value of CMAKE_INSTALL_PREFIX.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2011 Nikita Krupen'ko <krnekit@gmail.com>
|
||||
# Copyright 2011 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.)
|
||||
|
||||
# Installation directories
|
||||
#
|
||||
if(NOT DEFINED CMAKE_INSTALL_BINDIR)
|
||||
set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_SBINDIR)
|
||||
set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR)
|
||||
set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR)
|
||||
set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR)
|
||||
set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
|
||||
set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
||||
set(_LIBDIR_DEFAULT "lib")
|
||||
# Override this default 'lib' with 'lib64' iff:
|
||||
# - we are on Linux system but NOT cross-compiling
|
||||
# - we are NOT on debian
|
||||
# - we are on a 64 bits system
|
||||
# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
|
||||
# For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
|
||||
# CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
|
||||
# and CMAKE_INSTALL_PREFIX is "/usr"
|
||||
# See http://wiki.debian.org/Multiarch
|
||||
if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX)
|
||||
set(__LAST_LIBDIR_DEFAULT "lib")
|
||||
# __LAST_LIBDIR_DEFAULT is the default value that we compute from
|
||||
# _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX, not a cache entry for
|
||||
# the value that was last used as the default.
|
||||
# This value is used to figure out whether the user changed the
|
||||
# CMAKE_INSTALL_LIBDIR value manually, or if the value was the
|
||||
# default one. When CMAKE_INSTALL_PREFIX changes, the value is
|
||||
# updated to the new default, unless the user explicitly changed it.
|
||||
endif()
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
|
||||
AND NOT CMAKE_CROSSCOMPILING)
|
||||
if (EXISTS "/etc/debian_version") # is this a debian system ?
|
||||
if(CMAKE_LIBRARY_ARCHITECTURE)
|
||||
if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
|
||||
set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
|
||||
endif()
|
||||
if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX
|
||||
AND "${_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
|
||||
set(__LAST_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
|
||||
endif()
|
||||
endif()
|
||||
else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
|
||||
if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
|
||||
message(AUTHOR_WARNING
|
||||
"Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
|
||||
"Please enable at least one language before including GNUInstallDirs.")
|
||||
else()
|
||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||
set(_LIBDIR_DEFAULT "lib64")
|
||||
if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX)
|
||||
set(__LAST_LIBDIR_DEFAULT "lib64")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
||||
set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
|
||||
elseif(DEFINED __LAST_LIBDIR_DEFAULT
|
||||
AND "${__LAST_LIBDIR_DEFAULT}" STREQUAL "${CMAKE_INSTALL_LIBDIR}")
|
||||
set_property(CACHE CMAKE_INSTALL_LIBDIR PROPERTY VALUE "${_LIBDIR_DEFAULT}")
|
||||
endif()
|
||||
endif()
|
||||
# Save for next run
|
||||
set(_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "CMAKE_INSTALL_PREFIX during last run")
|
||||
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
|
||||
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR)
|
||||
set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR)
|
||||
set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Values whose defaults are relative to DATAROOTDIR. Store empty values in
|
||||
# the cache and store the defaults in local variables if the cache values are
|
||||
# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes.
|
||||
|
||||
if(NOT CMAKE_INSTALL_DATADIR)
|
||||
set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)")
|
||||
set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "(DragonFly|FreeBSD|OpenBSD|NetBSD)")
|
||||
if(NOT CMAKE_INSTALL_INFODIR)
|
||||
set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (info)")
|
||||
set(CMAKE_INSTALL_INFODIR "info")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_INSTALL_MANDDIR)
|
||||
set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (man)")
|
||||
set(CMAKE_INSTALL_MANDIR "man")
|
||||
endif()
|
||||
else()
|
||||
if(NOT CMAKE_INSTALL_INFODIR)
|
||||
set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)")
|
||||
set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_INSTALL_MANDDIR)
|
||||
set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)")
|
||||
set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_INSTALL_LOCALEDIR)
|
||||
set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)")
|
||||
set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_INSTALL_DOCDIR)
|
||||
set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
|
||||
set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
mark_as_advanced(
|
||||
CMAKE_INSTALL_BINDIR
|
||||
CMAKE_INSTALL_SBINDIR
|
||||
CMAKE_INSTALL_LIBEXECDIR
|
||||
CMAKE_INSTALL_SYSCONFDIR
|
||||
CMAKE_INSTALL_SHAREDSTATEDIR
|
||||
CMAKE_INSTALL_LOCALSTATEDIR
|
||||
CMAKE_INSTALL_LIBDIR
|
||||
CMAKE_INSTALL_INCLUDEDIR
|
||||
CMAKE_INSTALL_OLDINCLUDEDIR
|
||||
CMAKE_INSTALL_DATAROOTDIR
|
||||
CMAKE_INSTALL_DATADIR
|
||||
CMAKE_INSTALL_INFODIR
|
||||
CMAKE_INSTALL_LOCALEDIR
|
||||
CMAKE_INSTALL_MANDIR
|
||||
CMAKE_INSTALL_DOCDIR
|
||||
)
|
||||
|
||||
# Result directories
|
||||
#
|
||||
foreach(dir
|
||||
BINDIR
|
||||
SBINDIR
|
||||
LIBEXECDIR
|
||||
SYSCONFDIR
|
||||
SHAREDSTATEDIR
|
||||
LOCALSTATEDIR
|
||||
LIBDIR
|
||||
INCLUDEDIR
|
||||
OLDINCLUDEDIR
|
||||
DATAROOTDIR
|
||||
DATADIR
|
||||
INFODIR
|
||||
LOCALEDIR
|
||||
MANDIR
|
||||
DOCDIR
|
||||
)
|
||||
if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}})
|
||||
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}")
|
||||
endif()
|
||||
endforeach()
|
Loading…
x
Reference in New Issue
Block a user