diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b961b4e..a7542fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,9 +90,7 @@ jobs: echo "DYLD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$DYLD_LIBRARY_PATH" | tee -a $GITHUB_ENV fi echo "LD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$LD_LIBRARY_PATH" | tee -a $GITHUB_ENV - # Add execution right on the tests - chmod +x $WORKSPACE_BUILD_PATH/PluginExample_test/PluginExample_test${{ steps.sofa.outputs.exe }} - + - name: Check environment for tests shell: bash run: | @@ -109,8 +107,10 @@ jobs: if: always() shell: bash run: | + # Add execution right on the tests + chmod +x $WORKSPACE_BUILD_PATH/bin/PluginExample_test${{ steps.sofa.outputs.exe }} cd $WORKSPACE_BUILD_PATH - ./PluginExample_test/PluginExample_test${{ steps.sofa.outputs.exe }} + ./bin/PluginExample_test${{ steps.sofa.outputs.exe }} deploy: name: Deploy artifacts diff --git a/CMakeLists.txt b/CMakeLists.txt index 7519f5f..4c1178e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,10 +3,9 @@ project(PluginExample 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 +find_package(Sofa.Framework 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.GUI.Common QUIET REQUIRED) # Dependency to SofaGuiQt # List all files set(PLUGINEXAMPLE_SRC_DIR src/PluginExample) @@ -32,7 +31,9 @@ set(README_FILES README.md ) -if(Qt5Core_FOUND AND SofaGui_FOUND) +sofa_find_package(Sofa.GUI.Qt QUIET) + +if(Sofa.GUI.Common_FOUND AND Sofa.GUI.Qt_FOUND) message(STATUS "GUI components have been detected, enable GUI-related components") list(APPEND HEADER_FILES_TO_MOC ${PLUGINEXAMPLE_SRC_DIR}/MyDataWidgetUnsigned.h @@ -43,6 +44,7 @@ if(Qt5Core_FOUND AND SofaGui_FOUND) # [Qt] Create moc code. qt5_wrap_cpp(MOCCED_HEADER_FILES ${HEADER_FILES_TO_MOC}) + endif() @@ -50,12 +52,14 @@ endif() add_library(${PROJECT_NAME} SHARED ${HEADER_FILES_TO_MOC} ${MOCCED_HEADER_FILES} ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES}) # Link the plugin library to its dependency(ies). -target_link_libraries(${PROJECT_NAME} SofaBaseVisual) -# Link with the optional GUI dependencies. -if(Qt5Core_FOUND AND SofaGui_FOUND) - target_link_libraries(${PROJECT_NAME} SofaGuiQt) +target_link_libraries(${PROJECT_NAME} Sofa.Framework Sofa.Component.Visual) + +if(Sofa.GUI.Common_FOUND AND Sofa.GUI.Qt_FOUND) + # Link with the optional GUI dependencies. + target_link_libraries(${PROJECT_NAME} Sofa.GUI.Qt) endif() + # Create package Config, Version & Target files. # Deploy the headers, resources, scenes & examples. # Set the plugin 'relocatable' if built within SOFA. diff --git a/PluginExampleConfig.cmake.in b/PluginExampleConfig.cmake.in index 83d6ee0..8aed022 100644 --- a/PluginExampleConfig.cmake.in +++ b/PluginExampleConfig.cmake.in @@ -3,14 +3,16 @@ @PACKAGE_GUARD@ @PACKAGE_INIT@ -set(PLUGINEXAMPLE_HAVE_SOFAGUI @PLUGINEXAMPLE_HAVE_SOFAGUI@) +set(PLUGINEXAMPLE_HAVE_SOFAGUIQT @PLUGINEXAMPLE_HAVE_SOFAGUIQT@) set(PLUGINEXAMPLE_HAVE_QT5CORE @PLUGINEXAMPLE_HAVE_QT5CORE@) -find_package(SofaBase QUIET REQUIRED) +find_package(Sofa.Framework QUIET REQUIRED) # Dependency to SofaBaseVisual +find_package(Sofa.GUI.Common QUIET REQUIRED) # Dependency to SofaGuiQt -if(PLUGINEXAMPLE_HAVE_SOFAGUI) - find_package(SofaGui QUIET REQUIRED) +if(PLUGINEXAMPLE_HAVE_SOFAGUIQT) + find_package(Sofa.GUI.Qt QUIET REQUIRED) endif() + if(PLUGINEXAMPLE_HAVE_QT5CORE) find_package(Qt5 COMPONENTS Core QUIET REQUIRED) endif()