Skip to content

Commit

Permalink
cmake: set CMP0074 policy
Browse files Browse the repository at this point in the history
This enables the use of `<PackageName>_ROOT` (environment) variables.
  • Loading branch information
sergiud committed Dec 6, 2021
1 parent f4dd77a commit dcef9dc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ jobs:
build-android:
name: NDK-C++${{matrix.std}}-${{matrix.abi}}-${{matrix.build_type}}
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: true
matrix:
Expand All @@ -22,7 +25,6 @@ jobs:
version: 1.10.0

- name: Configure
shell: bash
run: |
cmake -S . -B build_${{matrix.abi}} \
-DANDROID_ABI=${{matrix.abi}} \
Expand All @@ -33,7 +35,8 @@ jobs:
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
-G Ninja
-G Ninja \
-Werror
- name: Build
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ jobs:
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install \
-DWITH_CUSTOM_PREFIX=${{matrix.extra == 'custom-prefix'}} \
-G Ninja
-G Ninja \
-Werror
- name: Build
run: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ jobs:
CXXFLAGS: -Wall -Wextra -Wsign-conversion -Wtautological-compare -Werror ${{env.CXXFLAGS}}
run: |
cmake -S . -B build_${{matrix.build_type}} \
-G "${{matrix.generator}}" \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCMAKE_CXX_FLAGS_DEBUG=-pedantic-errors \
-DCMAKE_CXX_FLAGS_RELEASE=-pedantic-errors \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCMAKE_CXX_STANDARD_REQUIRED=ON
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-G "${{matrix.generator}}" \
-Werror
- name: Build
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ jobs:
-DCMAKE_CXX_STANDARD_REQUIRED=ON `
-DCMAKE_INSTALL_PREFIX:PATH=./install `
-DWITH_CUSTOM_PREFIX=${{matrix.extra == 'custom-prefix'}} `
-G "${{matrix.generator}}"
-G "${{matrix.generator}}" `
-Werror
- name: Build
run: cmake --build build_${{matrix.build_type}} `
Expand Down Expand Up @@ -112,7 +113,8 @@ jobs:
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_INSTALL_PREFIX:PATH=./install \
-DWITH_CUSTOM_PREFIX=${{matrix.extra == 'custom-prefix'}} \
-G Ninja
-G Ninja \
-Werror
- name: Build
run: |
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ if (POLICY CMP0063)
cmake_policy (SET CMP0063 NEW)
endif (POLICY CMP0063)

if (POLICY CMP0074)
cmake_policy (SET CMP0074 NEW)
endif (POLICY CMP0074)

project(glog VERSION 0.6.0 LANGUAGES CXX)

set (CPACK_PACKAGE_NAME glog)
Expand Down

0 comments on commit dcef9dc

Please # to comment.