Skip to content

Commit

Permalink
Applying cmake-format to Boost setup file
Browse files Browse the repository at this point in the history
Signed-off-by: Vedant <[email protected]>
  • Loading branch information
vrnimje committed Jan 23, 2024
1 parent 0b69e30 commit 0287f31
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions cmake/HPX_SetupBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,58 @@
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

if (HPX_WITH_FETCH_BOOST)
if(HPX_WITH_FETCH_BOOST)
set(HPX_WITH_BOOST_VERSION "1.84.0")
hpx_info(
"HPX_WITH_FETCH_BOOST=${HPX_WITH_FETCH_BOOST}, Boost v${HPX_WITH_BOOST_VERSION} will be fetched using CMake's FetchContent"
)
include(FetchContent)
FetchContent_Declare(Boost
URL https://github.com/boostorg/boost/releases/download/boost-${HPX_WITH_BOOST_VERSION}/boost-${HPX_WITH_BOOST_VERSION}.tar.gz
TLS_VERIFY true
fetchcontent_declare(
Boost
URL https://github.com/boostorg/boost/releases/download/boost-${HPX_WITH_BOOST_VERSION}/boost-${HPX_WITH_BOOST_VERSION}.tar.gz
TLS_VERIFY true
)
FetchContent_Populate(Boost)
fetchcontent_populate(Boost)

set(EX_PRC "Execute process" CACHE STRING "Used by command line tool.")
set(EX_PRC_INTERNAL "" CACHE INTERNAL "for internal use only; do not modify")
set(EX_PRC
"Execute process"
CACHE STRING "Used by command line tool."
)
set(EX_PRC_INTERNAL
""
CACHE INTERNAL "for internal use only; do not modify"
)

if(NOT EX_PRC STREQUAL EX_PRC_INTERNAL)
if(WIN32)
execute_process(COMMAND cmd /C "cd ${CMAKE_BINARY_DIR}\\_deps\\boost-src && .\\bootstrap.bat && .\\b2 headers cxxflags=/std:c++20" )
execute_process(
COMMAND
cmd /C
"cd ${CMAKE_BINARY_DIR}\\_deps\\boost-src && .\\bootstrap.bat && .\\b2 headers cxxflags=/std:c++20"
)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
hpx_info("Building fetched boost")
execute_process(COMMAND sh -c "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed && ./b2 && ./b2 install --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed cxxflags=--std=c++20")
execute_process(
COMMAND
sh -c
"cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed && ./b2 && ./b2 install --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed cxxflags=--std=c++20"
)
else()
execute_process(COMMAND sh -c "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++20" )
execute_process(
COMMAND
sh -c
"cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++20"
)
endif()
set(EX_PRC_INTERNAL ${EX_PRC} CACHE INTERNAL "for internal use only; do not modify")
set(EX_PRC_INTERNAL
${EX_PRC}
CACHE INTERNAL "for internal use only; do not modify"
)
endif()

set(Boost_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src")
set(Boost_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src")
endif()
endif()
endif()

# In case find_package(HPX) is called multiple times
Expand Down

0 comments on commit 0287f31

Please sign in to comment.