From 8213f47030c4650da1d1fc4d05a38aa63f5687bb Mon Sep 17 00:00:00 2001 From: Sandor Dargo Date: Thu, 10 Oct 2024 14:53:41 +0200 Subject: [PATCH] Small fix --- .github/workflows/all.yml | 17 ++++++----------- CMakeLists.txt | 12 +++++++++++- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index e68c2317..01272fb4 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -31,7 +31,7 @@ jobs: if: matrix.os == 'ubuntu-latest' id: boost shell: bash - run: | + run: | DEPS_DIR="${{ github.workspace }}/deps" BOOST_LIBRARIES="chrono,system,test" BOOST_VERSION="1.70.0" @@ -48,17 +48,11 @@ jobs: if: matrix.os == 'macos-latest' id: boost-macos shell: bash - run: | + run: | brew install boost export BOOST_ROOT=$(brew --prefix boost) echo "boost-root-dir=$BOOST_ROOT" >> "$GITHUB_OUTPUT" - - name: Verify Boost (MacOs) - if: matrix.os == 'macos-latest' - shell: bash - run: | - ls /opt/homebrew/opt/boost/lib - - name: Set build directory id: strings shell: bash @@ -76,9 +70,10 @@ jobs: if: matrix.os == 'macos-latest' run: > cmake -B ${{ steps.strings.outputs.build-output-dir }} - -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/boost" -DBoost_ROOT="/opt/homebrew/opt/boost" -DBOOST_LIBRARYDIR="/opt/homebrew/opt/boost/lib" - -S ${{ github.workspace }} - + -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/boost" -DBOOST_ROOT="/opt/homebrew/opt/boost" -DBoost_NO_BOOST_CMAKE=ON + -DBOOST_LIBRARYDIR="/opt/homebrew/opt/boost/lib" -DBoost_USE_STATIC_LIBS=OFF + -DBoost_USE_STATIC_RUNTIME=OFF -S ${{ github.workspace }} + - name: Build run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 1aa2c99d..cb6b1188 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,9 +12,19 @@ # License for the specific language governing permissions and limitations under # the License. -cmake_minimum_required(VERSION 3.15.0) +cmake_minimum_required(VERSION 3.21.0) project(spotify-json) +# Set policy for CMP0144 to enable upper-case BOOST_ROOT usage +if (POLICY CMP0144) + cmake_policy(SET CMP0144 NEW) +endif() + +# Set policy for CMP0167 to rely on BoostConfig.cmake rather than FindBoost +if (POLICY CMP0167) + cmake_policy(SET CMP0167 NEW) +endif() + set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON)