diff options
author | Brad King <brad.king@kitware.com> | 2019-05-08 16:41:53 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-08 16:42:29 (GMT) |
commit | ca0ac8f2896fc0de0341dfdbcb1baa67aedea7c1 (patch) | |
tree | 73d10f55ce306839a69449c5618069e2b6c4b68d /Tests | |
parent | 0af57a18520c0df50ba6609aa9cbd4af876b23f8 (diff) | |
parent | 634f6ea159d917a048a1591ee34a06677b538a22 (diff) | |
download | CMake-ca0ac8f2896fc0de0341dfdbcb1baa67aedea7c1.zip CMake-ca0ac8f2896fc0de0341dfdbcb1baa67aedea7c1.tar.gz CMake-ca0ac8f2896fc0de0341dfdbcb1baa67aedea7c1.tar.bz2 |
Merge topic 'FindBoost-fphsa'
634f6ea159 FindBoost: Add new unit tests
a22dd5d8be FindBoost: Modernize module mode with FPHSA
a315977595 FindBoost: Fix and modernize config mode with FPHSA
24342d5ef7 FindBoost: Add vars Boost_VERSION_MACRO/MAJOR/MINOR/PATCH/COUNT
26634752d0 FindBoost: Introduce new imported target Boost::headers
d6c12f374d FindBoost: Compare versions consistently against Boost_VERSION_STRING
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3243
Diffstat (limited to 'Tests')
47 files changed, 979 insertions, 4 deletions
diff --git a/Tests/FindBoost/CMakeLists.txt b/Tests/FindBoost/CMakeLists.txt index 58d795b..8489d85 100644 --- a/Tests/FindBoost/CMakeLists.txt +++ b/Tests/FindBoost/CMakeLists.txt @@ -21,7 +21,8 @@ add_test(NAME FindBoost.TestFail COMMAND ) set_tests_properties(FindBoost.TestFail PROPERTIES - PASS_REGULAR_EXPRESSION "Could not find the following Boost libraries:[ \t\n]+boost_foobar") + WILL_FAIL ON + PASS_REGULAR_EXPRESSION "Could NOT find Boost (missing: foobar)") add_test(NAME FindBoost.TestHeaders COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> diff --git a/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt b/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt index 664e4a5..0a67488 100644 --- a/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt +++ b/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt @@ -1,3 +1,2 @@ --- Boost 1\.12345 found\. --- Found Boost components: - date_time +-- Found Boost: [^ +]* \(found suitable version "1\.12345", minimum required is "1\.12345"\) found components: date_time diff --git a/Tests/RunCMake/FindBoost/CMakePackage/BoostConfig.cmake b/Tests/RunCMake/FindBoost/CMakePackage/BoostConfig.cmake index e69de29..d13bbf3 100644 --- a/Tests/RunCMake/FindBoost/CMakePackage/BoostConfig.cmake +++ b/Tests/RunCMake/FindBoost/CMakePackage/BoostConfig.cmake @@ -0,0 +1 @@ +set(Boost_DATE_TIME_FOUND 1) diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/Boost-1.70.0/BoostConfig.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/Boost-1.70.0/BoostConfig.cmake new file mode 100644 index 0000000..539267d --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/Boost-1.70.0/BoostConfig.cmake @@ -0,0 +1,140 @@ +# Copyright 2019 Peter Dimov +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) + +# This CMake configuration file, installed as part of the Boost build +# and installation procedure done by `b2 install`, provides support +# for find_package(Boost). +# +# It's roughly, but not perfectly, compatible with the behavior +# of find_package(Boost) as provided by FindBoost.cmake. +# +# A typical use might be +# +# find_package(Boost 1.70 REQUIRED COMPONENTS filesystem regex PATHS C:/Boost) +# +# On success, the above invocation would define the targets Boost::headers, +# Boost::filesystem and Boost::regex. Boost::headers represents all +# header-only libraries. An alias, Boost::boost, for Boost::headers is +# provided for compatibility. +# +# Since Boost libraries can coexist in many variants - 32/64 bit, +# static/dynamic runtime, debug/release, the following variables can be used +# to control which variant is chosen: +# +# Boost_USE_DEBUG_LIBS: When OFF, disables debug libraries. +# Boost_USE_RELEASE_LIBS: When OFF, disables release libraries. +# Boost_USE_STATIC_LIBS: When ON, uses static Boost libraries; when OFF, +# uses shared Boost libraries; when not set, the +# default is to use shared when BUILD_SHARED_LIBS is +# ON, static otherwise. +# Boost_USE_STATIC_RUNTIME: When ON, uses Boost libraries linked against the +# static runtime. The default is shared runtime. +# Boost_USE_DEBUG_RUNTIME: When ON, uses Boost libraries linked against the +# debug runtime. When OFF, against the release +# runtime. The default is to use either. +# Boost_COMPILER: The compiler that has been used to build Boost, +# such as vc141, gcc7, clang37. The default is +# determined from CMAKE_CXX_COMPILER_ID. + +message(STATUS "Found Boost ${Boost_VERSION} at ${Boost_DIR}") + +# Output requested configuration (f.ex. "REQUIRED COMPONENTS filesystem") + +if(Boost_FIND_QUIETLY) + set(_BOOST_CONFIG "${_BOOST_CONFIG} QUIET") +endif() + +if(Boost_FIND_REQUIRED) + set(_BOOST_CONFIG "${_BOOST_CONFIG} REQUIRED") +endif() + +foreach(__boost_comp IN LISTS Boost_FIND_COMPONENTS) + if(${Boost_FIND_REQUIRED_${__boost_comp}}) + list(APPEND _BOOST_COMPONENTS ${__boost_comp}) + else() + list(APPEND _BOOST_OPTIONAL_COMPONENTS ${__boost_comp}) + endif() +endforeach() + +if(_BOOST_COMPONENTS) + set(_BOOST_CONFIG "${_BOOST_CONFIG} COMPONENTS ${_BOOST_COMPONENTS}") +endif() + +if(_BOOST_OPTIONAL_COMPONENTS) + set(_BOOST_CONFIG "${_BOOST_CONFIG} OPTIONAL_COMPONENTS ${_BOOST_OPTIONAL_COMPONENTS}") +endif() + +if(_BOOST_CONFIG) + message(STATUS " Requested configuration:${_BOOST_CONFIG}") +endif() + +unset(_BOOST_CONFIG) +unset(_BOOST_COMPONENTS) +unset(_BOOST_OPTIONAL_COMPONENTS) + +# find_dependency doesn't forward arguments until 3.9, so we have to roll our own + +macro(boost_find_dependency dep req) + + set(_BOOST_QUIET) + if(Boost_FIND_QUIETLY) + set(_BOOST_QUIET QUIET) + endif() + + set(_BOOST_REQUIRED) + if(${req} AND Boost_FIND_REQUIRED) + set(_BOOST_REQUIRED REQUIRED) + endif() + + get_filename_component(_BOOST_CMAKEDIR "${CMAKE_CURRENT_LIST_DIR}/../" ABSOLUTE) + + if(Boost_DEBUG) + message(STATUS "BoostConfig: find_package(boost_${dep} ${Boost_VERSION} EXACT CONFIG ${_BOOST_REQUIRED} ${_BOOST_QUIET} HINTS ${_BOOST_CMAKEDIR})") + endif() + find_package(boost_${dep} ${Boost_VERSION} EXACT CONFIG ${_BOOST_REQUIRED} ${_BOOST_QUIET} HINTS ${_BOOST_CMAKEDIR}) + + string(TOUPPER ${dep} _BOOST_DEP) + set(Boost_${_BOOST_DEP}_FOUND ${boost_${dep}_FOUND}) + + unset(_BOOST_REQUIRED) + unset(_BOOST_QUIET) + unset(_BOOST_CMAKEDIR) + unset(_BOOST_DEP) + +endmacro() + +# Find boost_headers + +boost_find_dependency(headers 1) + +if(NOT boost_headers_FOUND) + + set(Boost_FOUND 0) + set(Boost_NOT_FOUND_MESSAGE "A required dependency, boost_headers, has not been found.") + + return() + +endif() + +# Find components + +foreach(__boost_comp IN LISTS Boost_FIND_COMPONENTS) + + boost_find_dependency(${__boost_comp} ${Boost_FIND_REQUIRED_${__boost_comp}}) + +endforeach() + +# Compatibility targets + +if(NOT TARGET Boost::boost) + + add_library(Boost::boost INTERFACE IMPORTED) + set_property(TARGET Boost::boost APPEND PROPERTY INTERFACE_LINK_LIBRARIES Boost::headers) + + # All Boost:: targets already disable autolink + add_library(Boost::diagnostic_definitions INTERFACE IMPORTED) + add_library(Boost::disable_autolinking INTERFACE IMPORTED) + add_library(Boost::dynamic_linking INTERFACE IMPORTED) + +endif() diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/Boost-1.70.0/BoostConfigVersion.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/Boost-1.70.0/BoostConfigVersion.cmake new file mode 100644 index 0000000..114bba0 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/Boost-1.70.0/BoostConfigVersion.cmake @@ -0,0 +1,12 @@ +# Generated by Boost 1.70.0 + +set(PACKAGE_VERSION 1.70.0) + +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/BoostDetectToolset-1.70.0.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/BoostDetectToolset-1.70.0.cmake new file mode 100644 index 0000000..2f1ac01 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/BoostDetectToolset-1.70.0.cmake @@ -0,0 +1 @@ +set(BOOST_DETECTED_TOOLSET "gcc7") diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/boost_chrono-config-version.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/boost_chrono-config-version.cmake new file mode 100644 index 0000000..114bba0 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/boost_chrono-config-version.cmake @@ -0,0 +1,12 @@ +# Generated by Boost 1.70.0 + +set(PACKAGE_VERSION 1.70.0) + +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/boost_chrono-config.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/boost_chrono-config.cmake new file mode 100644 index 0000000..5d798b5 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/boost_chrono-config.cmake @@ -0,0 +1,98 @@ +# Generated by Boost 1.70.0 + +if(TARGET Boost::chrono) + return() +endif() + +message(STATUS "Found boost_chrono ${boost_chrono_VERSION} at ${boost_chrono_DIR}") + +# Compute the include and library directories relative to this file. +get_filename_component(_BOOST_CMAKEDIR "${CMAKE_CURRENT_LIST_DIR}/../" ABSOLUTE) +get_filename_component(_BOOST_INCLUDEDIR "${_BOOST_CMAKEDIR}/../../include/" ABSOLUTE) +get_filename_component(_BOOST_LIBDIR "${_BOOST_CMAKEDIR}/../" ABSOLUTE) + +# Create imported target Boost::chrono +add_library(Boost::chrono UNKNOWN IMPORTED) + +set_target_properties(Boost::chrono PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_BOOST_INCLUDEDIR}" + INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB" +) + +include(${CMAKE_CURRENT_LIST_DIR}/../BoostDetectToolset-1.70.0.cmake) + +if(Boost_DEBUG) + message(STATUS "Scanning ${CMAKE_CURRENT_LIST_DIR}/libboost_chrono-variant*.cmake") +endif() + +file(GLOB __boost_variants "${CMAKE_CURRENT_LIST_DIR}/libboost_chrono-variant*.cmake") + +macro(_BOOST_SKIPPED fname reason) + if(Boost_DEBUG) + message(STATUS " ... skipped ${fname} (${reason})") + endif() + list(APPEND __boost_skipped "${fname} (${reason})") +endmacro() + +foreach(f IN LISTS __boost_variants) + if(Boost_DEBUG) + message(STATUS " Including ${f}") + endif() + include(${f}) +endforeach() + +unset(_BOOST_LIBDIR) +unset(_BOOST_INCLUDEDIR) +unset(_BOOST_CMAKEDIR) + +get_target_property(__boost_configs Boost::chrono IMPORTED_CONFIGURATIONS) + +if(__boost_variants AND NOT __boost_configs) + message(STATUS "No suitable boost_chrono variant has been identified!") + if(NOT Boost_DEBUG) + foreach(s IN LISTS __boost_skipped) + message(STATUS " ${s}") + endforeach() + endif() + set(boost_chrono_FOUND 0) + set(boost_chrono_NOT_FOUND_MESSAGE "No suitable build variant has been found.") + unset(__boost_skipped) + unset(__boost_configs) + unset(__boost_variants) + unset(_BOOST_CHRONO_DEPS) + return() +endif() + +unset(__boost_skipped) +unset(__boost_configs) +unset(__boost_variants) + +if(_BOOST_CHRONO_DEPS) + list(REMOVE_DUPLICATES _BOOST_CHRONO_DEPS) + message(STATUS "Adding boost_chrono dependencies: ${_BOOST_CHRONO_DEPS}") +endif() + +foreach(dep_boost_chrono IN LISTS _BOOST_CHRONO_DEPS) + set(_BOOST_QUIET) + if(boost_chrono_FIND_QUIETLY) + set(_BOOST_QUIET QUIET) + endif() + set(_BOOST_REQUIRED) + if(boost_chrono_FIND_REQUIRED) + set(_BOOST_REQUIRED REQUIRED) + endif() + get_filename_component(_BOOST_CMAKEDIR "${CMAKE_CURRENT_LIST_DIR}/../" ABSOLUTE) + find_package(boost_${dep_boost_chrono} 1.70.0 EXACT CONFIG ${_BOOST_REQUIRED} ${_BOOST_QUIET} HINTS ${_BOOST_CMAKEDIR}) + set_property(TARGET Boost::chrono APPEND PROPERTY INTERFACE_LINK_LIBRARIES Boost::${dep_boost_chrono}) + unset(_BOOST_QUIET) + unset(_BOOST_REQUIRED) + unset(_BOOST_CMAKEDIR) + if(NOT boost_${dep_boost_chrono}_FOUND) + set(boost_chrono_FOUND 0) + set(boost_chrono_NOT_FOUND_MESSAGE "A required dependency, boost_${dep_boost_chrono}, has not been found.") + unset(_BOOST_CHRONO_DEPS) + return() + endif() +endforeach() + +unset(_BOOST_CHRONO_DEPS) diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/libboost_chrono-variant-shared.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/libboost_chrono-variant-shared.cmake new file mode 100644 index 0000000..7f07aed --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/libboost_chrono-variant-shared.cmake @@ -0,0 +1,62 @@ +# Generated by Boost 1.70.0 + +# address-model=64 + +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + _BOOST_SKIPPED("libboost_chrono.so.1.70.0" "64 bit, need 32") + return() +endif() + +# layout=system + +# toolset=gcc8 + +# link=shared + +if(NOT "${Boost_USE_STATIC_LIBS}" STREQUAL "" AND Boost_USE_STATIC_LIBS) + _BOOST_SKIPPED("libboost_chrono.so.1.70.0" "shared, Boost_USE_STATIC_LIBS=${Boost_USE_STATIC_LIBS}") + return() +endif() + +if(NOT BUILD_SHARED_LIBS) + _BOOST_SKIPPED("libboost_chrono.so.1.70.0" "shared, BUILD_SHARED_LIBS not ON, set Boost_USE_STATIC_LIBS=OFF to override") + return() +endif() + +# runtime-link=shared + +if(Boost_USE_STATIC_RUNTIME) + _BOOST_SKIPPED("libboost_chrono.so.1.70.0" "shared runtime, Boost_USE_STATIC_RUNTIME=${Boost_USE_STATIC_RUNTIME}") + return() +endif() + +# runtime-debugging=off + +if(Boost_USE_DEBUG_RUNTIME) + _BOOST_SKIPPED("libboost_chrono.so.1.70.0" "release runtime, Boost_USE_DEBUG_RUNTIME=${Boost_USE_DEBUG_RUNTIME}") + return() +endif() + +# threading=multi + +# variant=release + +if(NOT "${Boost_USE_RELEASE_LIBS}" STREQUAL "" AND NOT Boost_USE_RELEASE_LIBS) + _BOOST_SKIPPED("libboost_chrono.so.1.70.0" "release, Boost_USE_RELEASE_LIBS=${Boost_USE_RELEASE_LIBS}") + return() +endif() + +message(STATUS " libboost_chrono.so.1.70.0") + +# Target file name: libboost_chrono.so.1.70.0 +set_property(TARGET Boost::chrono APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(Boost::chrono PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE CXX + IMPORTED_LOCATION_RELEASE "${_BOOST_LIBDIR}/libboost_chrono.so.1.70.0" + ) + +set_target_properties(Boost::chrono PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "BOOST_CHRONO_DYN_LINK" + ) + +list(APPEND _BOOST_CHRONO_DEPS headers) diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/libboost_chrono-variant-static.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/libboost_chrono-variant-static.cmake new file mode 100644 index 0000000..d7477b4 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/libboost_chrono-variant-static.cmake @@ -0,0 +1,58 @@ +# Generated by Boost 1.70.0 + +# address-model=64 + +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + _BOOST_SKIPPED("libboost_chrono.a" "64 bit, need 32") + return() +endif() + +# layout=system + +# toolset=gcc8 + +# link=static + +if(NOT "${Boost_USE_STATIC_LIBS}" STREQUAL "" AND NOT Boost_USE_STATIC_LIBS) + _BOOST_SKIPPED("libboost_chrono.a" "static, Boost_USE_STATIC_LIBS=${Boost_USE_STATIC_LIBS}") + return() +endif() + +if(BUILD_SHARED_LIBS) + _BOOST_SKIPPED("libboost_chrono.a" "static, BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}, set Boost_USE_STATIC_LIBS=ON to override") + return() +endif() + +# runtime-link=shared + +if(Boost_USE_STATIC_RUNTIME) + _BOOST_SKIPPED("libboost_chrono.a" "shared runtime, Boost_USE_STATIC_RUNTIME=${Boost_USE_STATIC_RUNTIME}") + return() +endif() + +# runtime-debugging=off + +if(Boost_USE_DEBUG_RUNTIME) + _BOOST_SKIPPED("libboost_chrono.a" "release runtime, Boost_USE_DEBUG_RUNTIME=${Boost_USE_DEBUG_RUNTIME}") + return() +endif() + +# threading=multi + +# variant=release + +if(NOT "${Boost_USE_RELEASE_LIBS}" STREQUAL "" AND NOT Boost_USE_RELEASE_LIBS) + _BOOST_SKIPPED("libboost_chrono.a" "release, Boost_USE_RELEASE_LIBS=${Boost_USE_RELEASE_LIBS}") + return() +endif() + +message(STATUS " libboost_chrono.a") + +# Target file name: libboost_chrono.a +set_property(TARGET Boost::chrono APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(Boost::chrono PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE CXX + IMPORTED_LOCATION_RELEASE "${_BOOST_LIBDIR}/libboost_chrono.a" + ) + +list(APPEND _BOOST_CHRONO_DEPS headers) diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_headers-1.70.0/boost_headers-config-version.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_headers-1.70.0/boost_headers-config-version.cmake new file mode 100644 index 0000000..114bba0 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_headers-1.70.0/boost_headers-config-version.cmake @@ -0,0 +1,12 @@ +# Generated by Boost 1.70.0 + +set(PACKAGE_VERSION 1.70.0) + +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_headers-1.70.0/boost_headers-config.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_headers-1.70.0/boost_headers-config.cmake new file mode 100644 index 0000000..0305ecd --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_headers-1.70.0/boost_headers-config.cmake @@ -0,0 +1,20 @@ +# Generated by Boost 1.70.0 + +if(TARGET Boost::headers) + return() +endif() + +message(STATUS "Found boost_headers ${boost_headers_VERSION} at ${boost_headers_DIR}") + +# Compute the include and library directories relative to this file. +get_filename_component(_BOOST_CMAKEDIR "${CMAKE_CURRENT_LIST_DIR}/../" ABSOLUTE) +get_filename_component(_BOOST_INCLUDEDIR "${_BOOST_CMAKEDIR}/../../include/" ABSOLUTE) +get_filename_component(_BOOST_LIBDIR "${_BOOST_CMAKEDIR}/../" ABSOLUTE) + +# Create imported target Boost::headers +add_library(Boost::headers INTERFACE IMPORTED) + +set_target_properties(Boost::headers PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_BOOST_INCLUDEDIR}" + INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB" +) diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/boost_system-config-version.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/boost_system-config-version.cmake new file mode 100644 index 0000000..114bba0 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/boost_system-config-version.cmake @@ -0,0 +1,12 @@ +# Generated by Boost 1.70.0 + +set(PACKAGE_VERSION 1.70.0) + +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/boost_system-config.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/boost_system-config.cmake new file mode 100644 index 0000000..40b10d0 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/boost_system-config.cmake @@ -0,0 +1,98 @@ +# Generated by Boost 1.70.0 + +if(TARGET Boost::system) + return() +endif() + +message(STATUS "Found boost_system ${boost_system_VERSION} at ${boost_system_DIR}") + +# Compute the include and library directories relative to this file. +get_filename_component(_BOOST_CMAKEDIR "${CMAKE_CURRENT_LIST_DIR}/../" ABSOLUTE) +get_filename_component(_BOOST_INCLUDEDIR "${_BOOST_CMAKEDIR}/../../include/" ABSOLUTE) +get_filename_component(_BOOST_LIBDIR "${_BOOST_CMAKEDIR}/../" ABSOLUTE) + +# Create imported target Boost::system +add_library(Boost::system UNKNOWN IMPORTED) + +set_target_properties(Boost::system PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_BOOST_INCLUDEDIR}" + INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB" +) + +include(${CMAKE_CURRENT_LIST_DIR}/../BoostDetectToolset-1.70.0.cmake) + +if(Boost_DEBUG) + message(STATUS "Scanning ${CMAKE_CURRENT_LIST_DIR}/libboost_system-variant*.cmake") +endif() + +file(GLOB __boost_variants "${CMAKE_CURRENT_LIST_DIR}/libboost_system-variant*.cmake") + +macro(_BOOST_SKIPPED fname reason) + if(Boost_DEBUG) + message(STATUS " ... skipped ${fname} (${reason})") + endif() + list(APPEND __boost_skipped "${fname} (${reason})") +endmacro() + +foreach(f IN LISTS __boost_variants) + if(Boost_DEBUG) + message(STATUS " Including ${f}") + endif() + include(${f}) +endforeach() + +unset(_BOOST_LIBDIR) +unset(_BOOST_INCLUDEDIR) +unset(_BOOST_CMAKEDIR) + +get_target_property(__boost_configs Boost::system IMPORTED_CONFIGURATIONS) + +if(__boost_variants AND NOT __boost_configs) + message(STATUS "No suitable boost_system variant has been identified!") + if(NOT Boost_DEBUG) + foreach(s IN LISTS __boost_skipped) + message(STATUS " ${s}") + endforeach() + endif() + set(boost_system_FOUND 0) + set(boost_system_NOT_FOUND_MESSAGE "No suitable build variant has been found.") + unset(__boost_skipped) + unset(__boost_configs) + unset(__boost_variants) + unset(_BOOST_SYSTEM_DEPS) + return() +endif() + +unset(__boost_skipped) +unset(__boost_configs) +unset(__boost_variants) + +if(_BOOST_SYSTEM_DEPS) + list(REMOVE_DUPLICATES _BOOST_SYSTEM_DEPS) + message(STATUS "Adding boost_system dependencies: ${_BOOST_SYSTEM_DEPS}") +endif() + +foreach(dep_boost_system IN LISTS _BOOST_SYSTEM_DEPS) + set(_BOOST_QUIET) + if(boost_system_FIND_QUIETLY) + set(_BOOST_QUIET QUIET) + endif() + set(_BOOST_REQUIRED) + if(boost_system_FIND_REQUIRED) + set(_BOOST_REQUIRED REQUIRED) + endif() + get_filename_component(_BOOST_CMAKEDIR "${CMAKE_CURRENT_LIST_DIR}/../" ABSOLUTE) + find_package(boost_${dep_boost_system} 1.70.0 EXACT CONFIG ${_BOOST_REQUIRED} ${_BOOST_QUIET} HINTS ${_BOOST_CMAKEDIR}) + set_property(TARGET Boost::system APPEND PROPERTY INTERFACE_LINK_LIBRARIES Boost::${dep_boost_system}) + unset(_BOOST_QUIET) + unset(_BOOST_REQUIRED) + unset(_BOOST_CMAKEDIR) + if(NOT boost_${dep_boost_system}_FOUND) + set(boost_system_FOUND 0) + set(boost_system_NOT_FOUND_MESSAGE "A required dependency, boost_${dep_boost_system}, has not been found.") + unset(_BOOST_SYSTEM_DEPS) + return() + endif() +endforeach() + +unset(_BOOST_SYSTEM_DEPS) diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/libboost_system-variant-shared.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/libboost_system-variant-shared.cmake new file mode 100644 index 0000000..751db32 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/libboost_system-variant-shared.cmake @@ -0,0 +1,62 @@ +# Generated by Boost 1.70.0 + +# address-model=64 + +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + _BOOST_SKIPPED("libboost_system.so.1.70.0" "64 bit, need 32") + return() +endif() + +# layout=system + +# toolset=gcc8 + +# link=shared + +if(NOT "${Boost_USE_STATIC_LIBS}" STREQUAL "" AND Boost_USE_STATIC_LIBS) + _BOOST_SKIPPED("libboost_system.so.1.70.0" "shared, Boost_USE_STATIC_LIBS=${Boost_USE_STATIC_LIBS}") + return() +endif() + +if(NOT BUILD_SHARED_LIBS) + _BOOST_SKIPPED("libboost_system.so.1.70.0" "shared, BUILD_SHARED_LIBS not ON, set Boost_USE_STATIC_LIBS=OFF to override") + return() +endif() + +# runtime-link=shared + +if(Boost_USE_STATIC_RUNTIME) + _BOOST_SKIPPED("libboost_system.so.1.70.0" "shared runtime, Boost_USE_STATIC_RUNTIME=${Boost_USE_STATIC_RUNTIME}") + return() +endif() + +# runtime-debugging=off + +if(Boost_USE_DEBUG_RUNTIME) + _BOOST_SKIPPED("libboost_system.so.1.70.0" "release runtime, Boost_USE_DEBUG_RUNTIME=${Boost_USE_DEBUG_RUNTIME}") + return() +endif() + +# threading=multi + +# variant=release + +if(NOT "${Boost_USE_RELEASE_LIBS}" STREQUAL "" AND NOT Boost_USE_RELEASE_LIBS) + _BOOST_SKIPPED("libboost_system.so.1.70.0" "release, Boost_USE_RELEASE_LIBS=${Boost_USE_RELEASE_LIBS}") + return() +endif() + +message(STATUS " libboost_system.so.1.70.0") + +# Target file name: libboost_system.so.1.70.0 +set_property(TARGET Boost::system APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(Boost::system PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE CXX + IMPORTED_LOCATION_RELEASE "${_BOOST_LIBDIR}/libboost_system.so.1.70.0" + ) + +set_target_properties(Boost::system PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "BOOST_SYSTEM_DYN_LINK" + ) + +list(APPEND _BOOST_SYSTEM_DEPS headers) diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/libboost_system-variant-static.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/libboost_system-variant-static.cmake new file mode 100644 index 0000000..b10e0b9 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/libboost_system-variant-static.cmake @@ -0,0 +1,58 @@ +# Generated by Boost 1.70.0 + +# address-model=64 + +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + _BOOST_SKIPPED("libboost_system.a" "64 bit, need 32") + return() +endif() + +# layout=system + +# toolset=gcc8 + +# link=static + +if(NOT "${Boost_USE_STATIC_LIBS}" STREQUAL "" AND NOT Boost_USE_STATIC_LIBS) + _BOOST_SKIPPED("libboost_system.a" "static, Boost_USE_STATIC_LIBS=${Boost_USE_STATIC_LIBS}") + return() +endif() + +if(BUILD_SHARED_LIBS) + _BOOST_SKIPPED("libboost_system.a" "static, BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}, set Boost_USE_STATIC_LIBS=ON to override") + return() +endif() + +# runtime-link=shared + +if(Boost_USE_STATIC_RUNTIME) + _BOOST_SKIPPED("libboost_system.a" "shared runtime, Boost_USE_STATIC_RUNTIME=${Boost_USE_STATIC_RUNTIME}") + return() +endif() + +# runtime-debugging=off + +if(Boost_USE_DEBUG_RUNTIME) + _BOOST_SKIPPED("libboost_system.a" "release runtime, Boost_USE_DEBUG_RUNTIME=${Boost_USE_DEBUG_RUNTIME}") + return() +endif() + +# threading=multi + +# variant=release + +if(NOT "${Boost_USE_RELEASE_LIBS}" STREQUAL "" AND NOT Boost_USE_RELEASE_LIBS) + _BOOST_SKIPPED("libboost_system.a" "release, Boost_USE_RELEASE_LIBS=${Boost_USE_RELEASE_LIBS}") + return() +endif() + +message(STATUS " libboost_system.a") + +# Target file name: libboost_system.a +set_property(TARGET Boost::system APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(Boost::system PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE CXX + IMPORTED_LOCATION_RELEASE "${_BOOST_LIBDIR}/libboost_system.a" + ) + +list(APPEND _BOOST_SYSTEM_DEPS headers) diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/boost_timer-config-version.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/boost_timer-config-version.cmake new file mode 100644 index 0000000..114bba0 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/boost_timer-config-version.cmake @@ -0,0 +1,12 @@ +# Generated by Boost 1.70.0 + +set(PACKAGE_VERSION 1.70.0) + +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/boost_timer-config.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/boost_timer-config.cmake new file mode 100644 index 0000000..b0d0e54 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/boost_timer-config.cmake @@ -0,0 +1,98 @@ +# Generated by Boost 1.70.0 + +if(TARGET Boost::timer) + return() +endif() + +message(STATUS "Found boost_timer ${boost_timer_VERSION} at ${boost_timer_DIR}") + +# Compute the include and library directories relative to this file. +get_filename_component(_BOOST_CMAKEDIR "${CMAKE_CURRENT_LIST_DIR}/../" ABSOLUTE) +get_filename_component(_BOOST_INCLUDEDIR "${_BOOST_CMAKEDIR}/../../include/" ABSOLUTE) +get_filename_component(_BOOST_LIBDIR "${_BOOST_CMAKEDIR}/../" ABSOLUTE) + +# Create imported target Boost::timer +add_library(Boost::timer UNKNOWN IMPORTED) + +set_target_properties(Boost::timer PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_BOOST_INCLUDEDIR}" + INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB" +) + +include(${CMAKE_CURRENT_LIST_DIR}/../BoostDetectToolset-1.70.0.cmake) + +if(Boost_DEBUG) + message(STATUS "Scanning ${CMAKE_CURRENT_LIST_DIR}/libboost_timer-variant*.cmake") +endif() + +file(GLOB __boost_variants "${CMAKE_CURRENT_LIST_DIR}/libboost_timer-variant*.cmake") + +macro(_BOOST_SKIPPED fname reason) + if(Boost_DEBUG) + message(STATUS " ... skipped ${fname} (${reason})") + endif() + list(APPEND __boost_skipped "${fname} (${reason})") +endmacro() + +foreach(f IN LISTS __boost_variants) + if(Boost_DEBUG) + message(STATUS " Including ${f}") + endif() + include(${f}) +endforeach() + +unset(_BOOST_LIBDIR) +unset(_BOOST_INCLUDEDIR) +unset(_BOOST_CMAKEDIR) + +get_target_property(__boost_configs Boost::timer IMPORTED_CONFIGURATIONS) + +if(__boost_variants AND NOT __boost_configs) + message(STATUS "No suitable boost_timer variant has been identified!") + if(NOT Boost_DEBUG) + foreach(s IN LISTS __boost_skipped) + message(STATUS " ${s}") + endforeach() + endif() + set(boost_timer_FOUND 0) + set(boost_timer_NOT_FOUND_MESSAGE "No suitable build variant has been found.") + unset(__boost_skipped) + unset(__boost_configs) + unset(__boost_variants) + unset(_BOOST_TIMER_DEPS) + return() +endif() + +unset(__boost_skipped) +unset(__boost_configs) +unset(__boost_variants) + +if(_BOOST_TIMER_DEPS) + list(REMOVE_DUPLICATES _BOOST_TIMER_DEPS) + message(STATUS "Adding boost_timer dependencies: ${_BOOST_TIMER_DEPS}") +endif() + +foreach(dep_boost_timer IN LISTS _BOOST_TIMER_DEPS) + set(_BOOST_QUIET) + if(boost_timer_FIND_QUIETLY) + set(_BOOST_QUIET QUIET) + endif() + set(_BOOST_REQUIRED) + if(boost_timer_FIND_REQUIRED) + set(_BOOST_REQUIRED REQUIRED) + endif() + get_filename_component(_BOOST_CMAKEDIR "${CMAKE_CURRENT_LIST_DIR}/../" ABSOLUTE) + find_package(boost_${dep_boost_timer} 1.70.0 EXACT CONFIG ${_BOOST_REQUIRED} ${_BOOST_QUIET} HINTS ${_BOOST_CMAKEDIR}) + set_property(TARGET Boost::timer APPEND PROPERTY INTERFACE_LINK_LIBRARIES Boost::${dep_boost_timer}) + unset(_BOOST_QUIET) + unset(_BOOST_REQUIRED) + unset(_BOOST_CMAKEDIR) + if(NOT boost_${dep_boost_timer}_FOUND) + set(boost_timer_FOUND 0) + set(boost_timer_NOT_FOUND_MESSAGE "A required dependency, boost_${dep_boost_timer}, has not been found.") + unset(_BOOST_TIMER_DEPS) + return() + endif() +endforeach() + +unset(_BOOST_TIMER_DEPS) diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/libboost_timer-variant-shared.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/libboost_timer-variant-shared.cmake new file mode 100644 index 0000000..b35b59d --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/libboost_timer-variant-shared.cmake @@ -0,0 +1,62 @@ +# Generated by Boost 1.70.0 + +# address-model=64 + +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + _BOOST_SKIPPED("libboost_timer.so.1.70.0" "64 bit, need 32") + return() +endif() + +# layout=system + +# toolset=gcc8 + +# link=shared + +if(NOT "${Boost_USE_STATIC_LIBS}" STREQUAL "" AND Boost_USE_STATIC_LIBS) + _BOOST_SKIPPED("libboost_timer.so.1.70.0" "shared, Boost_USE_STATIC_LIBS=${Boost_USE_STATIC_LIBS}") + return() +endif() + +if(NOT BUILD_SHARED_LIBS) + _BOOST_SKIPPED("libboost_timer.so.1.70.0" "shared, BUILD_SHARED_LIBS not ON, set Boost_USE_STATIC_LIBS=OFF to override") + return() +endif() + +# runtime-link=shared + +if(Boost_USE_STATIC_RUNTIME) + _BOOST_SKIPPED("libboost_timer.so.1.70.0" "shared runtime, Boost_USE_STATIC_RUNTIME=${Boost_USE_STATIC_RUNTIME}") + return() +endif() + +# runtime-debugging=off + +if(Boost_USE_DEBUG_RUNTIME) + _BOOST_SKIPPED("libboost_timer.so.1.70.0" "release runtime, Boost_USE_DEBUG_RUNTIME=${Boost_USE_DEBUG_RUNTIME}") + return() +endif() + +# threading=multi + +# variant=release + +if(NOT "${Boost_USE_RELEASE_LIBS}" STREQUAL "" AND NOT Boost_USE_RELEASE_LIBS) + _BOOST_SKIPPED("libboost_timer.so.1.70.0" "release, Boost_USE_RELEASE_LIBS=${Boost_USE_RELEASE_LIBS}") + return() +endif() + +message(STATUS " libboost_timer.so.1.70.0") + +# Target file name: libboost_timer.so.1.70.0 +set_property(TARGET Boost::timer APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(Boost::timer PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE CXX + IMPORTED_LOCATION_RELEASE "${_BOOST_LIBDIR}/libboost_timer.so.1.70.0" + ) + +set_target_properties(Boost::timer PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "BOOST_TIMER_DYN_LINK" + ) + +list(APPEND _BOOST_TIMER_DEPS chrono headers) diff --git a/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/libboost_timer-variant-static.cmake b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/libboost_timer-variant-static.cmake new file mode 100644 index 0000000..37fa9c0 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/libboost_timer-variant-static.cmake @@ -0,0 +1,58 @@ +# Generated by Boost 1.70.0 + +# address-model=64 + +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + _BOOST_SKIPPED("libboost_timer.a" "64 bit, need 32") + return() +endif() + +# layout=system + +# toolset=gcc8 + +# link=static + +if(NOT "${Boost_USE_STATIC_LIBS}" STREQUAL "" AND NOT Boost_USE_STATIC_LIBS) + _BOOST_SKIPPED("libboost_timer.a" "static, Boost_USE_STATIC_LIBS=${Boost_USE_STATIC_LIBS}") + return() +endif() + +if(BUILD_SHARED_LIBS) + _BOOST_SKIPPED("libboost_timer.a" "static, BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}, set Boost_USE_STATIC_LIBS=ON to override") + return() +endif() + +# runtime-link=shared + +if(Boost_USE_STATIC_RUNTIME) + _BOOST_SKIPPED("libboost_timer.a" "shared runtime, Boost_USE_STATIC_RUNTIME=${Boost_USE_STATIC_RUNTIME}") + return() +endif() + +# runtime-debugging=off + +if(Boost_USE_DEBUG_RUNTIME) + _BOOST_SKIPPED("libboost_timer.a" "release runtime, Boost_USE_DEBUG_RUNTIME=${Boost_USE_DEBUG_RUNTIME}") + return() +endif() + +# threading=multi + +# variant=release + +if(NOT "${Boost_USE_RELEASE_LIBS}" STREQUAL "" AND NOT Boost_USE_RELEASE_LIBS) + _BOOST_SKIPPED("libboost_timer.a" "release, Boost_USE_RELEASE_LIBS=${Boost_USE_RELEASE_LIBS}") + return() +endif() + +message(STATUS " libboost_timer.a") + +# Target file name: libboost_timer.a +set_property(TARGET Boost::timer APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(Boost::timer PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE CXX + IMPORTED_LOCATION_RELEASE "${_BOOST_LIBDIR}/libboost_timer.a" + ) + +list(APPEND _BOOST_TIMER_DEPS chrono headers) diff --git a/Tests/RunCMake/FindBoost/CommonNotFound-stderr.txt b/Tests/RunCMake/FindBoost/CommonNotFound-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/FindBoost/CommonNotFound-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/FindBoost/CommonNotFound-stdout.txt b/Tests/RunCMake/FindBoost/CommonNotFound-stdout.txt new file mode 100644 index 0000000..644469e --- /dev/null +++ b/Tests/RunCMake/FindBoost/CommonNotFound-stdout.txt @@ -0,0 +1 @@ +-- Could NOT find Boost diff --git a/Tests/RunCMake/FindBoost/CommonNotFound.cmake b/Tests/RunCMake/FindBoost/CommonNotFound.cmake new file mode 100644 index 0000000..864a549 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CommonNotFound.cmake @@ -0,0 +1,2 @@ +# Make sure to use the module mode signature here to not bypass FindBoost +find_package(Boost 1.80 COMPONENTS timer foobar) diff --git a/Tests/RunCMake/FindBoost/CommonResults-stdout.txt b/Tests/RunCMake/FindBoost/CommonResults-stdout.txt new file mode 100644 index 0000000..a560843 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CommonResults-stdout.txt @@ -0,0 +1,13 @@ +-- Found Boost: [^ +]* \(found suitable version "1\.70\.0", minimum required is "1\.60"\) found components: .*timer.* +-- Boost_FOUND +-- Boost_VERSION=(107000|1\.70\.0) +-- Boost_VERSION_MAJOR=1 +-- Boost_VERSION_MINOR=70 +-- Boost_VERSION_PATCH=0 +-- Boost_VERSION_COUNT=3 +-- Boost::headers +-- Boost::boost +-- Boost::chrono +-- Boost::timer +(-- Boost::system)? diff --git a/Tests/RunCMake/FindBoost/CommonResults.cmake b/Tests/RunCMake/FindBoost/CommonResults.cmake new file mode 100644 index 0000000..6876800 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CommonResults.cmake @@ -0,0 +1,25 @@ +# Make sure to use the module mode signature here to not bypass FindBoost +find_package(Boost 1.60 COMPONENTS timer MODULE) +if(Boost_FOUND) + message(STATUS "Boost_FOUND") +endif() +message(STATUS "Boost_VERSION=${Boost_VERSION}") +message(STATUS "Boost_VERSION_MAJOR=${Boost_VERSION_MAJOR}") +message(STATUS "Boost_VERSION_MINOR=${Boost_VERSION_MINOR}") +message(STATUS "Boost_VERSION_PATCH=${Boost_VERSION_PATCH}") +message(STATUS "Boost_VERSION_COUNT=${Boost_VERSION_COUNT}") +if(TARGET Boost::headers) + message(STATUS "Boost::headers") +endif() +if(TARGET Boost::boost) + message(STATUS "Boost::boost") +endif() +if(TARGET Boost::chrono) + message(STATUS "Boost::chrono") +endif() +if(TARGET Boost::timer) + message(STATUS "Boost::timer") +endif() +if(TARGET Boost::system) + message(STATUS "Boost::system") +endif() diff --git a/Tests/RunCMake/FindBoost/ConfigMode.cmake b/Tests/RunCMake/FindBoost/ConfigMode.cmake new file mode 100644 index 0000000..5600658 --- /dev/null +++ b/Tests/RunCMake/FindBoost/ConfigMode.cmake @@ -0,0 +1,2 @@ +set(Boost_DIR ${CMAKE_CURRENT_SOURCE_DIR}/CMakePackageFixtures/Boost-1.70.0) +include(${CMAKE_CURRENT_SOURCE_DIR}/CommonResults.cmake) diff --git a/Tests/RunCMake/FindBoost/ConfigModeNotFound.cmake b/Tests/RunCMake/FindBoost/ConfigModeNotFound.cmake new file mode 100644 index 0000000..7e90a3c --- /dev/null +++ b/Tests/RunCMake/FindBoost/ConfigModeNotFound.cmake @@ -0,0 +1,2 @@ +set(Boost_DIR ${CMAKE_CURRENT_SOURCE_DIR}/CMakePackageFixtures/Boost-1.70.0) +include(${CMAKE_CURRENT_SOURCE_DIR}/CommonNotFound.cmake) diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/chrono.hpp b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/chrono.hpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/chrono.hpp diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/config.hpp b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/config.hpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/config.hpp diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/system/config.hpp b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/system/config.hpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/system/config.hpp diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/timer.hpp b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/timer.hpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/timer.hpp diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/version.hpp b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/version.hpp new file mode 100644 index 0000000..3ca02b3 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/version.hpp @@ -0,0 +1,34 @@ +// Boost version.hpp configuration header file +// ------------------------------// + +// (C) Copyright John maddock 1999. Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for documentation + +#ifndef BOOST_VERSION_HPP +#define BOOST_VERSION_HPP + +// +// Caution: this is the only Boost header that is guaranteed +// to change with every Boost release. Including this header +// will cause a recompile every time a new Boost version is +// used. +// +// BOOST_VERSION % 100 is the patch level +// BOOST_VERSION / 100 % 1000 is the minor version +// BOOST_VERSION / 100000 is the major version + +#define BOOST_VERSION 107000 + +// +// BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION +// but as a *string* in the form "x_y[_z]" where x is the major version +// number, y is the minor version number, and z is the patch level if not 0. +// This is used by <config/auto_link.hpp> to select which library version to +// link to. + +#define BOOST_LIB_VERSION "1_70" + +#endif diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/boost_chrono-mt-1_70.lib b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/boost_chrono-mt-1_70.lib new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/boost_chrono-mt-1_70.lib diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/boost_system-mt-1_70.lib b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/boost_system-mt-1_70.lib new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/boost_system-mt-1_70.lib diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/boost_timer-mt-1_70.lib b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/boost_timer-mt-1_70.lib new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/boost_timer-mt-1_70.lib diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_chrono-mt-1_70.lib b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_chrono-mt-1_70.lib new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_chrono-mt-1_70.lib diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_chrono.a b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_chrono.a new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_chrono.a diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_chrono.so.1.70.0 b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_chrono.so.1.70.0 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_chrono.so.1.70.0 diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_system-mt-1_70.lib b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_system-mt-1_70.lib new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_system-mt-1_70.lib diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_system.a b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_system.a new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_system.a diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_system.so.1.70.0 b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_system.so.1.70.0 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_system.so.1.70.0 diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_timer-mt-1_70.lib b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_timer-mt-1_70.lib new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_timer-mt-1_70.lib diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_timer.a b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_timer.a new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_timer.a diff --git a/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_timer.so.1.70.0 b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_timer.so.1.70.0 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_timer.so.1.70.0 diff --git a/Tests/RunCMake/FindBoost/ModuleMode.cmake b/Tests/RunCMake/FindBoost/ModuleMode.cmake new file mode 100644 index 0000000..823fc53 --- /dev/null +++ b/Tests/RunCMake/FindBoost/ModuleMode.cmake @@ -0,0 +1,4 @@ +set(BOOST_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/MockInstalls/1.70.0) +set(Boost_NO_BOOST_CMAKE ON) +set(Boost_NO_SYSTEM_PATHS ON) +include(${CMAKE_CURRENT_SOURCE_DIR}/CommonResults.cmake) diff --git a/Tests/RunCMake/FindBoost/ModuleModeNotFound.cmake b/Tests/RunCMake/FindBoost/ModuleModeNotFound.cmake new file mode 100644 index 0000000..aaffbf2 --- /dev/null +++ b/Tests/RunCMake/FindBoost/ModuleModeNotFound.cmake @@ -0,0 +1,4 @@ +set(BOOST_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/MockInstalls/1.70.0) +set(Boost_NO_BOOST_CMAKE ON) +set(Boost_NO_SYSTEM_PATHS ON) +include(${CMAKE_CURRENT_SOURCE_DIR}/CommonNotFound.cmake) diff --git a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake index eef350c..d66bda1 100644 --- a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake +++ b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake @@ -3,3 +3,14 @@ unset(ENV{Boost_ROOT}) run_cmake(CMakePackage) run_cmake(NoCXX) + +set(RunCMake-stdout-file CommonResults-stdout.txt) +run_cmake(ConfigMode) +run_cmake(ModuleMode) +unset(RunCMake-stdout-file) +set(RunCMake-stdout-file CommonNotFound-stdout.txt) +set(RunCMake-stderr-file CommonNotFound-stderr.txt) +run_cmake(ConfigModeNotFound) +run_cmake(ModuleModeNotFound) +unset(RunCMake-stdout-file) +unset(RunCMake-stderr-file) |