Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Examples

on:
push:
branches:
- master
pull_request:
branches:
- '*'
workflow_dispatch:

env:
CMLIB_VERSION: 1.1.0

jobs:
examples-linux:
strategy:
matrix:
image: [
"test_ubuntu:2404"
]
example: [
"example/executable",
"example/library",
"example/library-interface"
]

runs-on: ubuntu-latest
container:
image: ghcr.io/cmakelib/${{ matrix.image }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Run example - ${{ matrix.example }}
run: |
git config --global --add safe.directory "$(pwd)"
git remote set-url origin "${{ github.server_url }}/${{ github.repository }}"
git clone --branch "v${CMLIB_VERSION}" https://github.com/cmakelib/cmakelib.git
export CMLIB_DIR=$(pwd)/cmakelib
cd ${{ matrix.example }}
mkdir -p build
cd build
cmake ..
cmake --build .

examples-windows:
strategy:
matrix:
example: [
"example/executable",
"example/library",
"example/library-interface"
]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Run example - ${{ matrix.example }}
run: |
git config --global --add safe.directory "$(pwd)"
git remote set-url origin "${{ github.server_url }}/${{ github.repository }}"
git clone --branch "v$env:CMLIB_VERSION" https://github.com/cmakelib/cmakelib.git
$env:CMLIB_DIR = "$(pwd)/cmakelib"
cd ${{ matrix.example }}
mkdir build -ErrorAction SilentlyContinue
cd build
cmake ..
cmake --build . --config Debug

examples-macos:
strategy:
matrix:
example: [
"example/executable",
"example/library",
"example/library-interface"
]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Run example - ${{ matrix.example }}
run: |
git config --global --add safe.directory "$(pwd)"
git remote set-url origin "${{ github.server_url }}/${{ github.repository }}"
git clone --branch "v${CMLIB_VERSION}" https://github.com/cmakelib/cmakelib.git
export CMLIB_DIR=$(pwd)/cmakelib
cd ${{ matrix.example }}
mkdir -p build
cd build
cmake ..
cmake --build .
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
workflow_dispatch:

env:
CMLIB_VERSION: 1.0.0
CMLIB_VERSION: 1.1.0

jobs:
test_linux:
Expand Down
4 changes: 3 additions & 1 deletion example/library-interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ SET(CMAKE_INSTALL_RPATH $ORIGIN/../lib/)
#
FIND_PACKAGE(CMLIB COMPONENTS CMDEF)


IF(CMDEF_OS_WINDOWS)
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
ENDIF()

#
# Set global compile options only for C++ language
Expand Down
3 changes: 3 additions & 0 deletions example/library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ PROJECT(${CMAKE_PROJECT_NAME})
#
FIND_PACKAGE(CMLIB COMPONENTS CMDEF)

IF(CMDEF_OS_WINDOWS)
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
ENDIF()

#
# Set global compile options only for C++ language
Expand Down
Loading