Skip to content

Commit

Permalink
Refactoring boost in cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
leoisl committed Jul 19, 2022
1 parent 3eb1833 commit 24b6aac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ jobs:
export BOOST_ROOT="/usr/local/opt/[email protected]"
mkdir build
cd build
cmake -DBOOST=1 -DNOOPENMP=1 -DSKIP_PYTHON=1 ..
cmake -DNOOPENMP=1 -DSKIP_PYTHON=1 ..
make
make test
12 changes: 4 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,10 @@ set(COBS_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS} ${COBS_INCLUDE_DIRS})
set(COBS_LINK_LIBRARIES ${ZLIB_LIBRARIES} ${COBS_LINK_LIBRARIES})

### check if we should use BOOST ###
if(BOOST)
if(DEFINED ENV{BOOST_INCLUDE_DIR} AND DEFINED ENV{BOOST_LIBRARY_DIR})
message(WARNING "NOT FINDING BOOST THROUGH CMAKE, USING ENV VARIABLES!")
else()
find_package(Boost 1.72.0 COMPONENTS system filesystem)
set(COBS_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COBS_INCLUDE_DIRS})
set(COBS_LINK_LIBRARIES ${Boost_LIBRARIES} ${COBS_LINK_LIBRARIES})
endif()
find_package(Boost 1.72.0 COMPONENTS system filesystem)
if(BOOST_FOUND)
set(COBS_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COBS_INCLUDE_DIRS})
set(COBS_LINK_LIBRARIES ${Boost_LIBRARIES} ${COBS_LINK_LIBRARIES})
add_compile_definitions(COBS_USE_BOOST)
else()
set(COBS_LINK_LIBRARIES stdc++fs ${COBS_LINK_LIBRARIES})
Expand Down

0 comments on commit 24b6aac

Please sign in to comment.