-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Add Boost CMake module #3731
Draft
shrijitsingh99
wants to merge
3
commits into
PointCloudLibrary:master
Choose a base branch
from
shrijitsingh99:boost-cmake
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add Boost CMake module #3731
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# use static Boost in Windows | ||
if(WIN32) | ||
kunaltyagi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
set(Boost_USE_STATIC_LIBS @Boost_USE_STATIC_LIBS@) | ||
set(Boost_USE_STATIC @Boost_USE_STATIC@) | ||
set(Boost_USE_MULTITHREAD @Boost_USE_MULTITHREAD@) | ||
endif() | ||
|
||
# If we would like to compile against a dynamically linked Boost | ||
if(PCL_BUILD_WITH_BOOST_DYNAMIC_LINKING_WIN32 AND WIN32) | ||
set(Boost_USE_STATIC_LIBS OFF) | ||
set(Boost_USE_STATIC OFF) | ||
set(Boost_USE_MULTITHREAD ON) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB") | ||
else() | ||
if(NOT PCL_SHARED_LIBS OR WIN32) | ||
set(Boost_USE_STATIC_LIBS ON) | ||
set(Boost_USE_STATIC ON) | ||
endif() | ||
endif() | ||
|
||
set(Boost_ADDITIONAL_VERSIONS | ||
"1.71.0" "1.71" "1.70.0" "1.70" | ||
"1.69.0" "1.69" "1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65" | ||
"1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60" | ||
"1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55") | ||
|
||
# Disable the config mode of find_package(Boost) | ||
set(Boost_NO_BOOST_CMAKE ON) | ||
|
||
# Required boost modules | ||
set(BOOST_OPTIONAL_MODULES serialization) | ||
set(BOOST_REQUIRED_MODULES filesystem date_time iostreams system) | ||
|
||
# Temporarily clean out CMAKE_MODULE_PATH, so that we can pick up the built-in Find-module from CMake: | ||
set( CMAKE_MODULE_PATH_BAK ${CMAKE_MODULE_PATH} ) | ||
set( CMAKE_MODULE_PATH ) | ||
|
||
# Call CMake's own Find-module | ||
find_package(Boost 1.55.0 REQUIRED COMPONENTS ${BOOST_REQUIRED_MODULES} OPTIONAL_COMPONENTS ${BOOST_OPTIONAL_MODULES}) | ||
|
||
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH_BAK} ) | ||
|
||
if(Boost_SERIALIZATION_FOUND) | ||
set(BOOST_SERIALIZATION_FOUND TRUE) | ||
endif() | ||
|
||
if(Boost_FOUND) | ||
set(BOOST_FOUND TRUE) | ||
# Obtain diagnostic information about Boost's automatic linking outputted | ||
# during compilation time. | ||
add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS}) | ||
include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) | ||
link_directories(${Boost_LIBRARY_DIRS}) | ||
endif() | ||
|
||
set(BOOST_INCLUDE_DIRS "${Boost_INCLUDE_DIR}") | ||
set(BOOST_LIBRARY_DIRS "${Boost_LIBRARY_DIRS}") | ||
set(BOOST_LIBRARIES ${Boost_LIBRARIES}) | ||
if(WIN32 AND NOT MINGW) | ||
set(BOOST_DEFINITIONS ${BOOST_DEFINITIONS} -DBOOST_ALL_NO_LIB) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this stop overriding the Boost_LIBRARIES variable for anyone consuming PCL? There's an issue open (and verified) which says that
find_package(Boost)
beforefind_package(PCL)
causes PCL to override the Boost librariesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, what's the relationship of
pcl_find_boost.cmake
withModules/FindBoost.cmake
(because I notice it's untouched in this PR)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is to be removed.
Currently, no. It should be possible though to append the already existing found components to the list of found components.