Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated code for boost #732

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 0 additions & 138 deletions boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -162,144 +162,6 @@ macro(SEARCH_FOR_BOOST_PYTHON)
list(APPEND LOGGING_WATCHED_VARIABLES Boost_PYTHON_LIBRARY)
endmacro(SEARCH_FOR_BOOST_PYTHON)

#
# .rst: .. command:: SEARCH_FOR_BOOST
#
# Deprecated. For Boost Python, use :command:`SEARCH_FOR_BOOST_PYTHON`. For
# other Boost components, use::
#
# add_project_dependency(Boost COMPONENTS ...) # or other argument to the
# find_package command.
#
# or, if you don't want it to be exported::
#
# find_package(Boost COMPONENTS ...) # or other argument to the find_package
# command.
#
# This macro deals with Visual Studio Fortran incompatibilities and add detected
# flags to the pkg-config file automatically.
#
# The components to be detected is controlled by :variable:`BOOST_COMPONENTS`.
#
# A special treatment must be done for the boost-python component. For boost >=
# 1.67.0, FindPython macro should be called first in order to automatically
# detect the right boost-python component version according to the Python
# version (2.7 or 3.x).
#

macro(SEARCH_FOR_BOOST)
message(
AUTHOR_WARNING
"SEARCH_FOR_BOOST is deprecated. Please use find_package() / SEARCH_FOR_BOOST_PYTHON()"
)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)

# First try to find Boost to get the version
find_package(Boost ${BOOST_REQUIRED})
string(REPLACE "_" "." Boost_SHORT_VERSION ${Boost_LIB_VERSION})
if(
"${Boost_SHORT_VERSION}" VERSION_GREATER "1.70"
OR "${Boost_SHORT_VERSION}" VERSION_EQUAL "1.70"
)
set(BUILD_SHARED_LIBS ON)
set(Boost_NO_BOOST_CMAKE ON)
endif(
"${Boost_SHORT_VERSION}" VERSION_GREATER "1.70"
OR "${Boost_SHORT_VERSION}" VERSION_EQUAL "1.70"
)

if(NOT DEFINED BOOST_COMPONENTS)
set(
BOOST_COMPONENTS
filesystem
system
thread
program_options
unit_test_framework
)
endif(NOT DEFINED BOOST_COMPONENTS)

# Check if python is in the list and adjust the version according to the
# current Python version. This is made mandatory if for Boost version greater
# than 1.67.0
list(FIND BOOST_COMPONENTS python PYTHON_IN_BOOST_COMPONENTS)
if(${PYTHON_IN_BOOST_COMPONENTS} GREATER -1)
list(REMOVE_AT BOOST_COMPONENTS ${PYTHON_IN_BOOST_COMPONENTS})
search_for_boost_python(${BOOST_REQUIRED})
endif(${PYTHON_IN_BOOST_COMPONENTS} GREATER -1)

# Make Boost component exportable
list(
INSERT
_PACKAGE_CONFIG_DEPENDENCIES_FIND_PACKAGE
0
"SET(Boost_USE_STATIC_LIBS OFF);SET(Boost_USE_MULTITHREADED ON)"
)
list(
INSERT
_PACKAGE_CONFIG_DEPENDENCIES_FIND_DEPENDENCY
0
"SET(Boost_USE_STATIC_LIBS OFF);SET(Boost_USE_MULTITHREADED ON)"
)
add_project_dependency(Boost ${BOOST_REQUIRED} COMPONENTS ${BOOST_COMPONENTS}
REQUIRED
)

if(NOT Boost_FOUND)
message(
FATAL_ERROR
"Failed to detect Boost with the following components:\n"
${COMPONENTS}
)
endif(NOT Boost_FOUND)

pkg_config_append_cflags("-I${Boost_INCLUDE_DIR}")

list(
APPEND
LOGGING_WATCHED_VARIABLES
Boost_USE_MULTITHREADED
Boost_USE_STATIC_LIBS
Boost_ADDITIONAL_VERSIONS
Boost_DEBUG
Boost_COMPILER
BOOST_ROOT
BOOSTROOT
BOOST_INCLUDEDIR
BOOST_LIBRARYDIR
Boost_FOUND
Boost_INCLUDE_DIRS
Boost_INCLUDE_DIR
Boost_LIBRARIES
Boost_LIBRARY_DIRS
Boost_VERSION
Boost_LIB_VERSION
Boost_MAJOR_VERSION
Boost_MINOR_VERSION
Boost_SUBMINOR_VERSION
Boost_LIB_DIAGNOSTIC_DEFINITIONS
)
foreach(COMPONENT ${BOOST_COMPONENTS})
string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
list(
APPEND
LOGGING_WATCHED_VARIABLES
Boost_${UPPERCOMPONENT}_FOUND
Boost_${UPPERCOMPONENT}_LIBRARY
Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
)
endforeach()

# On darwin systems, we must link againt boost_python with unresolved symbols.
# We then remove boost_python from the global Boost_LIBRARIES list to handle
# it with specific care.
if(Boost_PYTHON_LIBRARY)
list(REMOVE_ITEM Boost_LIBRARIES ${Boost_PYTHON_LIBRARY})
endif(Boost_PYTHON_LIBRARY)
endmacro(SEARCH_FOR_BOOST)

# .rst: .. command:: TARGET_LINK_BOOST_PYTHON (TARGET
# <PRIVATE|PUBLIC|INTERFACE>)
#
Expand Down