Skip to content

Commit

Permalink
Update further to removal of SofaTest (#1)
Browse files Browse the repository at this point in the history
* Update further to removal of SofaTest

* Fix compilation

* missing Sofa.Simulation.Core dep

* fix deps

* update ga

* fix deps (2) + fix cmake.in

* replace ga v21.12 with v22.06

Co-authored-by: Frederick Roy <[email protected]>
  • Loading branch information
hugtalbot and fredroy authored Jun 24, 2022
1 parent 66793f2 commit 9543fa7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-10.15, windows-2019]
sofa_branch: [master, v21.12]
sofa_branch: [master, v22.06]

steps:
- name: Setup SOFA and environment
id: sofa
uses: sofa-framework/sofa-setup-action@v3.0
uses: sofa-framework/sofa-setup-action@v4
with:
sofa_root: ${{ github.workspace }}/sofa
sofa_version: ${{ matrix.sofa_branch }}
Expand Down
7 changes: 4 additions & 3 deletions CGALPluginConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

set(CGALPLUGIN_HAVE_IMAGE @CGALPLUGIN_HAVE_IMAGE@)

find_package(SofaFramework REQUIRED)
find_package(SofaSimulationCommon REQUIRED)
find_package(image REQUIRED)
find_package(Sofa.Simulation.Common QUIET REQUIRED)
find_package(Sofa.Component.Mass QUIET REQUIRED)
find_package(Sofa.Component.MechanicalLoad QUIET REQUIRED)
find_package(CGAL QUIET REQUIRED)

if(CGALPLUGIN_HAVE_IMAGE)
find_package(image QUIET REQUIRED)
find_package(CGAL QUIET REQUIRED COMPONENTS ImageIO)
endif()

Expand Down
10 changes: 5 additions & 5 deletions CGALPlugin_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ cmake_minimum_required(VERSION 3.12)

project(CGALPlugin_test)


set(HEADER_FILES

)

set(SOURCE_FILES
# MeshGenerationFromImage_test.cpp
)

find_package(SofaTest REQUIRED)
find_package(Sofa.Testing REQUIRED)
find_package(image QUIET)

if(image_FOUND)
find_package(Sofa.Component.StateContainer REQUIRED)
find_package(SceneCreator REQUIRED)

list(APPEND SOURCE_FILES MeshGenerationFromImage_test.cpp)

# IMPORTANT NOTICE:
# the following 4 lines must be put outside of the "if" section as soon as there is another source file added to the project
add_definitions("-DSOFACGAL_TEST_RESOURCES_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/../scenes/data/\"")
add_executable(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} CGALPlugin SofaTest SofaGTestMain)
target_link_libraries(${PROJECT_NAME} CGALPlugin Sofa.Testing Sofa.Component.StateContainer SceneCreator)
add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME})

else()
Expand Down
7 changes: 4 additions & 3 deletions CGALPlugin_test/MeshGenerationFromImage_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
* Contact information: [email protected] *
******************************************************************************/

#include <SofaTest/Sofa_test.h>

#include <sofa/defaulttype/VecTypes.h>
#include <sofa/simulation/Simulation.h>
#include <SofaSimulationGraph/DAGSimulation.h>
Expand All @@ -37,6 +35,9 @@

#include <CGALPlugin/MeshGenerationFromImage.h>

#include <sofa/testing/BaseTest.h>
using sofa::testing::BaseTest;

namespace cgal
{

Expand All @@ -46,7 +47,7 @@ using core::objectmodel::New;
using sofa::simulation::SceneLoaderXML;
using sofa::core::ExecParams;

struct MeshGenerationFromImage_test : public Sofa_test<>
struct MeshGenerationFromImage_test : public BaseTest
{
sofa::simulation::Node::SPtr m_root;
cgal::MeshGenerationFromImage< defaulttype::Vec3dTypes, defaulttype::ImageUC >::SPtr m_meshGenerator;
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ set(SOURCE_FILES
set(README_FILES README.md)

# Dependencies
find_package(SofaFramework REQUIRED)
find_package(SofaSimulationCommon REQUIRED)
find_package(Sofa.Simulation.Common REQUIRED)
find_package(Sofa.Component.Mass REQUIRED)
find_package(Sofa.Component.MechanicalLoad REQUIRED)
find_package(CGAL REQUIRED)
message(STATUS "CGAL VERSION = ${CGAL_VERSION}")

Expand All @@ -59,7 +60,7 @@ if(CGAL_VERSION VERSION_GREATER 4.9) # if CGAL >= 4.10
endif()

# Link the plugin library to its dependencies (other libraries).
target_link_libraries(${PROJECT_NAME} PUBLIC SofaCore SofaSimulationCommon)
target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Common Sofa.Component.Mass Sofa.Component.MechanicalLoad)
target_link_libraries(${PROJECT_NAME} PUBLIC CGAL::CGAL)
if(image_FOUND)
target_link_libraries(${PROJECT_NAME} PUBLIC image CGAL::CGAL_ImageIO)
Expand Down

0 comments on commit 9543fa7

Please sign in to comment.