Skip to content

Commit

Permalink
Merge branch 'master' into topic/gersemi-add-defs-and-format
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarpent authored Dec 20, 2024
2 parents f16fece + 8456ad4 commit df74719
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 149 deletions.
142 changes: 0 additions & 142 deletions boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -162,148 +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
13 changes: 8 additions & 5 deletions doxygen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -635,18 +635,18 @@ macro(_SETUP_PROJECT_DOCUMENTATION)
if(EXISTS ${PROJECT_BINARY_DIR}/doc/${PROJECT_NAME}.doxytag)
install(
FILES ${PROJECT_BINARY_DIR}/doc/${PROJECT_NAME}.doxytag
DESTINATION ${CMAKE_INSTALL_DOCDIR}/doxygen-html
DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR}/doxygen-html
)
endif()
install(
DIRECTORY ${PROJECT_BINARY_DIR}/doc/doxygen-html
DESTINATION ${CMAKE_INSTALL_DOCDIR}
DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR}
)

if(EXISTS ${PROJECT_SOURCE_DIR}/doc/pictures)
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/doc/pictures
DESTINATION ${CMAKE_INSTALL_DOCDIR}/doxygen-html
DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR}/doxygen-html
)
endif(EXISTS ${PROJECT_SOURCE_DIR}/doc/pictures)
endif(INSTALL_DOCUMENTATION)
Expand Down Expand Up @@ -714,6 +714,9 @@ endmacro()
# Doxyfile.extra and Doxyfile files are generated at the end to allow the
# replacement of user-defined variables.
#
# Additional doxygen tagfiles from dependencies can be added to
# `DOXYGEN_TAGFILES_FROM_DEPENDENCIES`
#
macro(_SETUP_PROJECT_DOCUMENTATION_FINALIZE)
if(DOXYGEN_FOUND)
if(NOT "${DOXYGEN_USE_MATHJAX}" STREQUAL "YES")
Expand Down Expand Up @@ -746,7 +749,7 @@ macro(_SETUP_PROJECT_DOCUMENTATION_FINALIZE)
if(INSTALL_DOCUMENTATION)
# Find doxytag files To ignore this list of tag files, set variable
# DOXYGEN_TAGFILES
set(INSTALL_DOCDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DOCDIR})
set(_TAGFILES_FROM_DEPENDENCIES "${DOXYGEN_TAGFILES_FROM_DEPENDENCIES}")
set(PKG_REQUIRES ${_PKG_CONFIG_REQUIRES})
list(APPEND PKG_REQUIRES ${_PKG_CONFIG_COMPILE_TIME_REQUIRES})
foreach(PKG_CONFIG_STRING ${PKG_REQUIRES})
Expand All @@ -764,7 +767,7 @@ macro(_SETUP_PROJECT_DOCUMENTATION_FINALIZE)
file(
RELATIVE_PATH
DEP_DOCDIR
${INSTALL_DOCDIR}
${CMAKE_INSTALL_FULL_DOCDIR}
${${PREFIX}_DOXYGENDOCDIR}
)

Expand Down
15 changes: 13 additions & 2 deletions header.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2008-2019 LAAS-CNRS, JRL AIST-CNRS, INRIA.
# Copyright (C) 2008-2024 LAAS-CNRS, JRL AIST-CNRS, INRIA.
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -313,9 +313,20 @@ macro(HEADER_INSTALL)
string(REGEX REPLACE "${CMAKE_BINARY_DIR}" "" DIR "${DIR}")
string(REGEX REPLACE "${PROJECT_SOURCE_DIR}" "" DIR "${DIR}")
string(REGEX REPLACE "include(/|$)" "" DIR "${DIR}")
if(CMAKE_VERSION` VERSION_GREATER 3.20)
# workaround CMP0177
cmake_path(
SET
INSTALL_PATH
NORMALIZE
"${CMAKE_INSTALL_INCLUDEDIR}/${DIR}"
)
else()
set(INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}/${DIR}")
endif()
install(
FILES ${FILE}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${DIR}"
DESTINATION ${INSTALL_PATH}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
COMPONENT ${_COMPONENT_NAME}
)
Expand Down

0 comments on commit df74719

Please sign in to comment.