-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (72 loc) · 2.9 KB
/
cmake-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Windows
on:
push:
paths-ignore:
- '.github/scripts/**'
- '.github/workflows/update-readme.yml'
- '*.md'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
GITHUB_WORKFLOW: Windows
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["windows-2019"]
python-version: ["3.7.9"]
steps:
- uses: actions/checkout@v3
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/environment.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
environment-file: .github/environment.yml
activate-environment: tracking
python-version: ${{ matrix.python-version }}
channels: main
auto-activate-base: true
auto-update-conda: true
use-only-tar-bz2: true
- name: Build
shell: powershell
working-directory: ${{runner.workspace}}
run: |
echo "::group::Info"
conda info
conda list
echo Workspace: $GITHUB_WORKSPACE
ls $GITHUB_WORKSPACE/*
cd "D:/a/commons/commons"
ls
$python_exe=$( python -c "from shutil import which; print(which('python'))" )
$pythoninclude=$( python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())" )
$findlib=$( python find_library.py )
echo "python_exe = ${python_exe}"
echo "findlib = ${findlib}"
echo "pythoninclude = ${pythoninclude}"
echo "::endgroup::"
echo "::group::BUILD"
mkdir build
cd build
git submodule update --init --recursive
cmake .. -G "Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE" -DPYTHON_INCLUDE_DIR:FILEPATH=$pythoninclude -DPYTHON_LIBRARY:FILEPATH=$findlib -DPYTHON_EXECUTABLE:FILEPATH=$python_exe -DWITH_PYLON=OFF -DCOMMONS_BUILD_OPENCV=ON -DCOMMONS_BUILD_PNG=ON -DCOMMONS_BUILD_ZIP=ON -DCOMMONS_BUILD_GLFW=ON -DCOMMONS_BUILD_ZLIB=ON -DCMAKE_BUILD_TYPE=Release
cmake --build . --target Z_LIB --config Release
cmake --build . --target libzip --config Release
cmake --build . --target libpng_custom --config Release
cmake --build . --target CustomOpenCV --config Release
cmake ..
cmake --build . --target INSTALL --config Release
echo "::endgroup::"