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
4 changes: 2 additions & 2 deletions Plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ set(SOURCE_FILES
)

find_package(pybind11 CONFIG REQUIRED)
sofa_find_package(Sofa.Simulation.Graph REQUIRED)
sofa_find_package(Sofa.Simulation.Common REQUIRED)

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

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

target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Graph)
target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Common)
target_link_libraries(${PROJECT_NAME} PUBLIC pybind11::module pybind11::embed)

set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME SofaPython3)
Expand Down
2 changes: 1 addition & 1 deletion Plugin/src/SofaPython3/SceneLoaderPY3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ bool SceneLoaderPY3::syntaxForAddingRequiredPlugin(const std::string& pluginName

sofa::simulation::Node::SPtr SceneLoaderPY3::doLoad(const std::string& filename, const std::vector<std::string>& sceneArgs)
{
if (sofa::simulation::Simulation* simulation = sofa::simulation::getSimulation())
if (sofa::simulation::Simulation* simulation = sofa::simulation::MainSimulation::getSimulation())
{
sofa::simulation::Node::SPtr root = simulation->createNewNode("root");
loadSceneWithArguments(filename.c_str(), sceneArgs, root);
Expand Down
2 changes: 0 additions & 2 deletions Plugin/src/SofaPython3/initModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ using sofapython3::PythonEnvironment;
#include <sofa/defaulttype/init.h>
#include <sofa/simulation/init.h>
#include <sofa/helper/init.h>
#include <sofa/simulation/graph/init.h>

extern "C" {

Expand All @@ -50,7 +49,6 @@ void initExternalModule()
sofa::defaulttype::init();
sofa::core::init();
sofa::simulation::core::init();
sofa::simulation::graph::init();

PythonEnvironment::Init();
first = false;
Expand Down
4 changes: 2 additions & 2 deletions bindings/Sofa/src/SofaPython3/Sofa/Simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (NOT TARGET SofaPython3::Plugin)
sofa_find_package(SofaPython3 REQUIRED COMPONENTS Plugin)
endif()

sofa_find_package(Sofa.Simulation.Graph REQUIRED)
sofa_find_package(Sofa.Simulation.Common REQUIRED)

SP3_add_python_module(
TARGET ${PROJECT_NAME}
Expand All @@ -27,5 +27,5 @@ SP3_add_python_module(
DESTINATION Sofa
SOURCES ${SOURCE_FILES}
HEADERS ${HEADER_FILES}
DEPENDS Sofa.Simulation.Graph SofaPython3::Plugin
DEPENDS Sofa.Simulation.Common SofaPython3::Plugin
)
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ using sofa::simulation::Simulation;
#include <sofa/core/init.h>
#include <sofa/simulation/init.h>
#include <sofa/simulation/common/init.h>
#include <sofa/simulation/graph/init.h>
#include <sofa/simulation/SceneCheckerVisitor.h>
#include <sofa/simulation/SceneCheckMainRegistry.h>
#include <sofa/helper/system/PluginManager.h>
Expand Down Expand Up @@ -82,7 +81,6 @@ PYBIND11_MODULE(Simulation, simulation)
// These are needed to force the dynamic loading of module dependencies (found in CMakeLists.txt)
sofa::core::init();
sofa::simulation::core::init();
sofa::simulation::graph::init();

simulation.doc() =sofapython3::doc::simulation::Class;

Expand Down Expand Up @@ -135,7 +133,6 @@ PYBIND11_MODULE(Simulation, simulation)

sofa::simulation::core::cleanup();
sofa::simulation::common::cleanup();
sofa::simulation::graph::cleanup();

msg_info("SofaPython3.Simulation") << "Sofa.Simulation unload()";
}));
Expand Down
4 changes: 2 additions & 2 deletions bindings/SofaRuntime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/SofaPython3/SofaRuntime/Timer/Submodule_Timer_doc.h
)

sofa_find_package(Sofa.Simulation.Graph REQUIRED)
sofa_find_package(Sofa.Simulation.Common REQUIRED)

SP3_add_python_package(
SOURCE_DIRECTORY
Expand All @@ -27,7 +27,7 @@ SP3_add_python_module(
DESTINATION SofaRuntime
SOURCES ${SOURCE_FILES}
HEADERS ${HEADER_FILES}
DEPENDS Sofa.Simulation.Graph SofaPython3::Plugin SofaPython3::Bindings.Sofa.Core
DEPENDS Sofa.Simulation.Common SofaPython3::Plugin SofaPython3::Bindings.Sofa.Core
)

sofa_create_component_in_package_with_targets(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ using sofapython3::SceneLoaderPY3;
#include <sofa/helper/BackTrace.h>

#include <sofa/simulation/common/init.h>
#include <sofa/simulation/graph/init.h>

#include "Timer/Submodule_Timer.h"

Expand Down
Loading