diff options
author | Brad King <brad.king@kitware.com> | 2018-11-06 16:30:01 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-11-06 16:31:55 (GMT) |
commit | f55b7bdc5dd0dbc6897cb2d5f4673516a6afc4db (patch) | |
tree | d04d5b96e06d600f4f52d70405977426090f9ef9 | |
parent | 1674a5b0a4c2432b9fe7c8ceb4287312c46ad763 (diff) | |
parent | 3f22656d8ca3ab264a714d95c4cdfd2cb9972650 (diff) | |
download | CMake-f55b7bdc5dd0dbc6897cb2d5f4673516a6afc4db.zip CMake-f55b7bdc5dd0dbc6897cb2d5f4673516a6afc4db.tar.gz CMake-f55b7bdc5dd0dbc6897cb2d5f4673516a6afc4db.tar.bz2 |
Merge topic 'FindBoost-explicit-arch-tag'
3f22656d8c Merge branch 'backport-FindBoost-explicit-arch-tag'
1e08b625c2 FindBoost: Add explicit Boost_ARCHITECTURE option
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2568
-rw-r--r-- | Help/release/3.13.rst | 3 | ||||
-rw-r--r-- | Modules/FindBoost.cmake | 53 |
2 files changed, 35 insertions, 21 deletions
diff --git a/Help/release/3.13.rst b/Help/release/3.13.rst index f547556..605122a 100644 --- a/Help/release/3.13.rst +++ b/Help/release/3.13.rst @@ -138,6 +138,9 @@ Properties Modules ------- +* The :module:`FindBoost` module gained a ``Boost_ARCHITECTURE`` option + to specify a Boost architecture-specific library filename fragment. + * The :module:`FindCURL` module learned to find debug and release variants separately. diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 23f636e..889dbf1 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -147,6 +147,9 @@ setting variables:: used if multiple compatible suffixes should be tested for, in decreasing order of preference. + Boost_ARCHITECTURE - Set to the architecture-specific library suffix + (e.g. "-x64"). Default is auto-computed for the + C++ compiler in use. Boost_THREADAPI - Suffix for "thread" component library name, such as "pthread" or "win32". Names with and without this suffix will both be tried. @@ -1507,27 +1510,35 @@ endif() # -x86 Architecture and address model tag # First character is the architecture, then word-size, either 32 or 64 # Only used in 'versioned' layout, added in Boost 1.66.0 -set(_boost_ARCHITECTURE_TAG "") -# {CMAKE_CXX_COMPILER_ARCHITECTURE_ID} is not currently set for all compilers -if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION VERSION_LESS 106600) - string(APPEND _boost_ARCHITECTURE_TAG "-") - # This needs to be kept in-sync with the section of CMakePlatformId.h.in - # inside 'defined(_WIN32) && defined(_MSC_VER)' - if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "IA64") - string(APPEND _boost_ARCHITECTURE_TAG "i") - elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "X86" - OR CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "x64") - string(APPEND _boost_ARCHITECTURE_TAG "x") - elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "^ARM") - string(APPEND _boost_ARCHITECTURE_TAG "a") - elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "MIPS") - string(APPEND _boost_ARCHITECTURE_TAG "m") - endif() - - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - string(APPEND _boost_ARCHITECTURE_TAG "64") - else() - string(APPEND _boost_ARCHITECTURE_TAG "32") +if(DEFINED Boost_ARCHITECTURE) + set(_boost_ARCHITECTURE_TAG "${Boost_ARCHITECTURE}") + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "using user-specified Boost_ARCHITECTURE = ${_boost_ARCHITECTURE_TAG}") + endif() +else() + set(_boost_ARCHITECTURE_TAG "") + # {CMAKE_CXX_COMPILER_ARCHITECTURE_ID} is not currently set for all compilers + if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION VERSION_LESS 106600) + string(APPEND _boost_ARCHITECTURE_TAG "-") + # This needs to be kept in-sync with the section of CMakePlatformId.h.in + # inside 'defined(_WIN32) && defined(_MSC_VER)' + if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "IA64") + string(APPEND _boost_ARCHITECTURE_TAG "i") + elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "X86" + OR CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "x64") + string(APPEND _boost_ARCHITECTURE_TAG "x") + elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "^ARM") + string(APPEND _boost_ARCHITECTURE_TAG "a") + elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "MIPS") + string(APPEND _boost_ARCHITECTURE_TAG "m") + endif() + + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + string(APPEND _boost_ARCHITECTURE_TAG "64") + else() + string(APPEND _boost_ARCHITECTURE_TAG "32") + endif() endif() endif() |