forked from SAP-archive/fedem-solvers
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from kmokstad/build-fmu
Build FMU on Linux and Win
- Loading branch information
Showing
4 changed files
with
229 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# SPDX-FileCopyrightText: 2023 SAP SE | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# This file is part of FEDEM - https://openfedem.org | ||
|
||
name: Regression testing | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-linux: | ||
name: Build FMU for Linux | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Silence some advice and hint | ||
run: | | ||
git config --global advice.detachedHead false | ||
git config --global init.defaultBranch main | ||
- name: Check out source repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Configure main build | ||
run: cmake -B ./build -DCMAKE_BUILD_TYPE=Release | ||
|
||
- name: Build FMU library | ||
run: cmake --build ./build --target fedem_fmu | ||
|
||
build-linux: | ||
name: Build FMU for Windows | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Silence some advice and hint | ||
run: | | ||
git config --global advice.detachedHead false | ||
git config --global init.defaultBranch main | ||
- name: Check out source repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Configure main build | ||
run: cmake -B ./build -G "Visual Studio 17 2022" | ||
|
||
- name: Build FMU library | ||
run: cmake --build ./build --target fedem_fmu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
cmake_minimum_required ( VERSION 2.8...3.5 ) | ||
if ( POLICY CMP0076 ) | ||
cmake_policy ( SET CMP0076 NEW ) # convert relative target source path names | ||
endif ( POLICY CMP0076 ) | ||
|
||
# Project setup | ||
|
||
set ( APPLICATION_ID fedemFMU ) | ||
set ( DOMAIN_ID FEDEM ) | ||
set ( PACKAGE_ID SOLVERS ) | ||
|
||
project ( ${APPLICATION_ID} CXX ) | ||
message ( STATUS "Generating build project for ${PROJECT_SOURCE_DIR}" ) | ||
get_filename_component ( PARENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY ) | ||
|
||
find_path ( _MODULES FedemConfig.cmake | ||
PATHS $ENV{CMAKE_MODULES} | ||
"${PARENT_SOURCE_DIR}/fedem-foundation/cmake/Modules/" | ||
) | ||
if ( _MODULES ) | ||
message ( STATUS "NOTE : Using ${_MODULES}" ) | ||
list ( APPEND CMAKE_MODULE_PATH ${_MODULES} ) | ||
else ( _MODULES ) | ||
message ( STATUS "ERROR : Missing path to FedemConfig.cmake" ) | ||
message ( FATAL_ERROR "Set environment variable CMAKE_MODULES and try again" ) | ||
endif ( _MODULES ) | ||
unset ( _MODULES CACHE ) | ||
|
||
include ( FedemConfig ) | ||
|
||
add_custom_target ( all_solvers ) | ||
add_subdirectory ( ../src/FMU "${CMAKE_CURRENT_BINARY_DIR}/src" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.