-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental support for supporting builds from the Git repository
- Loading branch information
Showing
10 changed files
with
98 additions
and
34 deletions.
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
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 |
---|---|---|
@@ -1,9 +1,22 @@ | ||
# Detect Boost version | ||
file(STRINGS "${BOOST_SOURCE}/boost/version.hpp" boost_version_raw | ||
if(EXISTS "${BOOST_SOURCE}/boost/version.hpp") | ||
set(BOOST_MODULARIZED FALSE) | ||
set(boost_version_file "${BOOST_SOURCE}/boost/version.hpp") | ||
message(STATUS "Boost format: archive") | ||
elseif(EXISTS "${BOOST_SOURCE}/libs/config/include/boost/version.hpp") | ||
set(BOOST_MODULARIZED TRUE) | ||
set(boost_version_file "${BOOST_SOURCE}/libs/config/include/boost/version.hpp") | ||
message(STATUS "Boost format: modularized") | ||
endif() | ||
|
||
file(STRINGS "${boost_version_file}" boost_version_raw | ||
REGEX "define BOOST_VERSION " | ||
) | ||
string(REGEX MATCH "[0-9]+" boost_version_raw "${boost_version_raw}") | ||
math(EXPR BOOST_VERSION_MAJOR "${boost_version_raw} / 100000") | ||
math(EXPR BOOST_VERSION_MINOR "${boost_version_raw} / 100 % 1000") | ||
math(EXPR BOOST_VERSION_PATCH "${boost_version_raw} % 100") | ||
set(BOOST_VERSION "${BOOST_VERSION_MAJOR}.${BOOST_VERSION_MINOR}.${BOOST_VERSION_PATCH}") | ||
|
||
unset(boost_version_raw) | ||
unset(boost_version_file) |
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
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 |
---|---|---|
@@ -1,6 +1,16 @@ | ||
# Define the header-only Boost target | ||
add_library(Boost::boost INTERFACE IMPORTED GLOBAL) | ||
target_include_directories(Boost::boost SYSTEM INTERFACE ${BOOST_SOURCE}) | ||
|
||
# Disable autolink | ||
target_compile_definitions(Boost::boost INTERFACE BOOST_ALL_NO_LIB=1) | ||
|
||
if(BOOST_MODULARIZED) | ||
file(GLOB alllibs "${BOOST_SOURCE}/libs/*" "${BOOST_SOURCE}/libs/numeric/*") | ||
foreach(lib IN LISTS alllibs) | ||
if(IS_DIRECTORY "${lib}/include") | ||
target_include_directories(Boost::boost SYSTEM INTERFACE "${lib}/include") | ||
endif() | ||
endforeach() | ||
else() | ||
target_include_directories(Boost::boost SYSTEM INTERFACE ${BOOST_SOURCE}) | ||
endif() |