Skip to content
Open
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
34 changes: 8 additions & 26 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ jobs:
- name: Install prerequisites
run: |
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
gcc g++ cmake libzip-dev libpugixml-dev
gcc g++ cmake unzip libpugixml-dev

- name: Configure and build
run: |
cmake . -B build -DFMI4CPP_BUILD_TESTS=ON -DFMI4CPP_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release
cmake . -B build -DFMI4CPP_BUILD_TESTS=ON -DFMI4CPP_USE_EXTERNAL_PUGIXML=ON -DFMI4CPP_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build

- name: Test
run: |
cd build/tests && ctest
cd build/tests && ctest --output-on-failure


vcpkg-on-linux:
Expand All @@ -45,23 +45,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Restore artifacts, or run vcpkg, build (and cache artifacts as post step)
uses: lukka/run-vcpkg@v10
id: runvcpkg
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgGitCommitId: '4cac260c4b7331538d31886f57739fea0bffa27e'
vcpkgJsonGlob: 'vcpkg.json'
appendedCacheKey: vcpkginstall

- name: Configure and build
run: |
cmake . -B build -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DFMI4CPP_BUILD_TESTS=ON -DFMI4CPP_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release
cmake . -B build -DFMI4CPP_BUILD_TESTS=ON -DFMI4CPP_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build

- name: Test
run: |
cd build/tests && ctest
cd build/tests && ctest --output-on-failure


vcpkg-on-windows:
Expand All @@ -75,22 +66,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Restore artifacts, or run vcpkg, build (and cache artifacts as post step)
uses: lukka/run-vcpkg@v10
id: runvcpkg
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgGitCommitId: '4cac260c4b7331538d31886f57739fea0bffa27e'
vcpkgJsonGlob: 'vcpkg.json'
appendedCacheKey: vcpkginstall

- name: Configure and build
run: |
cmake . -B build -A x64 -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DFMI4CPP_BUILD_TESTS=ON -DFMI4CPP_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release
cmake . -B build -A x64 -DFMI4CPP_BUILD_TESTS=ON -DFMI4CPP_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
shell: bash

- name: Test
run: |
cd build/tests && ctest -C Release
shell: bash
cd build/tests && ctest -C Release --output-on-failure
shell: pwsh
16 changes: 13 additions & 3 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
### BUILDING

For building FMI4cpp, you can use either `vcpkg` or `apt-get` for getting the required dependencies.
FMI4cpp does not need any additional dependencies. For unzipping in depends on system tools.
This should be available on Windows, on linux you might need to install `unzip``.

##### vcpkg
```bash
Linux:~/$ sudo apt-get install unzip
```

For XML handling, it ships with a version of pugiXML. If you want to use an external version then pass
`-DFMI4CPP_USE_EXTERNAL_PUGIXML=ON` to CMake.

#### External pgiXML (Optional)
To get an external pugiXML version you may use `vcpkg` or `apt-get`.

##### vcpkg
Call CMake with `-DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake`

##### apt-get

```bash
Linux:~/$ sudo apt-get install libzip-dev libpugixml-dev
Linux:~/$ sudo apt-get install libpugixml-dev
```

### Running examples/tests
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ message("Current fmi4cpp version: ${projectVersion}\n")

option(FMI4CPP_BUILD_TESTS "Build tests" OFF)
option(FMI4CPP_BUILD_EXAMPLES "Build examples" OFF)
option(FMI4CPP_USE_EXTERNAL_PUGIXML "Use external pugiXML" OFF)
option(BUILD_SHARED_LIBS "Build shared libraries instead of static libraries" ON)

set(FMI4CPP_LOG_LEVEL "DEFAULT" CACHE STRING "FMI4cpp logging level")
Expand Down Expand Up @@ -54,8 +55,9 @@ set(FMI4CPP_EXPORT_TARGET "${PROJECT_NAME}-targets")
# Dependencies
# ==============================================================================

find_package(LIBZIP REQUIRED)
find_package(PugiXML REQUIRED)
if (FMI4CPP_USE_EXTERNAL_PUGIXML)
find_package(PugiXML REQUIRED)
endif ()

if (FMI4CPP_BUILD_TESTS)

Expand Down Expand Up @@ -124,7 +126,6 @@ install(FILES "${versionFile}" DESTINATION "${FMI4CPP_CMAKE_INSTALL_DIR}")

# Install custom find modules
install(FILES
${PROJECT_SOURCE_DIR}/cmake/FindLIBZIP.cmake
${PROJECT_SOURCE_DIR}/cmake/FindPugiXML.cmake
DESTINATION
${FMI4CPP_CMAKE_INSTALL_DIR}
Expand Down
110 changes: 0 additions & 110 deletions cmake/FindLIBZIP.cmake

This file was deleted.

Loading
Loading