diff --git a/.appveyor.yml b/.appveyor.yml index 9d1e451be..0a5e2d9a4 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,4 +1,4 @@ -version: 0.2.3.{build} +version: 0.3.0.{build} init: - cmd: git config --global core.autocrlf true diff --git a/CMakeLists.txt b/CMakeLists.txt index 59c76455b..750bd880c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ # License text for the above reference.) -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 3.0) project(YCM NONE) @@ -30,12 +30,6 @@ else() set(CMAKE_SUPPORTS_STRING_APPEND 0) endif() -if(NOT CMAKE_VERSION VERSION_LESS 3.0) - set(CMAKE_SUPPORTS_NEW_STYLE_COMMENTS 1) -else() - set(CMAKE_SUPPORTS_NEW_STYLE_COMMENTS 0) -endif() - list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/internal-modules") list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules") @@ -49,9 +43,7 @@ if(EXISTS "${CMAKE_SOURCE_DIR}/.git") endif() if(YCM_MAINTAINER_MODE) - if(NOT CMAKE_SUPPORTS_CMAKE_PARSE_ARGUMENTS OR - NOT CMAKE_SUPPORTS_STRING_APPEND OR - NOT CMAKE_SUPPORTS_NEW_STYLE_COMMENTS) + if(NOT CMAKE_SUPPORTS_CMAKE_PARSE_ARGUMENTS OR NOT CMAKE_SUPPORTS_STRING_APPEND) message(AUTHOR_WARNING "Maintainer mode enabled, but not all required features supported by CMake. YCM build might not be usable.") endif() diff --git a/YCMConfig.cmake.in b/YCMConfig.cmake.in index 9a0e999ce..d2492a4bb 100644 --- a/YCMConfig.cmake.in +++ b/YCMConfig.cmake.in @@ -56,9 +56,7 @@ foreach(_version 3.7 3.4 3.3 3.2 - 3.1 - 3.0 - 2.8.12) + 3.1) if(EXISTS "${YCM_MODULE_DIR}/cmake-${_version}" AND CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS ${_version} AND CMAKE_VERSION VERSION_LESS ${_version}) diff --git a/cmake-next/CMakeLists.txt b/cmake-next/CMakeLists.txt index f5f4ae039..fd35f999b 100644 --- a/cmake-next/CMakeLists.txt +++ b/cmake-next/CMakeLists.txt @@ -91,113 +91,30 @@ function(_YCM_CMAKE_NEXT_DOWNLOAD_NOW _ref _dir _files) endfunction() -# Downloaded modules CMake Version Comment string(APPEND) Uncommitted -# Version Style Changes -# (req 3.0) (req 3.4) -# SelectLibraryConfigurations 2.8.12 -# CMakeFindDependencyMacro 3.0 -# FindFreetype 3.0 -# FindLua 3.0 -# FeatureSummary 3.1 -# CMakePackageConfigHelpers 3.1 -# FindPkgConfig 3.1 New -# ExternalProject 3.3 New Yes +# Downloaded modules CMake Version string(APPEND) CMakeParseArguments Uncommitted +# Version without include Changes +# (req 3.4) +# FeatureSummary 3.1 3.8 +# CMakePackageConfigHelpers 3.1 3.8 +# FindPkgConfig 3.1 +# ExternalProject 3.3 Yes # GNUInstallDirs 3.4 -# FindGTK2 3.5 +# FindGTK2 3.5 3.8 # FindMatlab 3.7 -# UseSWIG master Yes -# CMakeParseArguments --- Yes -# FindGLEW --- Yes +# UseSWIG master Yes 3.8 +# CMakeParseArguments --- Yes +# FindGLEW --- Yes # # Changes in dependencies -# FindPackageHandleStandardArgs 3.3 3.7 - -################################################################################ -# Files not available or containing bugs in CMake 2.8.11.2 -# Imported from CMake tag v2.8.12.2 -if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) - # Just a reminder to remove this when we change cmake version - message(AUTHOR_WARNING "CMake minimum required version greater than 2.8.12. You can remove this.") -endif() - -# We assume that the user won't downgrade his cmake, therefore it's not -# necessary to download and install these files if already included in CMake -if(CMAKE_VERSION VERSION_LESS 2.8.12 OR YCM_MAINTAINER_MODE) - set(_files Copyright.txt cc156f64bf5196dfb35f7ae7a4081a434e128ef4 - Modules/SelectLibraryConfigurations.cmake b0f24bea56e731e219506a1936c08817dc556d0a) - _ycm_cmake_next_download(v2.8.12.2 "${CMAKE_CURRENT_BINARY_DIR}/cmake-2.8.12" "${_files}") - _ycm_cmake_next_install(v2.8.12.2 DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/cmake-2.8.12" - DESTINATION "${YCM_INSTALL_MODULE_DIR}") -endif() - - -################################################################################ -# Files not available or containing bugs in CMake 2.8.12.2 -# Imported from CMake tag v3.0.2 -if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.0) - # Just a reminder to remove this when we change cmake version - message(AUTHOR_WARNING "CMake minimum required version greater than 3.0. You can remove this.") -endif() - -# We assume that the user won't downgrade his cmake, therefore it's not -# necessary to download and install these files if already included in CMake -if(CMAKE_VERSION VERSION_LESS 3.0 OR YCM_MAINTAINER_MODE) - - set(_files Copyright.txt 84889816c71a04e30e715b89faf10d72a7334839 - Modules/CMakeFindDependencyMacro.cmake deb8d8b27adeb39cffd9190916fd5f0e3eca4c24 - Modules/FindFreetype.cmake b1a41d0d1321356beccc077495aa0d4c3d57e3a6 - Modules/FindLua.cmake 477a45a0d2554af399492fa2213da72b73315ed1 - Modules/FindPackageHandleStandardArgs.cmake 6f694a4c8de523b14ce1dbc44c3f5942fc467fc1 # Used by FindFreetype and FindLua - Modules/FindPackageMessage.cmake eceba493416b1ce30cecbbfad7d4835e80969195 # Used by FindPackageHandleStandardArgs - Modules/CMakeParseArguments.cmake 00c393ca7dfd7f9ea9d1a5dc99702dcaffd289af) # Used by FindPackageHandleStandardArgs - _ycm_cmake_next_download(v3.0.2 "${CMAKE_CURRENT_BINARY_DIR}/cmake-3.0" "${_files}") - _ycm_cmake_next_install(v3.0.2 DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/cmake-3.0" - DESTINATION "${YCM_INSTALL_MODULE_DIR}") -endif() - - -################################################################################ -# Files not available or containing bugs in CMake 3.0.2 -# Imported from CMake tag v3.1.3 -if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.1) - # Just a reminder to remove this when we change cmake version - message(AUTHOR_WARNING "CMake minimum required version greater than 3.1. You can remove this.") -endif() - -# We assume that the user won't downgrade his cmake, therefore it's not -# necessary to download and install these files if already included in CMake -if(CMAKE_VERSION VERSION_LESS 3.1 OR YCM_MAINTAINER_MODE) - - set(_files Copyright.txt be2d273ed3c3559df71debc3f07fbe76a31dea28 - Modules/FeatureSummary.cmake 3aeab8c56de0ea21a489cc3d90ee47f833c699bc - Modules/FindPackageHandleStandardArgs.cmake a8857b6817a645669f4fa5999081abf34fa25523 # Used by FindPkgConfig - Modules/FindPackageMessage.cmake dbc69daf94e8a4039286f4ae6a8702af418b253a # Used by FindPackageHandleStandardArgs - Modules/CMakeParseArguments.cmake 8adc20a6a6a0ca5a82338b6edc3cd6e24ba7b3f2) # Used by FeatureSummary and FindPackageHandleStandardArgs - set(_now_files - Modules/CMakePackageConfigHelpers.cmake 8d88059037b52bc607cc69ccb073adaef1206d99) - - # FindPkgConfig uses the new comment style, so we ship an old-style commented - # version - if(CMAKE_SUPPORTS_NEW_STYLE_COMMENTS OR YCM_MAINTAINER_MODE) - list(APPEND _files Modules/FindPkgConfig.cmake 8fbef856c63483a208eddcd0e69ea29f59e48460) - else() - file(COPY v3.1.3/FindPkgConfig.cmake - DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cmake-3.1/Modules") - endif() - - _ycm_cmake_next_download(v3.1.3 "${CMAKE_CURRENT_BINARY_DIR}/cmake-3.1" "${_files}") - _ycm_cmake_next_download_now(v3.1.3 "${CMAKE_CURRENT_BINARY_DIR}/cmake-3.1" "${_now_files}") - _ycm_cmake_next_install(v3.1.3 DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/cmake-3.1" - DESTINATION "${YCM_INSTALL_MODULE_DIR}") -endif() +# FindPackageHandleStandardArgs 3.7 ################################################################################ # Files not available or containing bugs in CMake 3.1.3 # Imported from CMake tag v3.2.3 -if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.2) +if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.1) # Just a reminder to remove this when we change cmake version - message(AUTHOR_WARNING "CMake minimum required version greater than 3.2. You can remove this.") + message(AUTHOR_WARNING "CMake minimum required version greater than 3.1. You can remove this.") endif() # None @@ -206,9 +123,9 @@ endif() ################################################################################ # Files not available or containing bugs in CMake 3.2.3 # Imported from CMake tag v3.3.2 -if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.3) +if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.2) # Just a reminder to remove this when we change cmake version - message(AUTHOR_WARNING "CMake minimum required version greater than 3.3. You can remove this.") + message(AUTHOR_WARNING "CMake minimum required version greater than 3.2. You can remove this.") endif() # None @@ -217,9 +134,9 @@ endif() ################################################################################ # Files not available or containing bugs in CMake 3.3.2 # Imported from CMake tag v3.4.3 -if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.4) +if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.3) # Just a reminder to remove this when we change cmake version - message(AUTHOR_WARNING "CMake minimum required version greater than 3.4. You can remove this.") + message(AUTHOR_WARNING "CMake minimum required version greater than 3.3. You can remove this.") endif() # We assume that the user won't downgrade his cmake, therefore it's not @@ -237,9 +154,9 @@ endif() ################################################################################ # Files not available or containing bugs in CMake 3.4.3 # Imported from CMake tag v3.5.2 -if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.5) +if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.4) # Just a reminder to remove this when we change cmake version - message(AUTHOR_WARNING "CMake minimum required version greater than 3.5. You can remove this.") + message(AUTHOR_WARNING "CMake minimum required version greater than 3.4. You can remove this.") endif() # We assume that the user won't downgrade his cmake, therefore it's not @@ -249,17 +166,9 @@ if(CMAKE_VERSION VERSION_LESS 3.5 OR YCM_MAINTAINER_MODE) set(_files Copyright.txt 4a4e319a92c005163903c4ae537669d0026bae7d Modules/FindGTK2.cmake 49af0a4282a353269ad0e938775c594d0e1319c7 Modules/SelectLibraryConfigurations.cmake 4d1ee73df6dadcb2e51f12059cf48f5e9165bb1e # Used by FindGTK2 + Modules/FindPackageHandleStandardArgs.cmake 9a543ff079dc8e313f1dae812688f4be14e25134 # Used by FindGTK2 Modules/FindPackageMessage.cmake dbc69daf94e8a4039286f4ae6a8702af418b253a) # Used by FindPackageHandleStandardArgs - # Since CMake 3.3, FindPackageHandleStandardArgs uses the new comment style, - # so we ship an old-style commented version - if(CMAKE_SUPPORTS_NEW_STYLE_COMMENTS OR YCM_MAINTAINER_MODE) - list(APPEND _files Modules/FindPackageHandleStandardArgs.cmake 9a543ff079dc8e313f1dae812688f4be14e25134) # Used by FindGTK2 - else() - file(COPY v3.5.2/FindPackageHandleStandardArgs.cmake - DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cmake-3.5/Modules") - endif() - # Since CMake 3.5, CMakeParseArguments.cmake was replaced by the # cmake_parse_arguments command and the file is empty, therefore we import # the older version for CMake 3.4 and earlier @@ -280,9 +189,9 @@ endif() ################################################################################ # Files not available or containing bugs in CMake 3.5.2 # Imported from CMake tag v3.6.2 -if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.6) +if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.5) # Just a reminder to remove this when we change cmake version - message(AUTHOR_WARNING "CMake minimum required version greater than 3.6. You can remove this.") + message(AUTHOR_WARNING "CMake minimum required version greater than 3.5. You can remove this.") endif() # None @@ -291,9 +200,9 @@ endif() ################################################################################ # Files not available or containing bugs in CMake 3.6.3 # Imported from CMake tag v3.7.0 -if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.7) +if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.6) # Just a reminder to remove this when we change cmake version - message(AUTHOR_WARNING "CMake minimum required version greater than 3.7. You can remove this.") + message(AUTHOR_WARNING "CMake minimum required version greater than 3.6. You can remove this.") endif() # We assume that the user won't downgrade his cmake, therefore it's not @@ -309,12 +218,12 @@ endif() ################################################################################ -# Files not yet available or containing bugs in current CMake release (v3.7.0) +# Files not yet available or containing bugs in current CMake release (v3.7.2) # Imported from latest revision tested set(_ref ab4a9a98266fb29008cecc9649a91fc844c541f5) -if(NOT CMAKE_VERSION VERSION_LESS 3.8) +if(NOT CMAKE_VERSION VERSION_LESS 3.7.2) # Just a reminder to update files when a new cmake version is released message(AUTHOR_WARNING "CMake version is ${CMAKE_VERSION}. You should update this.") endif() @@ -324,16 +233,11 @@ set(_files Copyright.txt 142359ab254d35db46c6d3d29 Modules/FindSWIG.cmake dea8c36114b8fcd934118a0fc86c0641cd191c18 # Required to use this version of UseSWIG Modules/FindPackageMessage.cmake 68bfe02f96faabad103d59811b324d82d7c1d178) # Used by FindPackageHandleStandardArgs -# Since CMake 3.3, FindPackageHandleStandardArgs uses the new comment style, -# so we ship an old-style commented version # Since CMake 3.7, FindPackageHandleStandardArgs uses string(APPEND) if(CMAKE_SUPPORTS_STRING_APPEND OR YCM_MAINTAINER_MODE) list(APPEND _files Modules/FindPackageHandleStandardArgs.cmake 1f71d36d60c70e83d6bd1f2ec09003ed445cec68) # Used by FindSWIG -elseif(CMAKE_SUPPORTS_STRING_APPEND) - file(COPY v3.7.0/FindPackageHandleStandardArgs.cmake - DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cmake-next/Modules") else() - file(COPY v3.5.2/FindPackageHandleStandardArgs.cmake + file(COPY v3.7.0/FindPackageHandleStandardArgs.cmake DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cmake-next/Modules") endif() diff --git a/cmake-next/v3.5.2/FindPackageHandleStandardArgs.cmake b/cmake-next/v3.5.2/FindPackageHandleStandardArgs.cmake deleted file mode 100644 index e787b57bf..000000000 --- a/cmake-next/v3.5.2/FindPackageHandleStandardArgs.cmake +++ /dev/null @@ -1,394 +0,0 @@ -# FindPackageHandleStandardArgs -# ----------------------------- -# -# This module provides a function intended to be used in :ref:`Find Modules` -# implementing :command:`find_package()` calls. It handles the -# ``REQUIRED``, ``QUIET`` and version-related arguments of ``find_package``. -# It also sets the ``_FOUND`` variable. The package is -# considered found if all variables listed contain valid results, e.g. -# valid filepaths. -# -# .. command:: find_package_handle_standard_args -# -# There are two signatures:: -# -# find_package_handle_standard_args( -# (DEFAULT_MSG|) -# ... -# ) -# -# find_package_handle_standard_args( -# [FOUND_VAR ] -# [REQUIRED_VARS ...] -# [VERSION_VAR ] -# [HANDLE_COMPONENTS] -# [CONFIG_MODE] -# [FAIL_MESSAGE ] -# ) -# -# The ``_FOUND`` variable will be set to ``TRUE`` if all -# the variables ``...`` are valid and any optional -# constraints are satisfied, and ``FALSE`` otherwise. A success or -# failure message may be displayed based on the results and on -# whether the ``REQUIRED`` and/or ``QUIET`` option was given to -# the :command:`find_package` call. -# -# The options are: -# -# ``(DEFAULT_MSG|)`` -# In the simple signature this specifies the failure message. -# Use ``DEFAULT_MSG`` to ask for a default message to be computed -# (recommended). Not valid in the full signature. -# -# ``FOUND_VAR `` -# Obsolete. Specifies either ``_FOUND`` or -# ``_FOUND`` as the result variable. This exists only -# for compatibility with older versions of CMake and is now ignored. -# Result variables of both names are always set for compatibility. -# -# ``REQUIRED_VARS ...`` -# Specify the variables which are required for this package. -# These may be named in the generated failure message asking the -# user to set the missing variable values. Therefore these should -# typically be cache entries such as ``FOO_LIBRARY`` and not output -# variables like ``FOO_LIBRARIES``. -# -# ``VERSION_VAR `` -# Specify the name of a variable that holds the version of the package -# that has been found. This version will be checked against the -# (potentially) specified required version given to the -# :command:`find_package` call, including its ``EXACT`` option. -# The default messages include information about the required -# version and the version which has been actually found, both -# if the version is ok or not. -# -# ``HANDLE_COMPONENTS`` -# Enable handling of package components. In this case, the command -# will report which components have been found and which are missing, -# and the ``_FOUND`` variable will be set to ``FALSE`` -# if any of the required components (i.e. not the ones listed after -# the ``OPTIONAL_COMPONENTS`` option of :command:`find_package`) are -# missing. -# -# ``CONFIG_MODE`` -# Specify that the calling find module is a wrapper around a -# call to ``find_package( NO_MODULE)``. This implies -# a ``VERSION_VAR`` value of ``_VERSION``. The command -# will automatically check whether the package configuration file -# was found. -# -# ``FAIL_MESSAGE `` -# Specify a custom failure message instead of using the default -# generated message. Not recommended. -# -# Example for the simple signature: -# -# .. code-block:: cmake -# -# find_package_handle_standard_args(LibXml2 DEFAULT_MSG -# LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) -# -# The ``LibXml2`` package is considered to be found if both -# ``LIBXML2_LIBRARY`` and ``LIBXML2_INCLUDE_DIR`` are valid. -# Then also ``LibXml2_FOUND`` is set to ``TRUE``. If it is not found -# and ``REQUIRED`` was used, it fails with a -# :command:`message(FATAL_ERROR)`, independent whether ``QUIET`` was -# used or not. If it is found, success will be reported, including -# the content of the first ````. On repeated CMake runs, -# the same message will not be printed again. -# -# Example for the full signature: -# -# .. code-block:: cmake -# -# find_package_handle_standard_args(LibArchive -# REQUIRED_VARS LibArchive_LIBRARY LibArchive_INCLUDE_DIR -# VERSION_VAR LibArchive_VERSION) -# -# In this case, the ``LibArchive`` package is considered to be found if -# both ``LibArchive_LIBRARY`` and ``LibArchive_INCLUDE_DIR`` are valid. -# Also the version of ``LibArchive`` will be checked by using the version -# contained in ``LibArchive_VERSION``. Since no ``FAIL_MESSAGE`` is given, -# the default messages will be printed. -# -# Another example for the full signature: -# -# .. code-block:: cmake -# -# find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4) -# find_package_handle_standard_args(Automoc4 CONFIG_MODE) -# -# In this case, a ``FindAutmoc4.cmake`` module wraps a call to -# ``find_package(Automoc4 NO_MODULE)`` and adds an additional search -# directory for ``automoc4``. Then the call to -# ``find_package_handle_standard_args`` produces a proper success/failure -# message. - -#============================================================================= -# Copyright 2007-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. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake) - -# internal helper macro -macro(_FPHSA_FAILURE_MESSAGE _msg) - if (${_NAME}_FIND_REQUIRED) - message(FATAL_ERROR "${_msg}") - else () - if (NOT ${_NAME}_FIND_QUIETLY) - message(STATUS "${_msg}") - endif () - endif () -endmacro() - - -# internal helper macro to generate the failure message when used in CONFIG_MODE: -macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) - # _CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found: - if(${_NAME}_CONFIG) - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})") - else() - # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version. - # List them all in the error message: - if(${_NAME}_CONSIDERED_CONFIGS) - set(configsText "") - list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount) - math(EXPR configsCount "${configsCount} - 1") - foreach(currentConfigIndex RANGE ${configsCount}) - list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename) - list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version) - set(configsText "${configsText} ${filename} (version ${version})\n") - endforeach() - if (${_NAME}_NOT_FOUND_MESSAGE) - set(configsText "${configsText} Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n") - endif() - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}") - - else() - # Simple case: No Config-file was found at all: - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}") - endif() - endif() -endmacro() - - -function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) - -# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in -# new extended or in the "old" mode: - set(options CONFIG_MODE HANDLE_COMPONENTS) - set(oneValueArgs FAIL_MESSAGE VERSION_VAR FOUND_VAR) - set(multiValueArgs REQUIRED_VARS) - set(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} ) - list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX) - - if(${INDEX} EQUAL -1) - set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG}) - set(FPHSA_REQUIRED_VARS ${ARGN}) - set(FPHSA_VERSION_VAR) - else() - - CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN}) - - if(FPHSA_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"") - endif() - - if(NOT FPHSA_FAIL_MESSAGE) - set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG") - endif() - endif() - -# now that we collected all arguments, process them - - if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG") - set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}") - endif() - - # In config-mode, we rely on the variable _CONFIG, which is set by find_package() - # when it successfully found the config-file, including version checking: - if(FPHSA_CONFIG_MODE) - list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG) - list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS) - set(FPHSA_VERSION_VAR ${_NAME}_VERSION) - endif() - - if(NOT FPHSA_REQUIRED_VARS) - message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()") - endif() - - list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR) - - string(TOUPPER ${_NAME} _NAME_UPPER) - string(TOLOWER ${_NAME} _NAME_LOWER) - - if(FPHSA_FOUND_VAR) - if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$" OR FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$") - set(_FOUND_VAR ${FPHSA_FOUND_VAR}) - else() - message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.") - endif() - else() - set(_FOUND_VAR ${_NAME_UPPER}_FOUND) - endif() - - # collect all variables which were not found, so they can be printed, so the - # user knows better what went wrong (#6375) - set(MISSING_VARS "") - set(DETAILS "") - # check if all passed variables are valid - set(FPHSA_FOUND_${_NAME} TRUE) - foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS}) - if(NOT ${_CURRENT_VAR}) - set(FPHSA_FOUND_${_NAME} FALSE) - set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}") - else() - set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]") - endif() - endforeach() - if(FPHSA_FOUND_${_NAME}) - set(${_NAME}_FOUND TRUE) - set(${_NAME_UPPER}_FOUND TRUE) - else() - set(${_NAME}_FOUND FALSE) - set(${_NAME_UPPER}_FOUND FALSE) - endif() - - # component handling - unset(FOUND_COMPONENTS_MSG) - unset(MISSING_COMPONENTS_MSG) - - if(FPHSA_HANDLE_COMPONENTS) - foreach(comp ${${_NAME}_FIND_COMPONENTS}) - if(${_NAME}_${comp}_FOUND) - - if(NOT DEFINED FOUND_COMPONENTS_MSG) - set(FOUND_COMPONENTS_MSG "found components: ") - endif() - set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}") - - else() - - if(NOT DEFINED MISSING_COMPONENTS_MSG) - set(MISSING_COMPONENTS_MSG "missing components: ") - endif() - set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}") - - if(${_NAME}_FIND_REQUIRED_${comp}) - set(${_NAME}_FOUND FALSE) - set(MISSING_VARS "${MISSING_VARS} ${comp}") - endif() - - endif() - endforeach() - set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}") - set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]") - endif() - - # version handling: - set(VERSION_MSG "") - set(VERSION_OK TRUE) - set(VERSION ${${FPHSA_VERSION_VAR}}) - - # check with DEFINED here as the requested or found version may be "0" - if (DEFINED ${_NAME}_FIND_VERSION) - if(DEFINED ${FPHSA_VERSION_VAR}) - - if(${_NAME}_FIND_VERSION_EXACT) # exact version required - # count the dots in the version string - string(REGEX REPLACE "[^.]" "" _VERSION_DOTS "${VERSION}") - # add one dot because there is one dot more than there are components - string(LENGTH "${_VERSION_DOTS}." _VERSION_DOTS) - if (_VERSION_DOTS GREATER ${_NAME}_FIND_VERSION_COUNT) - # Because of the C++ implementation of find_package() ${_NAME}_FIND_VERSION_COUNT - # is at most 4 here. Therefore a simple lookup table is used. - if (${_NAME}_FIND_VERSION_COUNT EQUAL 1) - set(_VERSION_REGEX "[^.]*") - elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 2) - set(_VERSION_REGEX "[^.]*\\.[^.]*") - elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 3) - set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*") - else () - set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*\\.[^.]*") - endif () - string(REGEX REPLACE "^(${_VERSION_REGEX})\\..*" "\\1" _VERSION_HEAD "${VERSION}") - unset(_VERSION_REGEX) - if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _VERSION_HEAD) - set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"") - set(VERSION_OK FALSE) - else () - set(VERSION_MSG "(found suitable exact version \"${VERSION}\")") - endif () - unset(_VERSION_HEAD) - else () - if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL VERSION) - set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"") - set(VERSION_OK FALSE) - else () - set(VERSION_MSG "(found suitable exact version \"${VERSION}\")") - endif () - endif () - unset(_VERSION_DOTS) - - else() # minimum version specified: - if (${_NAME}_FIND_VERSION VERSION_GREATER VERSION) - set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"") - set(VERSION_OK FALSE) - else () - set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")") - endif () - endif() - - else() - - # if the package was not found, but a version was given, add that to the output: - if(${_NAME}_FIND_VERSION_EXACT) - set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")") - else() - set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")") - endif() - - endif() - else () - if(VERSION) - set(VERSION_MSG "(found version \"${VERSION}\")") - endif() - endif () - - if(VERSION_OK) - set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]") - else() - set(${_NAME}_FOUND FALSE) - endif() - - - # print the result: - if (${_NAME}_FOUND) - FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}") - else () - - if(FPHSA_CONFIG_MODE) - _FPHSA_HANDLE_FAILURE_CONFIG_MODE() - else() - if(NOT VERSION_OK) - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})") - else() - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}") - endif() - endif() - - endif () - - set(${_NAME}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE) - set(${_NAME_UPPER}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE) -endfunction() diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 3054dc85d..9dbeb48e9 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -12,8 +12,8 @@ # if(NOT YCM_SOURCE_DIR) # set(CMakeHelp_STANDALONE 1) # cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR) -# get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) -# get_filename_component(YCM_SOURCE_DIR "${tmp}" PATH) +# get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" DIRECTORY) +# get_filename_component(YCM_SOURCE_DIR "${tmp}" DIRECTORY) # include(${YCM_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) # include(${YCM_SOURCE_DIR}/Source/CMakeVersionCompute.cmake) # include(${YCM_SOURCE_DIR}/Source/CMakeInstallDestinations.cmake) diff --git a/find-modules/CMakeLists.txt b/find-modules/CMakeLists.txt index 144c571a7..ec9afc8ea 100644 --- a/find-modules/CMakeLists.txt +++ b/find-modules/CMakeLists.txt @@ -42,6 +42,7 @@ set(YCM_FIND_MODULES FindACE.cmake FindOpenCV.cmake FindOpenGL.cmake FindOpenNI.cmake + FindOpenNI2.cmake FindPLXCANAPI.cmake FindPortAudio.cmake FindqpOASES.cmake @@ -50,7 +51,8 @@ set(YCM_FIND_MODULES FindACE.cmake FindSQLite.cmake FindStage.cmake FindTinyXML.cmake - FindYamlCpp.cmake) + FindYamlCpp.cmake + FindZFP.cmake) _ycm_install(find-modules FILES ${YCM_FIND_MODULES} DESTINATION "${YCM_INSTALL_MODULE_DIR}/find-modules") diff --git a/find-modules/FindACE.cmake b/find-modules/FindACE.cmake index 9b930cb99..54f8a34ca 100644 --- a/find-modules/FindACE.cmake +++ b/find-modules/FindACE.cmake @@ -169,7 +169,7 @@ if(ACE_FOUND) if(DEFINED CMAKE_REQUIRED_INCLUDES) set(_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES}) else() - unset(_CMAKE_TRY_COMPILE_CONFIGURATION) + unset(_CMAKE_REQUIRED_INCLUDES) endif() set(CMAKE_REQUIRED_INCLUDES ${ACE_INCLUDE_DIRS}) diff --git a/find-modules/FindGLFW3.cmake b/find-modules/FindGLFW3.cmake index 1f747233d..3a4b4b18e 100644 --- a/find-modules/FindGLFW3.cmake +++ b/find-modules/FindGLFW3.cmake @@ -56,6 +56,7 @@ if(NOT GLFW3_FOUND) find_library(GLFW3_GLFW_LIBRARY DOC "Absolute path to GLFW3 library." NAMES glfw3 + glfw3dll PATH_SUFFIXES lib lib-vc2010 PATHS /usr/ diff --git a/find-modules/FindIPOPT.cmake b/find-modules/FindIPOPT.cmake index 70fa69c67..975adc4cb 100644 --- a/find-modules/FindIPOPT.cmake +++ b/find-modules/FindIPOPT.cmake @@ -8,8 +8,8 @@ # if this fails then try to locate the library in the directory pointed by # the IPOPT_DIR enviromental variable. # -# On Windows systems, just try to find the library using the IPOPT_DIR -# enviromental variable. +# On Windows systems, just try to find the library using the IPOPT_DIR +# enviromental variable. # # Create the following variables:: # @@ -60,7 +60,10 @@ if(NOT WIN32) find_library(${_LIBRARY}_PATH NAMES ${_LIBRARY} PATHS ${_PC_IPOPT_LIBRARY_DIRS}) - list(APPEND IPOPT_LIBRARIES ${${_LIBRARY}_PATH}) + # Workaround for https://github.com/robotology/icub-main/issues/418 + if(${_LIBRARY}_PATH) + list(APPEND IPOPT_LIBRARIES ${${_LIBRARY}_PATH}) + endif() endforeach() else() set(IPOPT_DEFINITIONS "") @@ -142,12 +145,7 @@ else() # libraries embedded in the library, newer releases require them to # be explicitly linked. if(IPOPT_IPOPT_LIBRARY) - # FIXME Remove this check when CMake 2.8.11 or later is required - if(NOT CMAKE_VERSION VERSION_LESS 2.8.11) - get_filename_component(_MSVC_BINDIR "${CMAKE_LINKER}" PATH) - else() - get_filename_component(_MSVC_DIR "${CMAKE_LINKER}" DIRECTORY) - endif() + get_filename_component(_MSVC_DIR "${CMAKE_LINKER}" DIRECTORY) # Find the lib.exe executable find_program(LIB_EXECUTABLE @@ -200,12 +198,7 @@ else() unset(_path) if(NOT "${_lib_output}" MATCHES "libifcoremd.dll") - # FIXME Remove this check when CMake 2.8.11 or later is required - if(NOT CMAKE_VERSION VERSION_LESS 2.8.11) - get_filename_component(_IPOPT_IPOPT_LIBRARY_DIR "${_IPOPT_LIB}" PATH) - else() - get_filename_component(_IPOPT_IPOPT_LIBRARY_DIR "${_IPOPT_LIB}" DIRECTORY) - endif() + get_filename_component(_IPOPT_IPOPT_LIBRARY_DIR "${_IPOPT_LIB}" DIRECTORY) foreach(_lib ifconsol libifcoremd diff --git a/find-modules/FindLibOVR.cmake b/find-modules/FindLibOVR.cmake index d201943ce..36fd4b05a 100644 --- a/find-modules/FindLibOVR.cmake +++ b/find-modules/FindLibOVR.cmake @@ -63,6 +63,8 @@ if(WIN32) set(_arch "VS2012") elseif(MSVC12) set(_arch "VS2013") + elseif(MSVC14) + set(_arch "VS2013") endif() endif() elseif(APPLE) @@ -159,9 +161,9 @@ if(EXISTS "${LibOVR_LibOVR_INCLUDE_DIR}/OVR_Version.h") string(REGEX REPLACE ".*#[\t ]*define[ \t]+OVR_BUILD_NUMBER[ \t]+([0-9]+).*" "\\1" LibOVR_VERSION_BUILD "${_contents}") - set(LibOVR_VERSION "${LibOVR_VERSION_PRODUCT}.${LibOVR_VERSION_MAJOR}.${LibOVR_VERSION_MINOR}.${LibOVR_VERSION_PATCH}") + set(LibOVR_VERSION "${LibOVR_VERSION_MAJOR}.${LibOVR_VERSION_MINOR}.${LibOVR_VERSION_PATCH}") set(LibOVR_VERSION_STRING "${LibOVR_VERSION}") - set(LibOVR_VERSION_DETAILED_STRING "${LibOVR_VERSION}.${LibOVR_VERSION_BUILD}") + set(LibOVR_VERSION_DETAILED_STRING "${LibOVR_VERSION_PRODUCT}.${LibOVR_VERSION}.${LibOVR_VERSION_BUILD}") endif() @@ -187,6 +189,19 @@ if(COMMAND set_package_properties) URL "https://developer.oculus.com/") endif() +if(FindLibOVR_DEBUG) + include(CMakePrintHelpers) + cmake_print_variables(LibOVR_FOUND + LibOVR_VERSION + LibOVR_VERSION_PRODUCT + LibOVR_VERSION_MAJOR + LibOVR_VERSION_MINOR + LibOVR_VERSION_PATCH + LibOVR_VERSION_BUILD + LibOVR_VERSION_STRING + LibOVR_VERSION_DETAILED_STRING) +endif() + if(NOT LibOVR_FOUND) return() endif() @@ -240,19 +255,14 @@ if(EXISTS "${LibOVR_LibOVR_LIBRARY_RELEASE}") endif() if(FindLibOVR_DEBUG) - include(CMakePrintHelpers) - cmake_print_variables(LibOVR_FOUND - LibOVR_VERSION - LibOVR_VERSION_PRODUCT - LibOVR_VERSION_MAJOR - LibOVR_VERSION_MINOR - LibOVR_VERSION_PATCH - LibOVR_VERSION_BUILD - LibOVR_VERSION_STRING - LibOVR_VERSION_DETAILED_STRING) - cmake_print_properties(TARGETS LibOVR::OVRKernel - LibOVR::OVR - PROPERTIES IMPORTED_CONFIGURATIONS - IMPORTED_LOCATION_RELEASE - IMPORTED_LOCATION_DEBUG) + foreach(_t OVR OVRKernel) + if(TARGET LibOVR::${_t}) + cmake_print_properties(TARGETS LibOVR::${_t} + PROPERTIES IMPORTED_CONFIGURATIONS + IMPORTED_LOCATION_RELEASE + IMPORTED_LOCATION_DEBUG) + else() + message(STATUS "LibOVR::${_t} not found") + endif() + endforeach() endif() diff --git a/find-modules/FindOpenCV.cmake b/find-modules/FindOpenCV.cmake index 67b3d6e76..129b5c48f 100644 --- a/find-modules/FindOpenCV.cmake +++ b/find-modules/FindOpenCV.cmake @@ -484,7 +484,7 @@ if(NOT OpenCV_FOUND) # get the link directory for rpath to be used with LINK_DIRECTORIES: if(OPENCV_LIBRARY) - get_filename_component(OPENCV_LINK_DIRECTORIES ${OPENCV_LIBRARY} PATH) + get_filename_component(OPENCV_LINK_DIRECTORIES ${OPENCV_LIBRARY} DIRECTORY) endif(OPENCV_LIBRARY) # display help message diff --git a/find-modules/FindOpenNI2.cmake b/find-modules/FindOpenNI2.cmake new file mode 100644 index 000000000..2677b5062 --- /dev/null +++ b/find-modules/FindOpenNI2.cmake @@ -0,0 +1,59 @@ +#.rst: +# FindOpenNI2 +# ---------- +# +# Try to find the OpenNI2 library. +# Once done this will define the following variables:: +# +# OpenNI2_FOUND - System has OpenNI2 +# OpenNI2_INCLUDE_DIRS - OpenNI2 include directory +# OpenNI2_LIBRARIES - OpenNI2 libraries +# OpenNI2_DEFINITIONS - Additional compiler flags for OpenNI2 +# OpenNI2_VERSION - OpenNI2 version +# OpenNI2_MAJOR_VERSION - OpenNI2 major version +# OpenNI2_MINOR_VERSION - OpenNI2 minor version +# OpenNI2_PATCH_VERSION - OpenNI2 patch version + +#============================================================================= +# Copyright 2012-2016 iCub Facility, Istituto Italiano di Tecnologia +# Authors: Giulia Vezzani +# +# 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 YCM, substitute the full +# License text for the above reference.) + + +include(StandardFindModule) +standard_find_module(OpenNI2 libopenni2 SKIP_CMAKE_CONFIG) + +if(NOT OpenNI2_FOUND) + find_path(OpenNI2_INCLUDE_DIR + NAMES OpenNI.h + HINTS $ENV{OpenNI2_DIR}/include + $ENV{OpenNI2_DIR}/Include) + find_library(OpenNI2_LIBRARY + NAMES OpenNI2 + libOpenNI2 + HINTS $ENV{OpenNI2_DIR}/lib + $ENV{OpenNI2_DIR}/Redist + $ENV{OpenNI2_DIR}/redist) + + set(OpenNI2_LIBRARIES ${OpenNI2_LIBRARY}) + set(OpenNI2_INCLUDE_DIRS ${OpenNI2_INCLUDE_DIR}) + + find_package_handle_standard_args(OpenNI2 DEFAULT_MSG OpenNI2_LIBRARIES OpenNI2_INCLUDE_DIRS) + + set(OpenNI2_FOUND ${OPENNI2_FOUND}) +endif() + +# Set package properties if FeatureSummary was included +if(COMMAND set_package_properties) + set_package_properties(OpenNI2 PROPERTIES DESCRIPTION "Open Natural Interaction framework" + URL "https://github.com/OpenNI/OpenNI2") +endif() diff --git a/find-modules/FindPortAudio.cmake b/find-modules/FindPortAudio.cmake index 044233107..9adc74fa4 100644 --- a/find-modules/FindPortAudio.cmake +++ b/find-modules/FindPortAudio.cmake @@ -31,7 +31,7 @@ standard_find_module(PortAudio portaudio-2.0) if(NOT PortAudio_FOUND) if(WIN32) find_library(PortAudio_LIBRARY NAMES portaudio_x86 PATHS C:/portaudio/build/msvc/Debug_x86) - get_filename_component(PORTAUDIO_LINK_DIRECTORIES ${PortAudio_LIBRARY} PATH) + get_filename_component(PORTAUDIO_LINK_DIRECTORIES ${PortAudio_LIBRARY} DIRECTORY) find_path(PortAudio_INCLUDE_DIR portaudio.h C:/portaudio/include) set(PortAudio_LIBRARIES ${PortAudio_LIBRARY}) diff --git a/find-modules/FindZFP.cmake b/find-modules/FindZFP.cmake new file mode 100644 index 000000000..969cbdfa6 --- /dev/null +++ b/find-modules/FindZFP.cmake @@ -0,0 +1,77 @@ +#.rst: +# FindZFP +# ------- +# +# Find the ZFP floating point compression library. +# +# Once done this will define the following variables:: +# +# ZFP_INCLUDE_DIRS - ZFP include directory +# ZFP_LIBRARIES - ZFP libraries +# ZFP_FOUND - if false, you cannot build anything that requires ZFP +# ZFP_VERSION - ZFP version +# ZFP_MAJOR_VERSION - ZFP major version +# ZFP_MINOR_VERSION - ZFP minor version +# ZFP_PATCH_VERSION - ZFP release version + +#============================================================================= +# Copyright 2016 iCub Facility, Istituto Italiano di Tecnologia +# Authors: Nicolo' Genesio +# +# 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 YCM, substitute the full +# License text for the above reference.) + +include(FindPackageHandleStandardArgs) +include(SelectLibraryConfigurations) + +find_path(ZFP_INCLUDE_DIR + NAMES zfp.h + PATHS $ENV{ZFP_ROOT}/inc + $ENV{ZFP_ROOT}/include + DOC "ZFP include directory") +find_library(ZFP_LIBRARY_RELEASE + NAMES ZFP zfp + PATHS $ENV{ZFP_ROOT}/lib + DOC "ZFP library file (release version)") +find_library(ZFP_LIBRARY_DEBUG + NAMES ZFPd zfpd + PATHS $ENV{ZFP_ROOT}/lib + DOC "ZFP library file (debug version)") + +mark_as_advanced(ZFP_INCLUDE_DIR + ZFP_LIBRARY_RELEASE + ZFP_LIBRARY_DEBUG) + +select_library_configurations(ZFP) + +if(EXISTS "${ZFP_INCLUDE_DIR}/zfp.h") + file(STRINGS "${ZFP_INCLUDE_DIR}/zfp.h" _contents REGEX "#define ZFP_VERSION_+") + if(_contents) + string(REGEX REPLACE ".*#define ZFP_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" ZFP_MAJOR_VERSION "${_contents}") + string(REGEX REPLACE ".*#define ZFP_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" ZFP_MINOR_VERSION "${_contents}") + string(REGEX REPLACE ".*#define ZFP_VERSION_RELEASE[ \t]+([0-9]+).*" "\\1" ZFP_PATCH_VERSION "${_contents}") + set(ZFP_VERSION "${ZFP_MAJOR_VERSION}.${ZFP_MINOR_VERSION}.${ZFP_PATCH_VERSION}") + endif() +endif() + +set(ZFP_LIBRARIES ${ZFP_LIBRARY}) +set(ZFP_INCLUDE_DIRS ${ZFP_INCLUDE_DIR}) + +find_package_handle_standard_args(ZFP + FOUND_VAR ZFP_FOUND + REQUIRED_VARS ZFP_LIBRARIES ZFP_INCLUDE_DIRS + VERSION_VAR ZFP_VERSION) + +# Set package properties if FeatureSummary was included +if(COMMAND set_package_properties) + set_package_properties(ZFP PROPERTIES DESCRIPTION "An open source C/C++ library for compressed floating-point arrays" + URL "http://computation.llnl.gov/projects/floating-point-compression") +endif() + diff --git a/help/manual/ycm-build-system-support.7.rst b/help/manual/ycm-build-system-support.7.rst index 331c1929f..09d2a3ed6 100644 --- a/help/manual/ycm-build-system-support.7.rst +++ b/help/manual/ycm-build-system-support.7.rst @@ -48,7 +48,7 @@ This is the code you need to add to your CMakeLists.txt: .. code-block:: cmake - cmake_minimum_required(VERSION 2.8.11) + cmake_minimum_required(VERSION 3.0) project(TemplatePkg CXX) # declare a variable with the name of the project diff --git a/help/manual/ycm-faq.7.rst b/help/manual/ycm-faq.7.rst index 0d3ad5735..b078f8e1d 100644 --- a/help/manual/ycm-faq.7.rst +++ b/help/manual/ycm-faq.7.rst @@ -43,17 +43,14 @@ YCM FAQ * :**Q**: Can you actually use any module from a newer version of CMake? :**A**: No, modules using features that have been added in CMake - source code cannot be imported directly. For example - :cmake:manual:`expressions generators ` - and :cmake:ref:`bracket comments ` cannot be - used with CMake 2.8.9. + source code cannot be imported directly. Nonetheless it is possible to supply a patched version of the module that does not use these features. .. _`FAQ:cmake-version`: -* :**Q**: Why support CMake 2.8.9? +* :**Q**: Why support CMake 3.0? :**A**: YCM was historically written to support `YARP`_, therefore the supported CMake versions are the same supported by `YARP`_. See `YARP Supported Distributions`_ for details. diff --git a/help/manual/ycm-superbuild-example.7.rst b/help/manual/ycm-superbuild-example.7.rst index b69f14e2e..a3544af4c 100644 --- a/help/manual/ycm-superbuild-example.7.rst +++ b/help/manual/ycm-superbuild-example.7.rst @@ -96,7 +96,7 @@ Create a ``CMakeLists.txt`` with this content: .. code-block:: cmake - cmake_minimum_required(VERSION 2.8.9) + cmake_minimum_required(VERSION 3.0) project(example) diff --git a/help/manual/ycm-using.7.rst b/help/manual/ycm-using.7.rst index 9bf6adfcc..57c1012c0 100644 --- a/help/manual/ycm-using.7.rst +++ b/help/manual/ycm-using.7.rst @@ -11,7 +11,7 @@ How to Use YCM in Your Project ============================== In order to use YCM in your project, your software will have to depend -on CMake 2.8.9 or later. Therefore your ``CMakeLists.txt`` file should +on CMake 3.0 or later. Therefore your ``CMakeLists.txt`` file should include a :cmake:command:`cmake_minimum_required` call to set the :cmake:variable:`CMAKE_MINIMUM_REQUIRED_VERSION` and the relative CMake policies. @@ -19,14 +19,12 @@ CMake policies. .. code-block:: cmake - cmake_minimum_required(VERSION 2.8.9) + cmake_minimum_required(VERSION 3.0) Now you have to set variables that control which components are enabled: .. code-block:: cmake - set(YCM_USE_CMAKE_2_8_12 TRUE) # Enables modules from CMake 2.8.12 - set(YCM_USE_CMAKE_3_0 TRUE) # Enables modules from CMake 3.0 set(YCM_USE_CMAKE_3_1 TRUE) # Enables modules from CMake 3.1 set(YCM_USE_CMAKE_3_2 TRUE) # Enables modules from CMake 3.2 set(YCM_USE_CMAKE_NEXT TRUE) # Enables modules from CMake git repository @@ -103,7 +101,7 @@ These files must be in a folder included in :cmake:variable:`CMAKE_MODULE_PATH` for your project: .. code-block:: cmake - + list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") Now you can include ``YCMBootstrap.cmake``: @@ -120,4 +118,4 @@ This is the suggested method when you build a superbuild. Downloading all your project would require a network connection anyway, therefore you will need to install. -In both cases, you can use YCM modules right after this declaration. \ No newline at end of file +In both cases, you can use YCM modules right after this declaration. diff --git a/help/release/0.4.0.rst b/help/release/0.4.0.rst new file mode 100644 index 000000000..8863d9756 --- /dev/null +++ b/help/release/0.4.0.rst @@ -0,0 +1,30 @@ +YCM 0.4.0 (UNRELEASED) Release Notes +************************************ + +.. only:: html + + .. contents:: + +Changes made since YCM 0.2 include the following. + + +Build System +============ + +* CMake 3.0 or newer is now required. + +Modules +======= + +Find Package Modules +-------------------- + +* New module :module:`FindOpenNI2` +* New module :module:`FindZFP` +* :module:`FindACE`: preserve the state of ``CMAKE_TRY_COMPILE_CONFIGURATION`` +* :module:`FindGLFW3`: improve detection on win32 +* :module:`FindLibOVR`: Update FindLibOVR for MSVC 2015 +* :module:`FindLibOVR`: Fix FindLibOVR debug output +* :module:`FindLibOVR`: Fix library version +* :module:`FindIPOPT`: Add workaround for + https://github.com/robotology/icub-main/issues/418 diff --git a/help/release/index.rst b/help/release/index.rst index 6fda9d6b5..e933ddca7 100644 --- a/help/release/index.rst +++ b/help/release/index.rst @@ -5,6 +5,13 @@ YCM Release Notes .. contents:: +YCM 0.4 Series +-------------- + +.. toctree:: + :maxdepth: 1 + + YCM 0.4.0 (UNRELEASED) <0.4.0> YCM 0.2 Series -------------- diff --git a/help/variable/YCM_USE_CMAKE_VERSION.rst b/help/variable/YCM_USE_CMAKE_VERSION.rst index 536d5a4e3..4c65e5baa 100644 --- a/help/variable/YCM_USE_CMAKE_VERSION.rst +++ b/help/variable/YCM_USE_CMAKE_VERSION.rst @@ -8,8 +8,8 @@ a specific CMake version. If this variable is enabled, YCM will allow you to use the new version of these modules with older versions. -For example by enabling ``YCM_USE_CMAKE_3_0``, some modules from -CMake 3.0 will be available for older CMake releases. +For example by enabling ``YCM_USE_CMAKE_3_7``, some modules from +CMake 3.7 will be available for older CMake releases. This option is available only if :cmake:variable:`CMAKE_VERSION` is less than ````. diff --git a/internal-modules/YCMInternal.cmake b/internal-modules/YCMInternal.cmake index 4389a50ec..8821ead03 100644 --- a/internal-modules/YCMInternal.cmake +++ b/internal-modules/YCMInternal.cmake @@ -117,16 +117,7 @@ function(_YCM_DOWNLOAD _target _desc _url _ref _dir _files) execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_offline_dest}" "${_orig_dest}") endif() - if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) - # Just a reminder to remove this when we change cmake minimum required version - message(AUTHOR_WARNING "CMake minimum required version greater than 2.8.12. You can remove this.") - endif() - if(CMAKE_VERSION VERSION_LESS 2.8.12) - string(REGEX REPLACE "[/\\.]" "_" _clean_filename "${_file}") - string(REGEX REPLACE "^([0-9])" "_\\1" _clean_filename "${_clean_filename}") - else() - string(MAKE_C_IDENTIFIER "${_file}" _clean_filename) - endif() + string(MAKE_C_IDENTIFIER "${_file}" _clean_filename) set(_download_script "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_target}.dir/ycm_download_${_clean_filename}.cmake") set(_download_script_real "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_target}.dir/ycm_download_${_clean_filename}_real.cmake") @@ -295,16 +286,7 @@ function(_YCM_INSTALL _target) message(FATAL_ERROR "Not yet supported") endif() - if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) - # Just a reminder to remove this when we change cmake minimum required version - message(AUTHOR_WARNING "CMake minimum required version greater than 2.8.12. You can remove this.") - endif() - if(CMAKE_VERSION VERSION_LESS 2.8.12) - string(REGEX REPLACE "[/\\.]" "_" _clean_filename "${_clean_filename}") - string(REGEX REPLACE "^([0-9])" "_\\1" _clean_filename "${_clean_filename}") - else() - string(MAKE_C_IDENTIFIER "${_clean_filename}" _clean_filename) - endif() + string(MAKE_C_IDENTIFIER "${_clean_filename}" _clean_filename) # Fix DESTINATION for the build directory string(REGEX REPLACE ";DESTINATION;${_INSTALL_DESTINATION}(;|$)" ";DESTINATION;${CMAKE_BINARY_DIR}/${_INSTALL_DESTINATION_RELATIVE}\\1" copyARGN "${copyARGN}") @@ -326,8 +308,7 @@ function(_YCM_INSTALL _target) # Just a reminder to remove this when we change cmake minimum required version message(AUTHOR_WARNING "CMake minimum required version greater than 3.1. You can remove this.") endif() - # FIXME change this to CMake 3.1 as soon as it is released - if(NOT CMAKE_VERSION VERSION_LESS 3.0.20140628) + if(NOT CMAKE_VERSION VERSION_LESS 3.1) list(APPEND copyARGN MESSAGE_NEVER) endif() diff --git a/internal-modules/YCMVersion.cmake b/internal-modules/YCMVersion.cmake index 27f9b8a40..c75d08704 100644 --- a/internal-modules/YCMVersion.cmake +++ b/internal-modules/YCMVersion.cmake @@ -37,8 +37,8 @@ include(GitInfo) set(YCM_VERSION_MAJOR 0) -set(YCM_VERSION_MINOR 2) -set(YCM_VERSION_PATCH 3) +set(YCM_VERSION_MINOR 3) +set(YCM_VERSION_PATCH 1) set(YCM_VERSION_API "${YCM_VERSION_MAJOR}.${YCM_VERSION_MINOR}") diff --git a/modules/AddInstallRPATHSupport.cmake b/modules/AddInstallRPATHSupport.cmake index fda554682..5135587e4 100644 --- a/modules/AddInstallRPATHSupport.cmake +++ b/modules/AddInstallRPATHSupport.cmake @@ -111,12 +111,8 @@ function(ADD_INSTALL_RPATH_SUPPORT) endif() if(_rpath_available) - #Check CMake version in OS X. Required >= 2.8.12 - if(CMAKE_VERSION VERSION_LESS 2.8.12 AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - message(WARNING "Your CMake version is too old. RPATH support on OS X requires CMake version at least 2.8.12") - endif() - # Enable RPATH on OSX. This also suppress warnings on CMake >= 3.0 + # Enable RPATH on OSX. set(CMAKE_MACOSX_RPATH TRUE PARENT_SCOPE) # If install RPATH is disabled in CMake, it is useless to evaluate and set diff --git a/tests/EnforceConfig.cmake.in b/tests/EnforceConfig.cmake.in index a65dc1d26..2a25b99e5 100644 --- a/tests/EnforceConfig.cmake.in +++ b/tests/EnforceConfig.cmake.in @@ -22,7 +22,7 @@ endif() # Choose a configuration that was built if none is given. if(NOT CTEST_CONFIGURATION_TYPE) set(CTEST_CMD "@CMAKE_CTEST_COMMAND@@CMAKE_EXECUTABLE_SUFFIX@") - get_filename_component(CTEST_DIR "${CTEST_CMD}" PATH) + get_filename_component(CTEST_DIR "${CTEST_CMD}" DIRECTORY) get_filename_component(CTEST_EXE "${CTEST_CMD}" NAME) foreach(cfg Release Debug MinSizeRel RelWithDebInfo) if(NOT CTEST_CONFIGURATION_TYPE) diff --git a/tests/RunCMake/AddInstallRPATHSupport/CMakeLists.txt b/tests/RunCMake/AddInstallRPATHSupport/CMakeLists.txt index 44a070cd3..0cfecfef4 100644 --- a/tests/RunCMake/AddInstallRPATHSupport/CMakeLists.txt +++ b/tests/RunCMake/AddInstallRPATHSupport/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 3.0) project(${RunCMake_TEST} NONE) set(CMAKE_MODULE_PATH "${YCM_SOURCE_DIR}/modules") include(${RunCMake_TEST}.cmake) diff --git a/tests/RunCMake/IncludeUrl/CMakeLists.txt b/tests/RunCMake/IncludeUrl/CMakeLists.txt index 44a070cd3..0cfecfef4 100644 --- a/tests/RunCMake/IncludeUrl/CMakeLists.txt +++ b/tests/RunCMake/IncludeUrl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 3.0) project(${RunCMake_TEST} NONE) set(CMAKE_MODULE_PATH "${YCM_SOURCE_DIR}/modules") include(${RunCMake_TEST}.cmake) diff --git a/tests/YCMBootstrap/CMakeLists.txt b/tests/YCMBootstrap/CMakeLists.txt index 218b87d03..fa73b0020 100644 --- a/tests/YCMBootstrap/CMakeLists.txt +++ b/tests/YCMBootstrap/CMakeLists.txt @@ -12,7 +12,7 @@ # (To distribute this file outside of YCM, substitute the full # License text for the above reference.) -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 3.0) project(YCMbootstrap NONE) include(FeatureSummary)