-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
77 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,68 @@ | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/3rdparty/boost/) | ||
|
||
set(BOOST_FILESYSTEM_INCLUDE_DIRS | ||
${CMAKE_SOURCE_DIR}/3rdparty/boost/libs/filesystem/include | ||
${CMAKE_SOURCE_DIR}/3rdparty/boost/libs/assert/include | ||
${CMAKE_SOURCE_DIR}/3rdparty/boost/libs/config/include | ||
${CMAKE_SOURCE_DIR}/3rdparty/boost/libs/container_hash/include | ||
${CMAKE_SOURCE_DIR}/3rdparty/boost/libs/core/include | ||
${CMAKE_SOURCE_DIR}/3rdparty/boost/libs/detail/include | ||
${CMAKE_SOURCE_DIR}/3rdparty/boost/libs/io/include | ||
${CMAKE_SOURCE_DIR}/3rdparty/boost/libs/iterator/include | ||
${CMAKE_SOURCE_DIR}/3rdparty/boost/libs/smart_ptr/include | ||
${CMAKE_SOURCE_DIR}/3rdparty/boost/libs/system/include | ||
${CMAKE_SOURCE_DIR}/3rdparty/boost/libs/type_traits/include | ||
${CMAKE_SOURCE_DIR}/3rdparty/boost/libs/predef/include | ||
FetchContent_Declare( | ||
boost | ||
GIT_REPOSITORY https://github.com/boostorg/boost.git | ||
GIT_TAG boost-1.86.0 | ||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build/_deps/boost | ||
GIT_PROGRESS true | ||
GIT_SHALLOW true | ||
) | ||
|
||
set(BOOST_FILESYSTEM_LIBRARIES | ||
boost_assert | ||
boost_config | ||
boost_container_hash | ||
boost_core | ||
boost_detail | ||
boost_filesystem | ||
boost_io | ||
boost_iterator | ||
boost_predef | ||
boost_smart_ptr | ||
boost_system | ||
boost_type_traits | ||
) | ||
FetchContent_GetProperties(boost) | ||
if(NOT boost_POPULATED) | ||
FetchContent_Populate(boost) | ||
|
||
##EXCLUDE_FROM_ALL reject install for this target | ||
add_subdirectory(${boost_SOURCE_DIR} EXCLUDE_FROM_ALL) | ||
|
||
set(BOOST_FILESYSTEM_INCLUDE_DIRS | ||
${boost_SOURCE_DIR}/libs/filesystem/include | ||
${boost_SOURCE_DIR}/libs/assert/include | ||
${boost_SOURCE_DIR}/libs/config/include | ||
${boost_SOURCE_DIR}/libs/container_hash/include | ||
${boost_SOURCE_DIR}/libs/core/include | ||
${boost_SOURCE_DIR}/libs/detail/include | ||
${boost_SOURCE_DIR}/libs/io/include | ||
${boost_SOURCE_DIR}/libs/iterator/include | ||
${boost_SOURCE_DIR}/libs/smart_ptr/include | ||
${boost_SOURCE_DIR}/libs/system/include | ||
${boost_SOURCE_DIR}/libs/type_traits/include | ||
${boost_SOURCE_DIR}/libs/predef/include | ||
) | ||
|
||
set(BOOST_FILESYSTEM_LIBRARIES | ||
boost_assert | ||
boost_config | ||
boost_container_hash | ||
boost_core | ||
boost_detail | ||
boost_filesystem | ||
boost_io | ||
boost_iterator | ||
boost_predef | ||
boost_smart_ptr | ||
boost_system | ||
boost_type_traits | ||
) | ||
|
||
## will search for target with a particular prefix and will set destination folder | ||
function(set_target_dir _PREFIX DIR TARGET_DIR) | ||
get_property(TGTS DIRECTORY "${DIR}" PROPERTY BUILDSYSTEM_TARGETS) | ||
string (REGEX MATCHALL "(^|;)${_PREFIX}[A-Za-z0-9_]*" _matchedVars "${TGTS}") | ||
foreach (_var IN LISTS _matchedVars) | ||
if (TARGET ${_var}) | ||
set_target_properties(${_var} PROPERTIES FOLDER ${TARGET_DIR}) | ||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") | ||
else() | ||
target_compile_options(${_var} INTERFACE "-Wno-everything") | ||
endif() | ||
endif() | ||
endforeach() | ||
get_property(SUBDIRS DIRECTORY "${DIR}" PROPERTY SUBDIRECTORIES) | ||
foreach(SUBDIR IN LISTS SUBDIRS) | ||
set_target_dir("${_PREFIX}" "${SUBDIR}" "${TARGET_DIR}") | ||
endforeach() | ||
endfunction() | ||
|
||
## will serarhc for target with a particular prefix and will set destination folder | ||
function(set_target_dir _PREFIX DIR TARGET_DIR) | ||
get_property(TGTS DIRECTORY "${DIR}" PROPERTY BUILDSYSTEM_TARGETS) | ||
string (REGEX MATCHALL "(^|;)${_PREFIX}[A-Za-z0-9_]*" _matchedVars "${TGTS}") | ||
foreach (_var IN LISTS _matchedVars) | ||
if (TARGET ${_var}) | ||
set_target_properties(${_var} PROPERTIES FOLDER ${TARGET_DIR}) | ||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") | ||
#target_compile_options(${_var} PRIVATE "-Wno-everything") | ||
else() | ||
target_compile_options(${_var} PRIVATE "-Wno-everything") | ||
set_target_dir(boost . ${boost_SOURCE_DIR}/libs) | ||
endif() | ||
endif() | ||
endforeach() | ||
get_property(SUBDIRS DIRECTORY "${DIR}" PROPERTY SUBDIRECTORIES) | ||
foreach(SUBDIR IN LISTS SUBDIRS) | ||
set_target_dir("${_PREFIX}" "${SUBDIR}" "${TARGET_DIR}") | ||
endforeach() | ||
endfunction() | ||
|
||
set_target_dir(boost . 3rdparty/boost) |
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes