-
Notifications
You must be signed in to change notification settings - Fork 35
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 #134 from robotology/devel
Merge devel in master and release 1.23.0
- Loading branch information
Showing
26 changed files
with
4,308 additions
and
2,945 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,107 @@ | ||
name: C++ CI Workflow | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
# Execute a "nightly" build at 2 AM UTC | ||
- cron: '0 2 * * *' | ||
|
||
jobs: | ||
build-with-conda-dependencies: | ||
name: '[conda:${{ matrix.os }}]' | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
build_type: [Release] | ||
os: [ubuntu-20.04, macos-10.15, windows-2019] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
channels: conda-forge | ||
|
||
- name: Dependencies [Conda] | ||
shell: bash -l {0} | ||
run: | | ||
# Workaround for https://github.com/conda-incubator/setup-miniconda/issues/186 | ||
conda config --remove channels defaults | ||
# Compilation related dependencies | ||
mamba install cmake compilers make ninja pkg-config | ||
- name: Print used environment [Conda] | ||
shell: bash -l {0} | ||
run: | | ||
mamba list | ||
env | ||
- name: Configure [Conda/Linux&macOS] | ||
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') | ||
shell: bash -l {0} | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} .. | ||
- name: Configure [Conda/Windows] | ||
if: contains(matrix.os, 'windows') | ||
shell: bash -l {0} | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -G"Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}/Library -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. | ||
- name: Build [Conda] | ||
shell: bash -l {0} | ||
run: | | ||
cd build | ||
cmake --build . --config ${{ matrix.build_type }} | ||
build-with-system-dependencies: | ||
name: '[${{ matrix.os }}@${{ matrix.build_type }}]' | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
build_type: [Release] | ||
os: [ubuntu-18.04, ubuntu-20.04, macOS-10.15] | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
|
||
# Print environment variables to simplify development and debugging | ||
- name: Environment Variables | ||
shell: bash | ||
run: env | ||
|
||
# ============ | ||
# DEPENDENCIES | ||
# ============ | ||
|
||
- name: Dependencies [macOS] | ||
run: | | ||
brew install cmake | ||
# =================== | ||
# CMAKE-BASED PROJECT | ||
# =================== | ||
|
||
- name: Configure [Ubuntu/macOS] | ||
shell: bash | ||
run: | | ||
mkdir -p build | ||
cd build | ||
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install .. | ||
- name: Build | ||
shell: bash | ||
run: | | ||
cd build | ||
cmake --build . --config ${{ matrix.build_type }} | ||
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
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
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
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,73 @@ | ||
# Copyright (C) 2022 Istituto Italiano di Tecnologia (IIT). All rights reserved. | ||
# This software may be modified and distributed under the terms of the | ||
# GNU Lesser General Public License v2.1 or any later version. | ||
|
||
if(ICUB_MODELS_COMPILE_PYTHON_BINDINGS) | ||
|
||
find_package(pybind11 REQUIRED) | ||
find_package(Python3 COMPONENTS Interpreter REQUIRED) | ||
|
||
|
||
# define new line accordingly to the operating system | ||
if (WIN32) | ||
set(NEW_LINE "\n\r") | ||
else() | ||
set(NEW_LINE "\n") | ||
endif() | ||
|
||
option(ICUB_MODELS_DETECT_ACTIVE_PYTHON_SITEPACKAGES | ||
"Do you want icub-models to detect and use the active site-package directory? (it could be a system dir)" | ||
FALSE) | ||
|
||
# Install the resulting Python package for the active interpreter | ||
if(ICUB_MODELS_DETECT_ACTIVE_PYTHON_SITEPACKAGES) | ||
set(PYTHON_INSTDIR ${Python3_SITELIB}/icub_models) | ||
else() | ||
execute_process(COMMAND ${Python3_EXECUTABLE} -c "from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,prefix=''))" | ||
OUTPUT_VARIABLE _PYTHON_INSTDIR) | ||
|
||
string(STRIP ${_PYTHON_INSTDIR} _PYTHON_INSTDIR_CLEAN) | ||
set(PYTHON_INSTDIR ${_PYTHON_INSTDIR_CLEAN}/icub_models) | ||
endif() | ||
|
||
# Folder of the Python package within the build tree. | ||
# It is used for the Python tests. | ||
set(ICUB_MODELS_PYTHON_PACKAGE "${CMAKE_BINARY_DIR}/icub_models") | ||
|
||
# Add the bindings directory | ||
add_subdirectory(python) | ||
|
||
# Create the __init__.py file | ||
file(GENERATE | ||
OUTPUT "${ICUB_MODELS_PYTHON_PACKAGE}/__init__.py" | ||
CONTENT "from icub_models.bindings import *") | ||
|
||
# Install the __init__.py file | ||
install(FILES "${ICUB_MODELS_PYTHON_PACKAGE}/__init__.py" | ||
DESTINATION ${PYTHON_INSTDIR}) | ||
|
||
# Install pip metadata files to ensure that icub_models installed via CMake is listed by pip list | ||
# See https://packaging.python.org/specifications/recording-installed-packages/ | ||
# and https://packaging.python.org/en/latest/specifications/core-metadata/#core-metadata | ||
option(ICUB_MODELS_PYTHON_PIP_METADATA_INSTALL "Use CMake to install Python pip metadata. Set to off if some other tool already installs it." ON) | ||
mark_as_advanced(ICUB_MODELS_PYTHON_PIP_METADATA_INSTALL) | ||
set(ICUB_MODELS_PYTHON_PIP_METADATA_INSTALLER "cmake" CACHE STRING "Specify the string to identify the pip Installer. Default: cmake, change this if you are using another tool.") | ||
mark_as_advanced(ICUB_MODELS_PYTHON_PIP_METADATA_INSTALLER) | ||
if(ICUB_MODELS_PYTHON_PIP_METADATA_INSTALL) | ||
get_filename_component(PYTHON_METADATA_PARENT_DIR ${PYTHON_INSTDIR} DIRECTORY) | ||
if(WIN32) | ||
set(NEW_LINE "\n\r") | ||
else() | ||
set(NEW_LINE "\n") | ||
endif() | ||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/METADATA "") | ||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/METADATA "Metadata-Version: 2.1${NEW_LINE}") | ||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/METADATA "Name: icub-models${NEW_LINE}") | ||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/METADATA "Version: ${PROJECT_VERSION}${NEW_LINE}") | ||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/INSTALLER "${ICUB_MODELS_PYTHON_PIP_METADATA_INSTALLER}${NEW_LINE}") | ||
install( | ||
FILES "${CMAKE_CURRENT_BINARY_DIR}/METADATA" "${CMAKE_CURRENT_BINARY_DIR}/INSTALLER" | ||
DESTINATION ${PYTHON_METADATA_PARENT_DIR}/icub_models-${PROJECT_VERSION}.dist-info) | ||
endif() | ||
|
||
endif() |
Oops, something went wrong.