diff --git a/CMakeLists.txt b/CMakeLists.txt index 830aff5..de2b96d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,11 +2,9 @@ cmake_minimum_required(VERSION 3.12) project(Shell VERSION 1.0 LANGUAGES CXX) # Find and load CMake configuration of packages containing this plugin's dependencies -## Mandatory dependencies -find_package(SofaBase REQUIRED) # Dependency to SofaBaseVisual -## Optional dependencies -sofa_find_package(SofaGui) # Dependency to SofaGuiQt -sofa_find_package(Qt5 COMPONENTS Core) # Dependency to Qt5Core (needed for qt5_wrap_cpp) +find_package(Sofa.Component.Controller REQUIRED) +sofa_find_package(Sofa.Component.StateContainer REQUIRED) + # List all files set(SHELL_SRC_DIR src/Shell) @@ -19,29 +17,23 @@ set(HEADER_FILES ${SHELL_SRC_DIR}/engine/JoinMeshPoints.inl ${SHELL_SRC_DIR}/forcefield/TriangularBendingFEMForceField.h ${SHELL_SRC_DIR}/forcefield/TriangularBendingFEMForceField.inl - ) -set(HEADER_FILES_TO_MOC - ) +) set(SOURCE_FILES ${SHELL_SRC_DIR}/initShell.cpp ${SHELL_SRC_DIR}/controller/MeshChangedEvent.cpp ${SHELL_SRC_DIR}/controller/MeshInterpolator.cpp ${SHELL_SRC_DIR}/engine/JoinMeshPoints.cpp ${SHELL_SRC_DIR}/forcefield/TriangularBendingFEMForceField.cpp - ) +) set(README_FILES README.md - ) +) # Create the plugin library. -add_library(${PROJECT_NAME} SHARED ${HEADER_FILES_TO_MOC} ${MOCCED_HEADER_FILES} ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES}) +add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES}) # Link the plugin library to its dependency(ies). -target_link_libraries(${PROJECT_NAME} SofaBaseVisual SofaUserInteraction) -# Link with the optional GUI dependencies. -if(Qt5Core_FOUND AND SofaGui_FOUND) - target_link_libraries(${PROJECT_NAME} SofaGuiQt) -endif() +target_link_libraries(${PROJECT_NAME} Sofa.Component.Controller Sofa.Component.StateContainer) # Create package Config, Version & Target files. # Deploy the headers, resources, scenes & examples. @@ -55,11 +47,3 @@ sofa_create_package_with_targets( INCLUDE_INSTALL_DIR ${PROJECT_NAME} RELOCATABLE "plugins" ) - -# Tests -# If SOFA_BUILD_TESTS exists and is OFF, then these tests will be auto-disabled -cmake_dependent_option(SHELL_BUILD_TESTS "Compile the automatic tests" ON "SOFA_BUILD_TESTS OR NOT DEFINED SOFA_BUILD_TESTS" OFF) -if(SHELL_BUILD_TESTS) - enable_testing() - add_subdirectory(Shell_test) -endif() diff --git a/ShellConfig.cmake.in b/ShellConfig.cmake.in index 191b84e..63e71a6 100644 --- a/ShellConfig.cmake.in +++ b/ShellConfig.cmake.in @@ -3,17 +3,8 @@ @PACKAGE_GUARD@ @PACKAGE_INIT@ -set(SHELL_HAVE_SOFAGUI @SHELL_HAVE_SOFAGUI@) -set(SHELL_HAVE_QT5CORE @SHELL_HAVE_QT5CORE@) - -find_package(SofaBase QUIET REQUIRED) - -if(SHELL_HAVE_SOFAGUI) - find_package(SofaGui QUIET REQUIRED) -endif() -if(SHELL_HAVE_QT5CORE) - find_package(Qt5 COMPONENTS Core QUIET REQUIRED) -endif() +find_package(Sofa.Component.Controller QUIET REQUIRED) +find_package(Sofa.Component.StateContainer QUIET REQUIRED) if(NOT TARGET @PROJECT_NAME@) include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") diff --git a/Shell_test/CMakeLists.txt b/Shell_test/CMakeLists.txt deleted file mode 100644 index e209795..0000000 --- a/Shell_test/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# cmake_minimum_required(VERSION 3.12) - -# project(Shell_test) - -# # find_package(Shell REQUIRED) -# find_package(Threads REQUIRED) -# find_package(Sofa.Testing REQUIRED) - -# set(SOURCE_FILES -# ) - -# add_executable(${PROJECT_NAME} ${SOURCE_FILES}) -# target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Testing Shell Threads::Threads) - -# add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) diff --git a/src/Shell/forcefield/TriangularBendingFEMForceField.h b/src/Shell/forcefield/TriangularBendingFEMForceField.h index 258a586..8008f8f 100644 --- a/src/Shell/forcefield/TriangularBendingFEMForceField.h +++ b/src/Shell/forcefield/TriangularBendingFEMForceField.h @@ -21,11 +21,6 @@ ******************************************************************************/ #pragma once -#if !defined(__GNUC__) || (__GNUC__ > 3 || (_GNUC__ == 3 && __GNUC_MINOR__ > 3)) -#pragma once -#endif - - #include #include #include diff --git a/src/Shell/forcefield/TriangularBendingFEMForceField.inl b/src/Shell/forcefield/TriangularBendingFEMForceField.inl index 199d7ea..ded1b64 100644 --- a/src/Shell/forcefield/TriangularBendingFEMForceField.inl +++ b/src/Shell/forcefield/TriangularBendingFEMForceField.inl @@ -22,8 +22,6 @@ #pragma once #include -#include -#include #include #include // for reading the file #include //for debugging @@ -34,7 +32,6 @@ #include #include #include -#include #include #include @@ -49,7 +46,7 @@ namespace shell::forcefield { using namespace sofa::type; - using namespace sofa::component::topology; + // using namespace sofa::component::topology;