mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-01 11:22:21 -06:00
FindBoost: Fix detection with version suffixes on Gentoo
The Gentoo case added by commit 1673923c30 (FindBoost: Add support for
Boost 1.67 with Python version suffixes, 2018-03-18, v3.11.0~3^2) left
out the `.` version component separator and instead duplicated the RPM
case. Add the missing `.` now.
Fixes: #18743
This commit is contained in:
committed by
Brad King
parent
5e98111643
commit
0b54f72e94
@@ -1756,7 +1756,7 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
|
||||
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
|
||||
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
|
||||
# Gentoo
|
||||
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
|
||||
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}.${COMPONENT_PYTHON_VERSION_MINOR}")
|
||||
# RPMs
|
||||
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
|
||||
endif()
|
||||
|
||||
@@ -33,3 +33,16 @@ add_test(NAME FindBoost.TestHeaders COMMAND
|
||||
--build-options ${build_options}
|
||||
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
|
||||
)
|
||||
|
||||
if (CMake_TEST_FindBoost_Python)
|
||||
add_test(NAME FindBoost.TestPython COMMAND
|
||||
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
|
||||
--build-and-test
|
||||
"${CMake_SOURCE_DIR}/Tests/FindBoost/TestPython"
|
||||
"${CMake_BINARY_DIR}/Tests/FindBoost/TestPython"
|
||||
${build_generator_args}
|
||||
--build-project TestFindBoostPython
|
||||
--build-options ${build_options}
|
||||
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
|
||||
)
|
||||
endif ()
|
||||
|
||||
17
Tests/FindBoost/TestPython/CMakeLists.txt
Normal file
17
Tests/FindBoost/TestPython/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
project(TestFindBoostPython CXX)
|
||||
include(CTest)
|
||||
|
||||
find_package(Boost OPTIONAL_COMPONENTS python27 python34 python35 python36 python37)
|
||||
|
||||
set(FAILTEST TRUE)
|
||||
foreach (v IN ITEMS 27 34 35 36 37)
|
||||
if (Boost_PYTHON${v}_FOUND)
|
||||
set(FAILTEST FALSE)
|
||||
break()
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
if (FAILTEST)
|
||||
message(FATAL_ERROR "No Boost Python module found")
|
||||
endif ()
|
||||
Reference in New Issue
Block a user