Skip to content

Commit a579d22

Browse files
fredroyguparan
andauthored
Compilation without Compatibility Layer from SOFA (#268)
* make it compile wo compat * fix tests & co * fix tests & co 2 * fix tests & co 3 * remove unnecessary inits * replace collision response string in scenes * correct indentation (use spaces instead of tabs) * add v2206 compilation for GA CI * apply suggestions (edit cmake.in files to reflect changes) * Update Bindings.SofaRuntimeConfig.cmake.in Co-authored-by: Guillaume Paran <guillaume.paran@sofa-framework.org>
1 parent 3bec75d commit a579d22

60 files changed

Lines changed: 161 additions & 189 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
os: [ubuntu-20.04, macos-10.15, windows-2019]
22-
sofa_branch: [master]
22+
sofa_branch: [master, v22.06]
2323
python_version: ['3.8']
2424

2525
steps:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)
22

33
project(SofaPython3 VERSION 20.12.00)
44

5-
find_package(SofaFramework REQUIRED)
5+
find_package(Sofa.Config REQUIRED)
66

77
# Detect if SofaPython3 is a subproject of another project (eg. when compiled within Sofa)
88
if (NOT "${CMAKE_PROJECT_NAME}" STREQUAL "${PROJECT_NAME}")

Plugin/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,14 @@ if(SP3_BUILD_TEST)
4040
endif(SP3_BUILD_TEST)
4141

4242
find_package(pybind11 CONFIG REQUIRED)
43-
find_package(SofaFramework REQUIRED)
44-
find_package(SofaSimulationGraph REQUIRED)
43+
find_package(Sofa.Simulation.Graph REQUIRED)
4544

4645
add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})
4746
add_library(SofaPython3::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
4847

4948
target_compile_definitions(${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_SOFAPYTHON3")
5049

51-
target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Core Sofa.DefaultType Sofa.SimulationCore SofaSimulationGraph Sofa.Helper)
50+
target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Graph)
5251
target_link_libraries(${PROJECT_NAME} PUBLIC pybind11::module pybind11::embed)
5352

5453
if(SP3_BUILD_TEST AND Sofa.Testing_FOUND)

Plugin/PluginConfig.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
set(SP3_BUILD_TEST @SP3_BUILD_TEST@)
77

88
find_package(pybind11 QUIET REQUIRED CONFIG)
9-
find_package(SofaFramework QUIET REQUIRED)
10-
find_package(SofaSimulationGraph QUIET REQUIRED)
9+
find_package(Sofa.Simulation.Graph QUIET REQUIRED)
10+
1111
if(SP3_BUILD_TEST)
1212
find_package(Sofa.Testing QUIET REQUIRED)
1313
endif()

Plugin/src/SofaPython3/Prefab.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
******************************************************************************/
2020

2121
#pragma once
22-
#include <SofaSimulationGraph/DAGNode.h>
22+
#include <sofa/simulation/graph/DAGNode.h>
2323
#include <sofa/core/objectmodel/DataCallback.h>
2424

2525
#include <sofa/helper/system/FileMonitor.h>

Plugin/src/SofaPython3/PythonFactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <SofaPython3/PythonFactory.h>
2323
#include <SofaPython3/DataHelper.h>
2424

25-
#include <SofaSimulationGraph/DAGNode.h>
25+
#include <sofa/simulation/graph/DAGNode.h>
2626

2727
#include "sofa/simulation/AnimateBeginEvent.h"
2828
using sofa::simulation::AnimateBeginEvent;

Plugin/src/SofaPython3/PythonTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace py = pybind11;
3232
#include <sofa/helper/system/PluginManager.h>
3333
using sofa::helper::system::PluginManager;
3434

35-
#include <SofaSimulationGraph/SimpleApi.h>
35+
#include <sofa/simulation/graph/SimpleApi.h>
3636
namespace simpleapi=sofa::simpleapi;
3737

3838
#include <sofa/helper/system/SetDirectory.h>

Plugin/src/SofaPython3/SceneLoaderPY3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <sstream>
2222
#include <fstream>
2323

24-
#include <SofaSimulationGraph/DAGNode.h>
24+
#include <sofa/simulation/graph/DAGNode.h>
2525
using sofa::simulation::graph::DAGNode;
2626

2727
#include <SofaPython3/PythonEnvironment.h>

Plugin/src/SofaPython3/initModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using sofapython3::PythonEnvironment;
2727
#include <sofa/defaulttype/init.h>
2828
#include <sofa/simulation/init.h>
2929
#include <sofa/helper/init.h>
30-
#include <SofaSimulationGraph/init.h>
30+
#include <sofa/simulation/graph/init.h>
3131

3232
extern "C" {
3333

bindings/Modules/Bindings.ModulesConfig.cmake.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
find_package(SofaPython3 QUIET REQUIRED COMPONENTS Plugin Bindings.Sofa)
77

88
# Required by Bindings.Modules.SofaBaseTopology
9-
find_package(SofaBaseTopology QUIET REQUIRED)
9+
find_package(Sofa.Component.Topology.Container.Grid QUIET REQUIRED)
10+
1011
# Required by Bindings.Modules.SofaDeformable
11-
find_package(SofaDeformable QUIET REQUIRED)
12+
find_package(Sofa.Component.SolidMechanics.Spring QUIET REQUIRED)
13+
1214
# Required by Bindings.Modules.SofaLinearSolver
13-
find_package(Sofa.Component.LinearSolver.Iterative REQUIRED)
15+
find_package(Sofa.Component.LinearSolver.Iterative QUIET REQUIRED)
1416

1517
# If we are importing this config file and the target is not yet there this is indicating that
1618
# target is an imported one. So we include it

0 commit comments

Comments
 (0)