diff --git a/CMakeLists.txt b/CMakeLists.txt index f702fdf7505..8aa44d39196 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -230,6 +230,9 @@ add_subdirectory(SofaGeneral) add_subdirectory(SofaAdvanced) add_subdirectory(SofaMisc) +## Packages +add_subdirectory(applications/collections) + # This is all the applications GUI stuff. As there is a dependency to this one # In scene creator and SofaPython...it is located here. add_subdirectory(SofaGui) @@ -278,9 +281,6 @@ endif() ## Plugins add_subdirectory(applications/plugins) -## Packages -add_subdirectory(applications/packages) - ## Applications add_subdirectory(applications/projects) diff --git a/SofaAdvanced/CMakeLists.txt b/SofaAdvanced/CMakeLists.txt index 2385388ca92..180f11a45ba 100644 --- a/SofaAdvanced/CMakeLists.txt +++ b/SofaAdvanced/CMakeLists.txt @@ -12,7 +12,7 @@ set(SOFAADVANCED_TARGETS SofaNonUniformFem ) -foreach(TARGET ${SOFAADVANCED_TARGETS} SofaComponentAdvanced) +foreach(TARGET ${SOFAADVANCED_TARGETS}) add_subdirectory(../modules/${TARGET} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}) target_include_directories(${TARGET} PUBLIC "$") target_include_directories(${TARGET} PUBLIC "$") diff --git a/SofaAdvanced/SofaAdvancedConfig.cmake.in b/SofaAdvanced/SofaAdvancedConfig.cmake.in index c5e62e45e50..b61bb397e9b 100644 --- a/SofaAdvanced/SofaAdvancedConfig.cmake.in +++ b/SofaAdvanced/SofaAdvancedConfig.cmake.in @@ -2,13 +2,15 @@ @PACKAGE_INIT@ +set(SOFAADVANCED_TARGETS @SOFAADVANCED_TARGETS@) + find_package(SofaGeneral REQUIRED) -foreach(target @SOFAADVANCED_TARGETS@ SofaComponentAdvanced) +foreach(target ${SOFAADVANCED_TARGETS}) if(NOT TARGET ${target}) include("${CMAKE_CURRENT_LIST_DIR}/SofaAdvancedTargets.cmake") break() endif() endforeach() -check_required_components(@SOFAADVANCED_TARGETS@ SofaComponentAdvanced) +check_required_components(${SOFAADVANCED_TARGETS}) diff --git a/SofaAdvanced/config.h.in b/SofaAdvanced/config.h.in index d9d4a06260e..50edd42589d 100644 --- a/SofaAdvanced/config.h.in +++ b/SofaAdvanced/config.h.in @@ -31,11 +31,4 @@ # define SOFA_NON_UNIFORM_FEM_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif -#ifdef SOFA_BUILD_COMPONENT_ADVANCED -# define SOFA_TARGET SofaComponentAdvanced -# define SOFA_COMPONENT_ADVANCED_API SOFA_EXPORT_DYNAMIC_LIBRARY -#else -# define SOFA_COMPONENT_ADVANCED_API SOFA_IMPORT_DYNAMIC_LIBRARY -#endif - #endif diff --git a/SofaGeneral/CMakeLists.txt b/SofaGeneral/CMakeLists.txt index 48e91081dfb..7f104a7435c 100644 --- a/SofaGeneral/CMakeLists.txt +++ b/SofaGeneral/CMakeLists.txt @@ -39,7 +39,7 @@ if(Newmat_FOUND) endif() sofa_set_01(SOFAGENERAL_HAVE_SOFADENSESOLVER VALUE ${Newmat_FOUND}) -foreach(TARGET ${SOFAGENERAL_TARGETS} SofaComponentGeneral) +foreach(TARGET ${SOFAGENERAL_TARGETS}) add_subdirectory(../modules/${TARGET} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}) target_include_directories(${TARGET} PUBLIC "$") target_include_directories(${TARGET} PUBLIC "$") diff --git a/SofaGeneral/SofaGeneralConfig.cmake.in b/SofaGeneral/SofaGeneralConfig.cmake.in index ae993bd8f10..1999872bdc7 100644 --- a/SofaGeneral/SofaGeneralConfig.cmake.in +++ b/SofaGeneral/SofaGeneralConfig.cmake.in @@ -2,6 +2,8 @@ @PACKAGE_INIT@ +set(SOFAGENERAL_TARGETS @SOFAGENERAL_TARGETS@) + set(SOFAGENERAL_HAVE_SOFADENSESOLVER @SOFAGENERAL_HAVE_SOFADENSESOLVER@) set(SOFADENSESOLVER_HAVE_NEWMAT @SOFADENSESOLVER_HAVE_NEWMAT@) set(SOFAGENERALLOADER_HAVE_ZLIB @SOFAGENERALLOADER_HAVE_ZLIB@) @@ -15,11 +17,11 @@ if(SOFAGENERALLOADER_HAVE_ZLIB) find_package(ZLIB QUIET REQUIRED) endif() -foreach(target @SOFAGENERAL_TARGETS@ SofaComponentGeneral) +foreach(target ${SOFAGENERAL_TARGETS}) if(NOT TARGET ${target}) include("${CMAKE_CURRENT_LIST_DIR}/SofaGeneralTargets.cmake") break() endif() endforeach() -check_required_components(@SOFAGENERAL_TARGETS@ SofaComponentGeneral) +check_required_components(${SOFAGENERAL_TARGETS}) diff --git a/SofaGeneral/config.h.in b/SofaGeneral/config.h.in index 8515c11bef2..ed007d1645a 100644 --- a/SofaGeneral/config.h.in +++ b/SofaGeneral/config.h.in @@ -117,13 +117,6 @@ # define SOFA_BOUNDARY_CONDITION_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif -#ifdef SOFA_BUILD_COMPONENT_GENERAL -# define SOFA_TARGET SofaComponentGeneral -# define SOFA_COMPONENT_GENERAL_API SOFA_EXPORT_DYNAMIC_LIBRARY -#else -# define SOFA_COMPONENT_GENERAL_API SOFA_IMPORT_DYNAMIC_LIBRARY -#endif - #ifdef SOFA_BUILD_GENERAL_LINEAR_SOLVER # define SOFA_TARGET SofaGeneralLinearSolver # define SOFA_GENERAL_LINEAR_SOLVER_API SOFA_EXPORT_DYNAMIC_LIBRARY diff --git a/SofaGui/SofaGuiConfig.cmake.in b/SofaGui/SofaGuiConfig.cmake.in index 4abd04bac6a..57a88783c9b 100644 --- a/SofaGui/SofaGuiConfig.cmake.in +++ b/SofaGui/SofaGuiConfig.cmake.in @@ -2,6 +2,8 @@ @PACKAGE_INIT@ +set(SOFAGUI_TARGETS @SOFAGUI_TARGETS@) + set(SOFAGUI_HAVE_SOFAHEADLESSRECORDER @SOFAGUI_HAVE_SOFAHEADLESSRECORDER@) set(SOFAGUI_HAVE_SOFAGUIQT @SOFAGUI_HAVE_SOFAGUIQT@) set(SOFAGUIQT_HAVE_QTVIEWER @SOFAGUIQT_HAVE_QTVIEWER@) @@ -29,11 +31,11 @@ if(SOFAGUI_HAVE_SOFAGUIQT) endif() endif() -foreach(target @SOFAGUI_TARGETS@) +foreach(target ${SOFAGUI_TARGETS}) if(NOT TARGET ${target}) include("${CMAKE_CURRENT_LIST_DIR}/SofaGuiTargets.cmake") break() endif() endforeach() -check_required_components(@SOFAGUI_TARGETS@) +check_required_components(${SOFAGUI_TARGETS}) diff --git a/SofaKernel/SofaBase/CMakeLists.txt b/SofaKernel/SofaBase/CMakeLists.txt index 44c35b158b6..bb2129c57ae 100644 --- a/SofaKernel/SofaBase/CMakeLists.txt +++ b/SofaKernel/SofaBase/CMakeLists.txt @@ -16,7 +16,7 @@ set(SOFABASE_TARGETS SofaBaseVisual ) -foreach(TARGET ${SOFABASE_TARGETS} SofaComponentBase) +foreach(TARGET ${SOFABASE_TARGETS}) add_subdirectory(../modules/${TARGET} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}) target_include_directories(${TARGET} PUBLIC "$") target_include_directories(${TARGET} PUBLIC "$") diff --git a/SofaKernel/SofaBase/SofaBaseConfig.cmake.in b/SofaKernel/SofaBase/SofaBaseConfig.cmake.in index dfb208fd795..87f438bc46c 100644 --- a/SofaKernel/SofaBase/SofaBaseConfig.cmake.in +++ b/SofaKernel/SofaBase/SofaBaseConfig.cmake.in @@ -2,13 +2,15 @@ @PACKAGE_INIT@ +set(SOFABASE_TARGETS @SOFABASE_TARGETS@) + find_package(SofaSimulation REQUIRED) -foreach(target @SOFABASE_TARGETS@ SofaComponentBase) +foreach(target ${SOFABASE_TARGETS}) if(NOT TARGET ${target}) include("${CMAKE_CURRENT_LIST_DIR}/SofaBaseTargets.cmake") break() endif() endforeach() -check_required_components(@SOFABASE_TARGETS@) +check_required_components(${SOFABASE_TARGETS}) diff --git a/SofaKernel/SofaBase/config.h.in b/SofaKernel/SofaBase/config.h.in index 53c8114d088..7bc9907eeba 100644 --- a/SofaKernel/SofaBase/config.h.in +++ b/SofaKernel/SofaBase/config.h.in @@ -59,11 +59,4 @@ # define SOFA_BASE_VISUAL_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif -#ifdef SOFA_BUILD_COMPONENT_BASE -# define SOFA_TARGET SofaComponentBase -# define SOFA_COMPONENT_BASE_API SOFA_EXPORT_DYNAMIC_LIBRARY -#else -# define SOFA_COMPONENT_BASE_API SOFA_IMPORT_DYNAMIC_LIBRARY -#endif - #endif diff --git a/SofaKernel/SofaCommon/CMakeLists.txt b/SofaKernel/SofaCommon/CMakeLists.txt index 64e9f45b2da..32e3d659428 100644 --- a/SofaKernel/SofaCommon/CMakeLists.txt +++ b/SofaKernel/SofaCommon/CMakeLists.txt @@ -21,7 +21,7 @@ set(SOFACOMMON_TARGETS SofaEigen2Solver ) -foreach(TARGET ${SOFACOMMON_TARGETS} SofaComponentCommon) +foreach(TARGET ${SOFACOMMON_TARGETS}) add_subdirectory(../modules/${TARGET} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}) target_include_directories(${TARGET} PUBLIC "$") target_include_directories(${TARGET} PUBLIC "$") diff --git a/SofaKernel/SofaCommon/SofaCommonConfig.cmake.in b/SofaKernel/SofaCommon/SofaCommonConfig.cmake.in index 6696b153f22..73b627f9406 100644 --- a/SofaKernel/SofaCommon/SofaCommonConfig.cmake.in +++ b/SofaKernel/SofaCommon/SofaCommonConfig.cmake.in @@ -2,13 +2,15 @@ @PACKAGE_INIT@ +set(SOFACOMMON_TARGETS @SOFACOMMON_TARGETS@) + find_package(SofaBase REQUIRED SofaComponentBase) -foreach(target @SOFACOMMON_TARGETS@ SofaComponentCommon) +foreach(target ${SOFACOMMON_TARGETS}) if(NOT TARGET ${target}) include("${CMAKE_CURRENT_LIST_DIR}/SofaCommonTargets.cmake") break() endif() endforeach() -check_required_components(@SOFACOMMON_TARGETS@) +check_required_components(${SOFACOMMON_TARGETS}) diff --git a/SofaKernel/SofaCommon/config.h.in b/SofaKernel/SofaCommon/config.h.in index af2975a1311..f07f26365ba 100644 --- a/SofaKernel/SofaCommon/config.h.in +++ b/SofaKernel/SofaCommon/config.h.in @@ -94,12 +94,5 @@ # define SOFA_EIGEN2_SOLVER_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif -#ifdef SOFA_BUILD_COMPONENT_COMMON -# define SOFA_TARGET SofaComponentCommon -# define SOFA_COMPONENT_COMMON_API SOFA_EXPORT_DYNAMIC_LIBRARY -#else -# define SOFA_COMPONENT_COMMON_API SOFA_IMPORT_DYNAMIC_LIBRARY -#endif - #endif diff --git a/SofaKernel/SofaFramework/SofaMacros.cmake b/SofaKernel/SofaFramework/SofaMacros.cmake index 6063532c163..72ddef4d42a 100644 --- a/SofaKernel/SofaFramework/SofaMacros.cmake +++ b/SofaKernel/SofaFramework/SofaMacros.cmake @@ -94,6 +94,7 @@ endmacro() macro(sofa_add_generic directory name type) if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${directory}" AND IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/${directory}") string(TOUPPER ${type}_${name} option) + string(TOLOWER ${type} type_lower) # optional parameter to activate/desactivate the option # e.g. sofa_add_application( path/MYAPP MYAPP APPLICATION ON) @@ -104,9 +105,9 @@ macro(sofa_add_generic directory name type) endif() endif() - option(${option} "Build the ${name} ${type}." ${active}) + option(${option} "Build the ${name} ${type_lower}." ${active}) if(${option}) - message("Adding ${type} ${name}") + message("Adding ${type_lower} ${name}") add_subdirectory(${directory}) #Check if the target has been successfully added if(TARGET ${name}) @@ -131,22 +132,23 @@ macro(sofa_add_generic directory name type) set_property(GLOBAL APPEND PROPERTY __GlobalTargetNameList__ ${option}) endif() else() - message("${type} ${name} (${CMAKE_CURRENT_LIST_DIR}/${directory}) does not exist and will be ignored.") + message("The ${type_lower} ${name} (${CMAKE_CURRENT_LIST_DIR}/${directory}) does not exist and will be ignored.") endif() endmacro() +macro(sofa_add_collection directory name) + sofa_add_generic( ${directory} ${name} "Collection" ${ARGV2} ) +endmacro() macro(sofa_add_plugin directory plugin_name) sofa_add_generic( ${directory} ${plugin_name} "Plugin" ${ARGV2} ) endmacro() - macro(sofa_add_plugin_experimental directory plugin_name) sofa_add_generic( ${directory} ${plugin_name} "Plugin" ${ARGV2} ) message("-- ${plugin_name} is an experimental feature, use it at your own risk.") endmacro() - macro(sofa_add_module directory module_name) sofa_add_generic( ${directory} ${module_name} "Module" ${ARGV2} ) endmacro() @@ -186,6 +188,8 @@ function(sofa_add_generic_external directory name type) return() endif() + string(TOLOWER ${type} type_lower) + # Default value for fetch activation and for plugin activation (if adding a plugin) set(active OFF) set(optional_argv3 "${ARGV3}") @@ -202,7 +206,7 @@ function(sofa_add_generic_external directory name type) # Fetch if(${fetch_enabled}) - message("Fetching ${type} ${name}") + message("Fetching ${type_lower} ${name}") if(NOT EXISTS ${fetched_dir}) file(MAKE_DIRECTORY ${fetched_dir}) diff --git a/SofaKernel/SofaSimulation/SofaSimulationConfig.cmake.in b/SofaKernel/SofaSimulation/SofaSimulationConfig.cmake.in index 078ba576bf5..bb73be9217b 100644 --- a/SofaKernel/SofaSimulation/SofaSimulationConfig.cmake.in +++ b/SofaKernel/SofaSimulation/SofaSimulationConfig.cmake.in @@ -2,13 +2,15 @@ @PACKAGE_INIT@ +set(SOFASIMULATION_TARGETS @SOFASIMULATION_TARGETS@) + find_package(SofaFramework REQUIRED) -foreach(target @SOFASIMULATION_TARGETS@) +foreach(target ${SOFASIMULATION_TARGETS}) if(NOT TARGET ${target}) include("${CMAKE_CURRENT_LIST_DIR}/SofaSimulationTargets.cmake") break() endif() endforeach() -check_required_components(@SOFASIMULATION_TARGETS@) +check_required_components(${SOFASIMULATION_TARGETS}) diff --git a/SofaKernel/framework/sofa/helper/system/gl.h b/SofaKernel/framework/sofa/helper/system/gl.h index 5b729db34ec..c3225c84378 100644 --- a/SofaKernel/framework/sofa/helper/system/gl.h +++ b/SofaKernel/framework/sofa/helper/system/gl.h @@ -22,10 +22,10 @@ #ifndef SOFA_HELPER_SYSTEM_GL_H #define SOFA_HELPER_SYSTEM_GL_H +#include + #ifndef SOFA_NO_OPENGL -#include -#include #include # include diff --git a/SofaKernel/modules/SofaBaseMechanics/SofaBaseMechanics_test/DiagonalMass_test.cpp b/SofaKernel/modules/SofaBaseMechanics/SofaBaseMechanics_test/DiagonalMass_test.cpp index 9f7ad5ef89f..ae6bcf49a7c 100644 --- a/SofaKernel/modules/SofaBaseMechanics/SofaBaseMechanics_test/DiagonalMass_test.cpp +++ b/SofaKernel/modules/SofaBaseMechanics/SofaBaseMechanics_test/DiagonalMass_test.cpp @@ -91,7 +91,7 @@ class DiagonalMass_test : public BaseTest void SetUp() override { - sofa::simpleapi::importPlugin("SofaAllCommonComponents") ; + sofa::simpleapi::importPlugin("SofaComponentAll") ; component::initBaseMechanics(); simulation::setSimulation(simulation = new simulation::graph::DAGSimulation()); diff --git a/SofaKernel/modules/SofaBaseMechanics/SofaBaseMechanics_test/UniformMass_test.cpp b/SofaKernel/modules/SofaBaseMechanics/SofaBaseMechanics_test/UniformMass_test.cpp index 82e52e30d4c..7e7e945c093 100644 --- a/SofaKernel/modules/SofaBaseMechanics/SofaBaseMechanics_test/UniformMass_test.cpp +++ b/SofaKernel/modules/SofaBaseMechanics/SofaBaseMechanics_test/UniformMass_test.cpp @@ -84,7 +84,7 @@ struct UniformMassTest : public BaseTest virtual void SetUp() { - sofa::simpleapi::importPlugin("SofaAllCommonComponents") ; + sofa::simpleapi::importPlugin("SofaComponentAll") ; todo = true ; initBaseMechanics(); diff --git a/SofaKernel/modules/SofaComponentCommon/CMakeLists.txt b/SofaKernel/modules/SofaComponentCommon/CMakeLists.txt deleted file mode 100644 index 88aefd5cc5a..00000000000 --- a/SofaKernel/modules/SofaComponentCommon/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(SofaComponentCommon) - -set(HEADER_FILES - config.h - initComponentCommon.h -) - -set(SOURCE_FILES - initComponentCommon.cpp -) - -add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) -foreach(target ${SOFACOMMON_TARGETS}) - target_link_libraries(${PROJECT_NAME} PUBLIC ${target}) -endforeach() -set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_COMPONENT_COMMON") -set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}") - -sofa_install_targets(SofaCommon ${PROJECT_NAME} "SofaCommon/${PROJECT_NAME}") diff --git a/SofaKernel/modules/SofaDeformable/SofaDeformable_test/RestShapeSpringsForceField_test.cpp b/SofaKernel/modules/SofaDeformable/SofaDeformable_test/RestShapeSpringsForceField_test.cpp index fa526a8c4d1..ad63f5653c1 100644 --- a/SofaKernel/modules/SofaDeformable/SofaDeformable_test/RestShapeSpringsForceField_test.cpp +++ b/SofaKernel/modules/SofaDeformable/SofaDeformable_test/RestShapeSpringsForceField_test.cpp @@ -55,7 +55,7 @@ RestStiffSpringsForceField_test::~RestStiffSpringsForceField_test() sofa::Node::SPtr RestStiffSpringsForceField_test::createScene(const std::string& type) { - importPlugin("SofaAllCommonComponents"); + importPlugin("SofaComponentAll"); auto theSimulation = createSimulation(); auto theRoot = createRootNode(theSimulation, "root"); diff --git a/SofaKernel/modules/sofa/frameworkextra/frameworkextra_test/CMakeLists.txt b/SofaKernel/modules/sofa/frameworkextra/frameworkextra_test/CMakeLists.txt index 82acfd5df04..49f192deacc 100644 --- a/SofaKernel/modules/sofa/frameworkextra/frameworkextra_test/CMakeLists.txt +++ b/SofaKernel/modules/sofa/frameworkextra/frameworkextra_test/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.1) project(SofaFrameworkExtra_test) +find_package(SofaComponentBase REQUIRED) + set(SOURCE_FILES core/TrackedData_test.cpp core/objectmodel/Base_test.cpp @@ -14,6 +16,6 @@ set(SOURCE_FILES add_executable(${PROJECT_NAME} ${SOURCE_FILES}) add_definitions("-DSOFAFRAMEWORKEXTRA_TEST_SCENES_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/scenes\"") -target_link_libraries(${PROJECT_NAME} SofaGTestMain SofaHelper) +target_link_libraries(${PROJECT_NAME} SofaGTestMain SofaHelper SofaComponentBase) add_test(NAME SofaFrameworkExtra_test COMMAND SofaFrameworkExtra_test) diff --git a/SofaKernel/modules/sofa/frameworkextra/frameworkextra_test/core/objectmodel/BaseContext_test.cpp b/SofaKernel/modules/sofa/frameworkextra/frameworkextra_test/core/objectmodel/BaseContext_test.cpp index bc40e8bfa35..73cb9bec6c3 100644 --- a/SofaKernel/modules/sofa/frameworkextra/frameworkextra_test/core/objectmodel/BaseContext_test.cpp +++ b/SofaKernel/modules/sofa/frameworkextra/frameworkextra_test/core/objectmodel/BaseContext_test.cpp @@ -40,7 +40,7 @@ class BaseContext_test: public BaseSimulationTest void testGetObjects() { EXPECT_MSG_NOEMIT(Error, Warning) ; - importPlugin("SofaAllCommonComponents") ; + importPlugin("SofaComponentAll") ; std::stringstream scene ; scene << "" " \n" diff --git a/SofaKernel/modules/sofa/frameworkextra/frameworkextra_test/simulation/Node_test.cpp b/SofaKernel/modules/sofa/frameworkextra/frameworkextra_test/simulation/Node_test.cpp index 312862e03f4..5f4e25835e1 100644 --- a/SofaKernel/modules/sofa/frameworkextra/frameworkextra_test/simulation/Node_test.cpp +++ b/SofaKernel/modules/sofa/frameworkextra/frameworkextra_test/simulation/Node_test.cpp @@ -44,7 +44,7 @@ class NodeContext_test: public BaseSimulationTest NodeContext_test() { - importPlugin("SofaAllCommonComponents") ; + importPlugin("SofaComponentAll") ; } void testGetNodeObjects() diff --git a/SofaMisc/CMakeLists.txt b/SofaMisc/CMakeLists.txt index 147d04b0846..34b448752db 100644 --- a/SofaMisc/CMakeLists.txt +++ b/SofaMisc/CMakeLists.txt @@ -18,7 +18,7 @@ set(SOFAMISC_TARGETS SofaMiscTopology ) -foreach(TARGET ${SOFAMISC_TARGETS} SofaComponentMisc) +foreach(TARGET ${SOFAMISC_TARGETS}) add_subdirectory(../modules/${TARGET} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}) target_include_directories(${TARGET} PUBLIC "$") target_include_directories(${TARGET} PUBLIC "$") diff --git a/SofaMisc/SofaMiscConfig.cmake.in b/SofaMisc/SofaMiscConfig.cmake.in index b9e2bcb0863..4e47895174a 100644 --- a/SofaMisc/SofaMiscConfig.cmake.in +++ b/SofaMisc/SofaMiscConfig.cmake.in @@ -1,6 +1,8 @@ # CMake package configuration file for SofaMisc @PACKAGE_INIT@ +set(SOFAMISC_TARGETS @SOFAMISC_TARGETS@) + set(SOFAMISCTOPOLOGY_HAVE_ZLIB @SOFAMISCTOPOLOGY_HAVE_ZLIB@) set(SOFAMISCFEM_HAVE_NEWMAT @SOFAMISCFEM_HAVE_NEWMAT@) @@ -14,11 +16,11 @@ if(SOFAMISCFEM_HAVE_NEWMAT) find_package(Newmat QUIET REQUIRED) endif() -foreach(target @SOFAMISC_TARGETS@ SofaComponentMisc) +foreach(target ${SOFAMISC_TARGETS}) if(NOT TARGET ${target}) include("${CMAKE_CURRENT_LIST_DIR}/SofaMiscTargets.cmake") break() endif() endforeach() -check_required_components(@SOFAMISC_TARGETS@) +check_required_components(${SOFAMISC_TARGETS}) diff --git a/SofaMisc/config.h.in b/SofaMisc/config.h.in index d0b9a4b5166..d3e7b332029 100644 --- a/SofaMisc/config.h.in +++ b/SofaMisc/config.h.in @@ -73,11 +73,4 @@ # define SOFA_MISC_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif -#ifdef SOFA_BUILD_COMPONENT_MISC -# define SOFA_TARGET SofaComponentMisc -# define SOFA_COMPONENT_MISC_API SOFA_EXPORT_DYNAMIC_LIBRARY -#else -# define SOFA_COMPONENT_MISC_API SOFA_IMPORT_DYNAMIC_LIBRARY -#endif - #endif diff --git a/applications/collections/CMakeLists.txt b/applications/collections/CMakeLists.txt new file mode 100644 index 00000000000..8040d8d839d --- /dev/null +++ b/applications/collections/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) + +sofa_add_collection(SofaComponentBase SofaComponentBase ON) +sofa_add_collection(SofaComponentCommon SofaComponentCommon ON) +sofa_add_collection(SofaComponentGeneral SofaComponentGeneral ON) +sofa_add_collection(SofaComponentMisc SofaComponentMisc ON) +sofa_add_collection(SofaComponentAdvanced SofaComponentAdvanced ON) + +sofa_add_collection(SofaComponentAll SofaComponentAll ON) # Depends on all SofaComponent* diff --git a/applications/collections/SofaComponentAdvanced/CMakeLists.txt b/applications/collections/SofaComponentAdvanced/CMakeLists.txt new file mode 100644 index 00000000000..77c6a6c771a --- /dev/null +++ b/applications/collections/SofaComponentAdvanced/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.1) +project(SofaComponentAdvanced VERSION 1.0) + +find_package(SofaAdvanced REQUIRED) + +set(HEADER_FILES + config.h + initComponentAdvanced.h +) + +set(SOURCE_FILES + initComponentAdvanced.cpp +) + +add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) +foreach(target ${SOFAADVANCED_TARGETS}) + target_link_libraries(${PROJECT_NAME} PUBLIC ${target}) +endforeach() +set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_COMPONENT_ADVANCED") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX _d) + +sofa_generate_package( + NAME ${PROJECT_NAME} + VERSION ${PROJECT_VERSION} + TARGETS ${PROJECT_NAME} + INCLUDE_INSTALL_DIR "${PROJECT_NAME}/${PROJECT_NAME}" + ) diff --git a/applications/collections/SofaComponentAdvanced/SofaComponentAdvancedConfig.cmake.in b/applications/collections/SofaComponentAdvanced/SofaComponentAdvancedConfig.cmake.in new file mode 100644 index 00000000000..6e9b6015f62 --- /dev/null +++ b/applications/collections/SofaComponentAdvanced/SofaComponentAdvancedConfig.cmake.in @@ -0,0 +1,11 @@ +# CMake package configuration file for @PROJECT_NAME@ + +@PACKAGE_INIT@ + +find_package(SofaAdvanced REQUIRED) + +if(NOT TARGET @PROJECT_NAME@) + include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +endif() + +check_required_components(@PROJECT_NAME@) diff --git a/modules/SofaComponentAdvanced/config.h b/applications/collections/SofaComponentAdvanced/config.h similarity index 88% rename from modules/SofaComponentAdvanced/config.h rename to applications/collections/SofaComponentAdvanced/config.h index a7368cae0ec..98e241dc628 100644 --- a/modules/SofaComponentAdvanced/config.h +++ b/applications/collections/SofaComponentAdvanced/config.h @@ -24,4 +24,11 @@ #include +#ifdef SOFA_BUILD_COMPONENT_ADVANCED +# define SOFA_TARGET SofaComponentAdvanced +# define SOFA_COMPONENT_ADVANCED_API SOFA_EXPORT_DYNAMIC_LIBRARY +#else +# define SOFA_COMPONENT_ADVANCED_API SOFA_IMPORT_DYNAMIC_LIBRARY +#endif + #endif diff --git a/modules/SofaComponentAdvanced/initComponentAdvanced.cpp b/applications/collections/SofaComponentAdvanced/initComponentAdvanced.cpp similarity index 100% rename from modules/SofaComponentAdvanced/initComponentAdvanced.cpp rename to applications/collections/SofaComponentAdvanced/initComponentAdvanced.cpp diff --git a/modules/SofaComponentAdvanced/initComponentAdvanced.h b/applications/collections/SofaComponentAdvanced/initComponentAdvanced.h similarity index 100% rename from modules/SofaComponentAdvanced/initComponentAdvanced.h rename to applications/collections/SofaComponentAdvanced/initComponentAdvanced.h diff --git a/applications/packages/SofaAllCommonComponents/CMakeLists.txt b/applications/collections/SofaComponentAll/CMakeLists.txt similarity index 51% rename from applications/packages/SofaAllCommonComponents/CMakeLists.txt rename to applications/collections/SofaComponentAll/CMakeLists.txt index 42dfad3760e..9cbe0e9ac57 100644 --- a/applications/packages/SofaAllCommonComponents/CMakeLists.txt +++ b/applications/collections/SofaComponentAll/CMakeLists.txt @@ -1,12 +1,18 @@ cmake_minimum_required(VERSION 3.1) -project(SofaAllCommonComponents VERSION 1.0) +project(SofaComponentAll VERSION 1.0) + +find_package(SofaComponentBase REQUIRED) +find_package(SofaComponentCommon REQUIRED) +find_package(SofaComponentGeneral REQUIRED) +find_package(SofaComponentAdvanced REQUIRED) +find_package(SofaComponentMisc REQUIRED) set(HEADER_FILES config.h - initAllCommonComponents.h + initComponentAll.h ) set(SOURCE_FILES - initAllCommonComponents.cpp + initComponentAll.cpp ) set(EXTRA_FILES README.md @@ -16,18 +22,22 @@ add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${EXTRA_FILES target_link_libraries(${PROJECT_NAME} SofaComponentBase SofaComponentCommon SofaComponentGeneral SofaComponentAdvanced SofaComponentMisc) target_include_directories(${PROJECT_NAME} PUBLIC "$") target_include_directories(${PROJECT_NAME} PUBLIC "$") -set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_SOFALLCOMMONCOMPONENTS -DSOFA_SRC_DIR=\"${CMAKE_SOURCE_DIR}\"") -set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}") +set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_SOFACOMPONENTALL -DSOFA_SRC_DIR=\"${CMAKE_SOURCE_DIR}\"") find_package(SofaOpenglVisual QUIET) if(SofaOpenglVisual_FOUND) target_link_libraries(${PROJECT_NAME} SofaOpenglVisual) endif() +# TODO: remove SofaAllCommonComponents backward compatibility at SOFA v20.06 +add_library(SofaAllCommonComponents SHARED ${HEADER_FILES} ${SOURCE_FILES} ${EXTRA_FILES}) +target_link_libraries(SofaAllCommonComponents ${PROJECT_NAME}) +set_target_properties(SofaAllCommonComponents PROPERTIES COMPILE_FLAGS "-DSOFACOMPONENTALL_USING_DEPRECATED_NAME") + ## Install rules for the library and headers; CMake package configurations files sofa_generate_package( - NAME SofaAllCommonComponents + NAME SofaComponentAll VERSION ${PROJECT_VERSION} - TARGETS ${PROJECT_NAME} - INCLUDE_INSTALL_DIR "SofaAllCommonComponents/SofaAllCommonComponents" + TARGETS ${PROJECT_NAME} SofaAllCommonComponents + INCLUDE_INSTALL_DIR "SofaComponentAll/SofaComponentAll" ) diff --git a/applications/packages/SofaAllCommonComponents/README.md b/applications/collections/SofaComponentAll/README.md similarity index 100% rename from applications/packages/SofaAllCommonComponents/README.md rename to applications/collections/SofaComponentAll/README.md diff --git a/applications/collections/SofaComponentAll/SofaComponentAllConfig.cmake.in b/applications/collections/SofaComponentAll/SofaComponentAllConfig.cmake.in new file mode 100644 index 00000000000..c7bc9e6fb39 --- /dev/null +++ b/applications/collections/SofaComponentAll/SofaComponentAllConfig.cmake.in @@ -0,0 +1,15 @@ +# CMake package configuration file for @PROJECT_NAME@ + +@PACKAGE_INIT@ + +find_package(SofaComponentBase REQUIRED) +find_package(SofaComponentCommon REQUIRED) +find_package(SofaComponentGeneral REQUIRED) +find_package(SofaComponentAdvanced REQUIRED) +find_package(SofaComponentMisc REQUIRED) + +if(NOT TARGET @PROJECT_NAME@) + include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +endif() + +check_required_components(@PROJECT_NAME@) diff --git a/applications/packages/SofaAllCommonComponents/config.h b/applications/collections/SofaComponentAll/config.h similarity index 92% rename from applications/packages/SofaAllCommonComponents/config.h rename to applications/collections/SofaComponentAll/config.h index a7efa2dbe36..deac09f48c1 100644 --- a/applications/packages/SofaAllCommonComponents/config.h +++ b/applications/collections/SofaComponentAll/config.h @@ -23,9 +23,9 @@ #define SOFA_PACKAGE_ALLCOMMONCOMPONENTS_CONFIG_H #ifdef SOFA_BUILD_MISC_COLLISION -# define SOFA_SOFAALLCOMMONCOMPONENTS_API SOFA_EXPORT_DYNAMIC_LIBRARY +# define SOFA_SOFACOMPONENTALL_API SOFA_EXPORT_DYNAMIC_LIBRARY #else -# define SOFA_SOFAALLCOMMONCOMPONENTS_API SOFA_IMPORT_DYNAMIC_LIBRARY +# define SOFA_SOFACOMPONENTALL_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif #endif diff --git a/applications/packages/SofaAllCommonComponents/initAllCommonComponents.cpp b/applications/collections/SofaComponentAll/initComponentAll.cpp similarity index 75% rename from applications/packages/SofaAllCommonComponents/initAllCommonComponents.cpp rename to applications/collections/SofaComponentAll/initComponentAll.cpp index fe9f447ed4c..1614f2fb389 100644 --- a/applications/packages/SofaAllCommonComponents/initAllCommonComponents.cpp +++ b/applications/collections/SofaComponentAll/initComponentAll.cpp @@ -20,7 +20,7 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #include -#include +#include #include #include @@ -28,6 +28,8 @@ #include #include +#include + namespace sofa { @@ -36,21 +38,25 @@ namespace component /// Convenient functions to help user to know what contains the plugin extern "C" { - SOFA_SOFAALLCOMMONCOMPONENTS_API void initExternalModule(); - SOFA_SOFAALLCOMMONCOMPONENTS_API const char* getModuleName(); - SOFA_SOFAALLCOMMONCOMPONENTS_API const char* getModuleVersion(); - SOFA_SOFAALLCOMMONCOMPONENTS_API const char* getModuleLicense(); - SOFA_SOFAALLCOMMONCOMPONENTS_API const char* getModuleDescription(); - SOFA_SOFAALLCOMMONCOMPONENTS_API const char* getModuleComponentList(); + SOFA_SOFACOMPONENTALL_API void initExternalModule(); + SOFA_SOFACOMPONENTALL_API const char* getModuleName(); + SOFA_SOFACOMPONENTALL_API const char* getModuleVersion(); + SOFA_SOFACOMPONENTALL_API const char* getModuleLicense(); + SOFA_SOFACOMPONENTALL_API const char* getModuleDescription(); + SOFA_SOFACOMPONENTALL_API const char* getModuleComponentList(); } void initExternalModule() { static bool first = true; - if (first) - { - first = false; - } + if(!first) return; + first = false; + +/// TODO: remove SofaAllCommonComponents backward compatibility at SOFA v20.06 +#ifdef SOFACOMPONENTALL_USING_DEPRECATED_NAME + msg_deprecated("SofaAllCommonComponents") << "This plugin was renamed into SofaComponentAll. Backward compatiblity will be stopped at SOFA v20.06"; + return; +#endif sofa::component::initComponentBase(); sofa::component::initComponentCommon(); @@ -61,7 +67,7 @@ void initExternalModule() const char* getModuleName() { - return "SofaAllCommonComponents"; + return "SofaComponentAll"; } const char* getModuleVersion() @@ -74,10 +80,9 @@ const char* getModuleLicense() return "LGPL"; } - const char* getModuleDescription() { - return "This package expose all the common sofa component."; + return "This package exposes all SOFA components."; } const char* getModuleComponentList() diff --git a/applications/packages/SofaAllCommonComponents/initAllCommonComponents.h b/applications/collections/SofaComponentAll/initComponentAll.h similarity index 95% rename from applications/packages/SofaAllCommonComponents/initAllCommonComponents.h rename to applications/collections/SofaComponentAll/initComponentAll.h index 5564245a9ae..29786d3783c 100644 --- a/applications/packages/SofaAllCommonComponents/initAllCommonComponents.h +++ b/applications/collections/SofaComponentAll/initComponentAll.h @@ -19,8 +19,8 @@ * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ -#ifndef SOFA_COMPONENT_EULERIAN_FLUID_INIT_H -#define SOFA_COMPONENT_EULERIAN_FLUID_INIT_H +#ifndef SOFA_COMPONENT_ALL_INIT_H +#define SOFA_COMPONENT_ALL_INIT_H #include "config.h" namespace sofa diff --git a/SofaKernel/modules/SofaComponentBase/CMakeLists.txt b/applications/collections/SofaComponentBase/CMakeLists.txt similarity index 50% rename from SofaKernel/modules/SofaComponentBase/CMakeLists.txt rename to applications/collections/SofaComponentBase/CMakeLists.txt index 6aa928f80f8..e4d0a9f6b78 100644 --- a/SofaKernel/modules/SofaComponentBase/CMakeLists.txt +++ b/applications/collections/SofaComponentBase/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(SofaComponentBase) +project(SofaComponentBase VERSION 1.0) + +find_package(SofaBase REQUIRED) set(HEADER_FILES config.h @@ -23,6 +25,14 @@ foreach(target ${SOFABASE_TARGETS}) target_link_libraries(${PROJECT_NAME} PUBLIC ${target}) endforeach() set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_COMPONENT_BASE") -set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX _d) -sofa_install_targets(SofaBase ${PROJECT_NAME} "SofaBase/${PROJECT_NAME}") +sofa_generate_package( + NAME ${PROJECT_NAME} + VERSION ${PROJECT_VERSION} + TARGETS ${PROJECT_NAME} + INCLUDE_INSTALL_DIR "${PROJECT_NAME}/${PROJECT_NAME}" + ) diff --git a/SofaKernel/modules/SofaComponentBase/InfoComponent.cpp b/applications/collections/SofaComponentBase/InfoComponent.cpp similarity index 100% rename from SofaKernel/modules/SofaComponentBase/InfoComponent.cpp rename to applications/collections/SofaComponentBase/InfoComponent.cpp diff --git a/SofaKernel/modules/SofaComponentBase/InfoComponent.h b/applications/collections/SofaComponentBase/InfoComponent.h similarity index 100% rename from SofaKernel/modules/SofaComponentBase/InfoComponent.h rename to applications/collections/SofaComponentBase/InfoComponent.h diff --git a/SofaKernel/modules/SofaComponentBase/MakeAliasComponent.cpp b/applications/collections/SofaComponentBase/MakeAliasComponent.cpp similarity index 100% rename from SofaKernel/modules/SofaComponentBase/MakeAliasComponent.cpp rename to applications/collections/SofaComponentBase/MakeAliasComponent.cpp diff --git a/SofaKernel/modules/SofaComponentBase/MakeAliasComponent.h b/applications/collections/SofaComponentBase/MakeAliasComponent.h similarity index 100% rename from SofaKernel/modules/SofaComponentBase/MakeAliasComponent.h rename to applications/collections/SofaComponentBase/MakeAliasComponent.h diff --git a/SofaKernel/modules/SofaComponentBase/MakeDataAliasComponent.cpp b/applications/collections/SofaComponentBase/MakeDataAliasComponent.cpp similarity index 100% rename from SofaKernel/modules/SofaComponentBase/MakeDataAliasComponent.cpp rename to applications/collections/SofaComponentBase/MakeDataAliasComponent.cpp diff --git a/SofaKernel/modules/SofaComponentBase/MakeDataAliasComponent.h b/applications/collections/SofaComponentBase/MakeDataAliasComponent.h similarity index 100% rename from SofaKernel/modules/SofaComponentBase/MakeDataAliasComponent.h rename to applications/collections/SofaComponentBase/MakeDataAliasComponent.h diff --git a/applications/collections/SofaComponentBase/SofaComponentBaseConfig.cmake.in b/applications/collections/SofaComponentBase/SofaComponentBaseConfig.cmake.in new file mode 100644 index 00000000000..942d49c50ce --- /dev/null +++ b/applications/collections/SofaComponentBase/SofaComponentBaseConfig.cmake.in @@ -0,0 +1,11 @@ +# CMake package configuration file for @PROJECT_NAME@ + +@PACKAGE_INIT@ + +find_package(SofaBase REQUIRED) + +if(NOT TARGET @PROJECT_NAME@) + include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +endif() + +check_required_components(@PROJECT_NAME@) diff --git a/SofaKernel/modules/SofaComponentBase/SofaComponentBase_test/CMakeLists.txt b/applications/collections/SofaComponentBase/SofaComponentBase_test/CMakeLists.txt similarity index 100% rename from SofaKernel/modules/SofaComponentBase/SofaComponentBase_test/CMakeLists.txt rename to applications/collections/SofaComponentBase/SofaComponentBase_test/CMakeLists.txt diff --git a/SofaKernel/modules/SofaComponentBase/SofaComponentBase_test/MakeAliasComponent_test.cpp b/applications/collections/SofaComponentBase/SofaComponentBase_test/MakeAliasComponent_test.cpp similarity index 100% rename from SofaKernel/modules/SofaComponentBase/SofaComponentBase_test/MakeAliasComponent_test.cpp rename to applications/collections/SofaComponentBase/SofaComponentBase_test/MakeAliasComponent_test.cpp diff --git a/SofaKernel/modules/SofaComponentBase/SofaComponentBase_test/MakeDataAliasComponent_test.cpp b/applications/collections/SofaComponentBase/SofaComponentBase_test/MakeDataAliasComponent_test.cpp similarity index 100% rename from SofaKernel/modules/SofaComponentBase/SofaComponentBase_test/MakeDataAliasComponent_test.cpp rename to applications/collections/SofaComponentBase/SofaComponentBase_test/MakeDataAliasComponent_test.cpp diff --git a/SofaKernel/modules/SofaComponentBase/SofaComponentBase_test/MessageHandlerComponent_test.cpp b/applications/collections/SofaComponentBase/SofaComponentBase_test/MessageHandlerComponent_test.cpp similarity index 100% rename from SofaKernel/modules/SofaComponentBase/SofaComponentBase_test/MessageHandlerComponent_test.cpp rename to applications/collections/SofaComponentBase/SofaComponentBase_test/MessageHandlerComponent_test.cpp diff --git a/SofaKernel/modules/SofaComponentBase/config.h b/applications/collections/SofaComponentBase/config.h similarity index 89% rename from SofaKernel/modules/SofaComponentBase/config.h rename to applications/collections/SofaComponentBase/config.h index dc8a7e5694f..c7be57e21b9 100644 --- a/SofaKernel/modules/SofaComponentBase/config.h +++ b/applications/collections/SofaComponentBase/config.h @@ -24,4 +24,11 @@ #include +#ifdef SOFA_BUILD_COMPONENT_BASE +# define SOFA_TARGET SofaComponentBase +# define SOFA_COMPONENT_BASE_API SOFA_EXPORT_DYNAMIC_LIBRARY +#else +# define SOFA_COMPONENT_BASE_API SOFA_IMPORT_DYNAMIC_LIBRARY +#endif + #endif diff --git a/SofaKernel/modules/SofaComponentBase/initComponentBase.cpp b/applications/collections/SofaComponentBase/initComponentBase.cpp similarity index 100% rename from SofaKernel/modules/SofaComponentBase/initComponentBase.cpp rename to applications/collections/SofaComponentBase/initComponentBase.cpp diff --git a/SofaKernel/modules/SofaComponentBase/initComponentBase.h b/applications/collections/SofaComponentBase/initComponentBase.h similarity index 100% rename from SofaKernel/modules/SofaComponentBase/initComponentBase.h rename to applications/collections/SofaComponentBase/initComponentBase.h diff --git a/SofaKernel/modules/SofaComponentBase/messageHandlerComponent.cpp b/applications/collections/SofaComponentBase/messageHandlerComponent.cpp similarity index 100% rename from SofaKernel/modules/SofaComponentBase/messageHandlerComponent.cpp rename to applications/collections/SofaComponentBase/messageHandlerComponent.cpp diff --git a/SofaKernel/modules/SofaComponentBase/messageHandlerComponent.h b/applications/collections/SofaComponentBase/messageHandlerComponent.h similarity index 100% rename from SofaKernel/modules/SofaComponentBase/messageHandlerComponent.h rename to applications/collections/SofaComponentBase/messageHandlerComponent.h diff --git a/applications/collections/SofaComponentCommon/CMakeLists.txt b/applications/collections/SofaComponentCommon/CMakeLists.txt new file mode 100644 index 00000000000..b00170c8495 --- /dev/null +++ b/applications/collections/SofaComponentCommon/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.1) +project(SofaComponentCommon VERSION 1.0) + +find_package(SofaCommon REQUIRED) + +set(HEADER_FILES + config.h + initComponentCommon.h +) + +set(SOURCE_FILES + initComponentCommon.cpp +) + +add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) +foreach(target ${SOFACOMMON_TARGETS}) + target_link_libraries(${PROJECT_NAME} PUBLIC ${target}) +endforeach() +set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_COMPONENT_COMMON") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX _d) + +sofa_generate_package( + NAME ${PROJECT_NAME} + VERSION ${PROJECT_VERSION} + TARGETS ${PROJECT_NAME} + INCLUDE_INSTALL_DIR "${PROJECT_NAME}/${PROJECT_NAME}" + ) diff --git a/applications/collections/SofaComponentCommon/SofaComponentCommonConfig.cmake.in b/applications/collections/SofaComponentCommon/SofaComponentCommonConfig.cmake.in new file mode 100644 index 00000000000..65adb4d3fe3 --- /dev/null +++ b/applications/collections/SofaComponentCommon/SofaComponentCommonConfig.cmake.in @@ -0,0 +1,11 @@ +# CMake package configuration file for @PROJECT_NAME@ + +@PACKAGE_INIT@ + +find_package(SofaCommon REQUIRED) + +if(NOT TARGET @PROJECT_NAME@) + include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +endif() + +check_required_components(@PROJECT_NAME@) diff --git a/SofaKernel/modules/SofaComponentCommon/config.h b/applications/collections/SofaComponentCommon/config.h similarity index 88% rename from SofaKernel/modules/SofaComponentCommon/config.h rename to applications/collections/SofaComponentCommon/config.h index 680300c6511..a809bae547d 100644 --- a/SofaKernel/modules/SofaComponentCommon/config.h +++ b/applications/collections/SofaComponentCommon/config.h @@ -24,4 +24,11 @@ #include +#ifdef SOFA_BUILD_COMPONENT_COMMON +# define SOFA_TARGET SofaComponentCommon +# define SOFA_COMPONENT_COMMON_API SOFA_EXPORT_DYNAMIC_LIBRARY +#else +# define SOFA_COMPONENT_COMMON_API SOFA_IMPORT_DYNAMIC_LIBRARY +#endif + #endif diff --git a/SofaKernel/modules/SofaComponentCommon/initComponentCommon.cpp b/applications/collections/SofaComponentCommon/initComponentCommon.cpp similarity index 100% rename from SofaKernel/modules/SofaComponentCommon/initComponentCommon.cpp rename to applications/collections/SofaComponentCommon/initComponentCommon.cpp diff --git a/SofaKernel/modules/SofaComponentCommon/initComponentCommon.h b/applications/collections/SofaComponentCommon/initComponentCommon.h similarity index 100% rename from SofaKernel/modules/SofaComponentCommon/initComponentCommon.h rename to applications/collections/SofaComponentCommon/initComponentCommon.h diff --git a/applications/collections/SofaComponentGeneral/CMakeLists.txt b/applications/collections/SofaComponentGeneral/CMakeLists.txt new file mode 100644 index 00000000000..d834b4e6a0a --- /dev/null +++ b/applications/collections/SofaComponentGeneral/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.1) +project(SofaComponentGeneral VERSION 1.0) + +find_package(SofaGeneral REQUIRED) + +set(HEADER_FILES + config.h + initComponentGeneral.h + ) + +set(SOURCE_FILES + initComponentGeneral.cpp + ) + +add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) +foreach(target ${SOFAGENERAL_TARGETS}) + target_link_libraries(${PROJECT_NAME} PUBLIC ${target}) +endforeach() +set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_COMPONENT_GENERAL") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX _d) + +sofa_generate_package( + NAME ${PROJECT_NAME} + VERSION ${PROJECT_VERSION} + TARGETS ${PROJECT_NAME} + INCLUDE_INSTALL_DIR "${PROJECT_NAME}/${PROJECT_NAME}" + ) diff --git a/applications/collections/SofaComponentGeneral/SofaComponentGeneralConfig.cmake.in b/applications/collections/SofaComponentGeneral/SofaComponentGeneralConfig.cmake.in new file mode 100644 index 00000000000..147e57033b2 --- /dev/null +++ b/applications/collections/SofaComponentGeneral/SofaComponentGeneralConfig.cmake.in @@ -0,0 +1,11 @@ +# CMake package configuration file for @PROJECT_NAME@ + +@PACKAGE_INIT@ + +find_package(SofaGeneral REQUIRED) + +if(NOT TARGET @PROJECT_NAME@) + include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +endif() + +check_required_components(@PROJECT_NAME@) diff --git a/modules/SofaComponentGeneral/config.h b/applications/collections/SofaComponentGeneral/config.h similarity index 88% rename from modules/SofaComponentGeneral/config.h rename to applications/collections/SofaComponentGeneral/config.h index 614232cd4f5..50f3410c855 100644 --- a/modules/SofaComponentGeneral/config.h +++ b/applications/collections/SofaComponentGeneral/config.h @@ -24,4 +24,11 @@ #include +#ifdef SOFA_BUILD_COMPONENT_GENERAL +# define SOFA_TARGET SofaComponentGeneral +# define SOFA_COMPONENT_GENERAL_API SOFA_EXPORT_DYNAMIC_LIBRARY +#else +# define SOFA_COMPONENT_GENERAL_API SOFA_IMPORT_DYNAMIC_LIBRARY +#endif + #endif diff --git a/modules/SofaComponentGeneral/initComponentGeneral.cpp b/applications/collections/SofaComponentGeneral/initComponentGeneral.cpp similarity index 100% rename from modules/SofaComponentGeneral/initComponentGeneral.cpp rename to applications/collections/SofaComponentGeneral/initComponentGeneral.cpp diff --git a/modules/SofaComponentGeneral/initComponentGeneral.h b/applications/collections/SofaComponentGeneral/initComponentGeneral.h similarity index 100% rename from modules/SofaComponentGeneral/initComponentGeneral.h rename to applications/collections/SofaComponentGeneral/initComponentGeneral.h diff --git a/applications/collections/SofaComponentMisc/CMakeLists.txt b/applications/collections/SofaComponentMisc/CMakeLists.txt new file mode 100644 index 00000000000..4d4e37a8fc2 --- /dev/null +++ b/applications/collections/SofaComponentMisc/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.1) +project(SofaComponentMisc VERSION 1.0) + +find_package(SofaMisc REQUIRED) + +set(HEADER_FILES + config.h + initComponentMisc.h +) + +set(SOURCE_FILES + initComponentMisc.cpp +) + +add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) +foreach(target ${SOFAMISC_TARGETS}) + target_link_libraries(${PROJECT_NAME} PUBLIC ${target}) +endforeach() +set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_COMPONENT_MISC") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +target_include_directories(${PROJECT_NAME} PUBLIC "$") +set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX _d) + +sofa_generate_package( + NAME ${PROJECT_NAME} + VERSION ${PROJECT_VERSION} + TARGETS ${PROJECT_NAME} + INCLUDE_INSTALL_DIR "${PROJECT_NAME}/${PROJECT_NAME}" + ) diff --git a/applications/collections/SofaComponentMisc/SofaComponentMiscConfig.cmake.in b/applications/collections/SofaComponentMisc/SofaComponentMiscConfig.cmake.in new file mode 100644 index 00000000000..d67ca035fc4 --- /dev/null +++ b/applications/collections/SofaComponentMisc/SofaComponentMiscConfig.cmake.in @@ -0,0 +1,11 @@ +# CMake package configuration file for @PROJECT_NAME@ + +@PACKAGE_INIT@ + +find_package(SofaMisc REQUIRED) + +if(NOT TARGET @PROJECT_NAME@) + include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +endif() + +check_required_components(@PROJECT_NAME@) diff --git a/modules/SofaComponentMisc/config.h b/applications/collections/SofaComponentMisc/config.h similarity index 89% rename from modules/SofaComponentMisc/config.h rename to applications/collections/SofaComponentMisc/config.h index fbc4e8d78d3..6d58152c781 100644 --- a/modules/SofaComponentMisc/config.h +++ b/applications/collections/SofaComponentMisc/config.h @@ -24,4 +24,11 @@ #include +#ifdef SOFA_BUILD_COMPONENT_MISC +# define SOFA_TARGET SofaComponentMisc +# define SOFA_COMPONENT_MISC_API SOFA_EXPORT_DYNAMIC_LIBRARY +#else +# define SOFA_COMPONENT_MISC_API SOFA_IMPORT_DYNAMIC_LIBRARY +#endif + #endif diff --git a/modules/SofaComponentMisc/initComponentMisc.cpp b/applications/collections/SofaComponentMisc/initComponentMisc.cpp similarity index 100% rename from modules/SofaComponentMisc/initComponentMisc.cpp rename to applications/collections/SofaComponentMisc/initComponentMisc.cpp diff --git a/modules/SofaComponentMisc/initComponentMisc.h b/applications/collections/SofaComponentMisc/initComponentMisc.h similarity index 100% rename from modules/SofaComponentMisc/initComponentMisc.h rename to applications/collections/SofaComponentMisc/initComponentMisc.h diff --git a/applications/packages/CMakeLists.txt b/applications/packages/CMakeLists.txt deleted file mode 100644 index e9eb7b056d3..00000000000 --- a/applications/packages/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -cmake_minimum_required(VERSION 3.1) - -sofa_add_plugin(SofaAllCommonComponents SofaAllCommonComponents ON) - diff --git a/applications/packages/SofaAllCommonComponents/SofaAllCommonComponentsConfig.cmake.in b/applications/packages/SofaAllCommonComponents/SofaAllCommonComponentsConfig.cmake.in deleted file mode 100644 index 40cc0a19cd4..00000000000 --- a/applications/packages/SofaAllCommonComponents/SofaAllCommonComponentsConfig.cmake.in +++ /dev/null @@ -1,16 +0,0 @@ -# CMake package configuration file for SofaCommon - -@PACKAGE_INIT@ - -find_package(SofaFramework REQUIRED) -find_package(SofaMisc REQUIRED) - -if(NOT TARGET SofaCommon) - include("${CMAKE_CURRENT_LIST_DIR}/SofaCommonTargets.cmake") -endif() - -check_required_components(SofaCommon) - -set(SofaCommon_LIBRARIES SofaCommon) -set(SofaCommon_INCLUDE_DIRS @PACKAGE_SOFACOMMON_INCLUDE_DIR@) - diff --git a/applications/plugins/SceneCreator/src/SceneCreator/initSceneCreator.cpp b/applications/plugins/SceneCreator/src/SceneCreator/initSceneCreator.cpp index a1334090686..c8fca9522de 100644 --- a/applications/plugins/SceneCreator/src/SceneCreator/initSceneCreator.cpp +++ b/applications/plugins/SceneCreator/src/SceneCreator/initSceneCreator.cpp @@ -49,7 +49,7 @@ void initExternalModule() /// Required for DefaultCollisionGroupManager PluginManager::getInstance().loadPlugin("SofaMiscCollision") ; - PluginManager::getInstance().loadPlugin("SofaAllCommonComponents") ; + PluginManager::getInstance().loadPlugin("SofaComponentAll") ; } const char* getModuleName() diff --git a/applications/plugins/SofaTest/Sofa_test.cpp b/applications/plugins/SofaTest/Sofa_test.cpp index 4c76292e995..ff2de9248ba 100644 --- a/applications/plugins/SofaTest/Sofa_test.cpp +++ b/applications/plugins/SofaTest/Sofa_test.cpp @@ -41,7 +41,7 @@ namespace { static struct raii { raii() { PluginManager::getInstance().loadPlugin("SceneCreator") ; - PluginManager::getInstance().loadPlugin("SofaAllCommonComponents") ; + PluginManager::getInstance().loadPlugin("SofaComponentAll") ; } } singleton; } diff --git a/applications/sofa/gui/SofaGuiCommon/CMakeLists.txt b/applications/sofa/gui/SofaGuiCommon/CMakeLists.txt index 94f6529dae0..fb9273686e0 100644 --- a/applications/sofa/gui/SofaGuiCommon/CMakeLists.txt +++ b/applications/sofa/gui/SofaGuiCommon/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.1) project(SofaGuiCommon) find_package(SofaGeneral REQUIRED) +find_package(SofaComponentAll REQUIRED) set(HEADER_FILES ../BaseGUI.h @@ -32,10 +33,7 @@ set(SOURCE_FILES ) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) -target_link_libraries(${PROJECT_NAME} PUBLIC - SofaHelper SofaGraphComponent SofaBaseCollision SofaUserInteraction SofaBaseVisual - SofaComponentBase SofaComponentCommon SofaComponentGeneral SofaComponentAdvanced SofaComponentMisc - ) +target_link_libraries(${PROJECT_NAME} PUBLIC SofaComponentAll) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_SOFAGUI") set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}") diff --git a/modules/SofaComponentAdvanced/CMakeLists.txt b/modules/SofaComponentAdvanced/CMakeLists.txt deleted file mode 100644 index 507f0eb5ab4..00000000000 --- a/modules/SofaComponentAdvanced/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(SofaComponentAdvanced) - -set(HEADER_FILES - config.h - initComponentAdvanced.h -) - -set(SOURCE_FILES - initComponentAdvanced.cpp -) - -add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) -foreach(target ${SOFAADVANCED_TARGETS}) - target_link_libraries(${PROJECT_NAME} PUBLIC ${target}) -endforeach() -set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_COMPONENT_ADVANCED") -set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}") - -sofa_install_targets(SofaAdvanced ${PROJECT_NAME} "SofaAdvanced/${PROJECT_NAME}") diff --git a/modules/SofaComponentGeneral/CMakeLists.txt b/modules/SofaComponentGeneral/CMakeLists.txt deleted file mode 100644 index cdce27d238a..00000000000 --- a/modules/SofaComponentGeneral/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(SofaComponentGeneral) - -set(HEADER_FILES - config.h - initComponentGeneral.h - ) - -set(SOURCE_FILES - initComponentGeneral.cpp - ) - -add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) -foreach(target ${SOFAGENERAL_TARGETS}) - target_link_libraries(${PROJECT_NAME} PUBLIC ${target}) -endforeach() -set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_COMPONENT_GENERAL") -set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}") - -sofa_install_targets(SofaGeneral ${PROJECT_NAME} "SofaGeneral/${PROJECT_NAME}") diff --git a/modules/SofaComponentMain/config.h b/modules/SofaComponentMain/config.h deleted file mode 100644 index 65e4f75aa4f..00000000000 --- a/modules/SofaComponentMain/config.h +++ /dev/null @@ -1,27 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture, development version * -* (c) 2006-2019 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#ifndef SOFACOMPONENTMAIN_CONFIG_H -#define SOFACOMPONENTMAIN_CONFIG_H - -@THERE@ - -#endif diff --git a/modules/SofaComponentMisc/CMakeLists.txt b/modules/SofaComponentMisc/CMakeLists.txt deleted file mode 100644 index 4dd08abbbc7..00000000000 --- a/modules/SofaComponentMisc/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(SofaComponentMisc) - -set(HEADER_FILES - config.h - initComponentMisc.h -) - -set(SOURCE_FILES - initComponentMisc.cpp -) - -add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) -foreach(target ${SOFAMISC_TARGETS}) - target_link_libraries(${PROJECT_NAME} PUBLIC ${target}) -endforeach() -set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_COMPONENT_MISC") -set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}") - -sofa_install_targets(SofaMisc ${PROJECT_NAME} "SofaMisc/${PROJECT_NAME}") diff --git a/modules/SofaConstraint/SofaConstraint_test/BilateralInteractionConstraint_test.cpp b/modules/SofaConstraint/SofaConstraint_test/BilateralInteractionConstraint_test.cpp index 5d6b15e628e..87c4be6bd72 100644 --- a/modules/SofaConstraint/SofaConstraint_test/BilateralInteractionConstraint_test.cpp +++ b/modules/SofaConstraint/SofaConstraint_test/BilateralInteractionConstraint_test.cpp @@ -68,7 +68,7 @@ struct BilateralInteractionConstraint_test : public NumericTest<> /// Create the context for the tests. void SetUp() { - sofa::simpleapi::importPlugin("SofaAllCommonComponents"); + sofa::simpleapi::importPlugin("SofaComponentAll"); sofa::simpleapi::importPlugin("SofaMiscCollision"); sofa::simpleapi::importPlugin("SofaOpenglVisual"); if(simulation==nullptr) diff --git a/modules/SofaConstraint/SofaConstraint_test/CMakeLists.txt b/modules/SofaConstraint/SofaConstraint_test/CMakeLists.txt index 12e3591f4bc..22784fa05fd 100644 --- a/modules/SofaConstraint/SofaConstraint_test/CMakeLists.txt +++ b/modules/SofaConstraint/SofaConstraint_test/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.1) project(SofaConstraint_test) +find_package(SofaComponentGeneral REQUIRED) + set(SOURCE_FILES ../../empty.cpp) list(APPEND SOURCE_FILES diff --git a/modules/SofaConstraint/SofaConstraint_test/GenericConstraintSolver_test.cpp b/modules/SofaConstraint/SofaConstraint_test/GenericConstraintSolver_test.cpp index f18c18fa1f4..86365ad7dbe 100644 --- a/modules/SofaConstraint/SofaConstraint_test/GenericConstraintSolver_test.cpp +++ b/modules/SofaConstraint/SofaConstraint_test/GenericConstraintSolver_test.cpp @@ -34,7 +34,7 @@ struct GenericConstraintSolver_test : BaseSimulationTest { void SetUp() override { - sofa::simpleapi::importPlugin("SofaAllCommonComponents"); + sofa::simpleapi::importPlugin("SofaComponentAll"); sofa::simpleapi::importPlugin("SofaMiscCollision"); } @@ -42,7 +42,7 @@ struct GenericConstraintSolver_test : BaseSimulationTest { SceneInstance sceneinstance("xml", "\n" - " " + " " " " " \n" " \n" diff --git a/modules/SofaConstraint/SofaConstraint_test/UncoupledConstraintCorrection_test.cpp b/modules/SofaConstraint/SofaConstraint_test/UncoupledConstraintCorrection_test.cpp index eaa9619f23f..952195076c6 100644 --- a/modules/SofaConstraint/SofaConstraint_test/UncoupledConstraintCorrection_test.cpp +++ b/modules/SofaConstraint/SofaConstraint_test/UncoupledConstraintCorrection_test.cpp @@ -39,7 +39,7 @@ struct UncoupledConstraintCorrection_test: public BaseSimulationTest { SceneInstance sceneinstance("xml", "\n" - " " + " " " " " \n" " \n" diff --git a/modules/SofaExporter/src/SofaExporter/initExporter.cpp b/modules/SofaExporter/src/SofaExporter/initExporter.cpp index c265da33c88..3b104926837 100644 --- a/modules/SofaExporter/src/SofaExporter/initExporter.cpp +++ b/modules/SofaExporter/src/SofaExporter/initExporter.cpp @@ -61,11 +61,9 @@ void initExternalModule() { first = false; #if SOFAEXPORTER_HAVE_SOFAPYTHON - { - SP_ADD_CLASS_IN_FACTORY(OBJExporter,sofa::component::misc::OBJExporter) - SP_ADD_CLASS_IN_FACTORY(STLExporter,sofa::component::misc::STLExporter) - } -#endif + SP_ADD_CLASS_IN_FACTORY(OBJExporter,sofa::component::misc::OBJExporter) + SP_ADD_CLASS_IN_FACTORY(STLExporter,sofa::component::misc::STLExporter) +#endif // SOFAEXPORTER_HAVE_SOFAPYTHON } } diff --git a/modules/SofaGeneralLoader/SofaGeneralLoader_test/MeshXspLoader_test.cpp b/modules/SofaGeneralLoader/SofaGeneralLoader_test/MeshXspLoader_test.cpp index 12996b6569c..90793429496 100644 --- a/modules/SofaGeneralLoader/SofaGeneralLoader_test/MeshXspLoader_test.cpp +++ b/modules/SofaGeneralLoader/SofaGeneralLoader_test/MeshXspLoader_test.cpp @@ -31,7 +31,7 @@ class MeshXspLoader_test : public BaseSimulationTest /// Run seven steps of simulation then check results bool testDefaultBehavior() { - sofa::simpleapi::importPlugin("SofaAllCommonComponents") ; + sofa::simpleapi::importPlugin("SofaComponentAll") ; auto simulation = sofa::simpleapi::createSimulation(); Node::SPtr root = sofa::simpleapi::createRootNode(simulation, "root"); @@ -45,7 +45,7 @@ class MeshXspLoader_test : public BaseSimulationTest /// Run seven steps of simulation then check results bool testInvalidFile() { - sofa::simpleapi::importPlugin("SofaAllCommonComponents") ; + sofa::simpleapi::importPlugin("SofaComponentAll") ; auto simulation = sofa::simpleapi::createSimulation(); Node::SPtr root = sofa::simpleapi::createRootNode(simulation, "root"); diff --git a/modules/SofaGeneralLoader/SofaGeneralLoader_test/ReadState_test.cpp b/modules/SofaGeneralLoader/SofaGeneralLoader_test/ReadState_test.cpp index 03e41bbcc3d..ee360b6dad6 100644 --- a/modules/SofaGeneralLoader/SofaGeneralLoader_test/ReadState_test.cpp +++ b/modules/SofaGeneralLoader/SofaGeneralLoader_test/ReadState_test.cpp @@ -35,7 +35,7 @@ class ReadState_test : public BaseSimulationTest bool testDefaultBehavior() { double dt = 0.01; - sofa::simpleapi::importPlugin("SofaAllCommonComponents") ; + sofa::simpleapi::importPlugin("SofaComponentAll") ; auto simulation = sofa::simpleapi::createSimulation(); Node::SPtr root = sofa::simpleapi::createRootNode(simulation, "root"); @@ -65,7 +65,7 @@ class ReadState_test : public BaseSimulationTest /// Run seven steps of simulation then check results bool testLoadFailure() { - sofa::simpleapi::importPlugin("SofaAllCommonComponents") ; + sofa::simpleapi::importPlugin("SofaComponentAll") ; auto simulation = sofa::simpleapi::createSimulation(); Node::SPtr root = sofa::simpleapi::createRootNode(simulation, "root"); diff --git a/modules/SofaPreconditioner/CMakeLists.txt b/modules/SofaPreconditioner/CMakeLists.txt index 389000c3271..0d995a767e9 100644 --- a/modules/SofaPreconditioner/CMakeLists.txt +++ b/modules/SofaPreconditioner/CMakeLists.txt @@ -8,7 +8,7 @@ sofa_find_package(SofaSparseSolver QUIET) # Soft dependency of PrecomputedWarpPr # Config set(HEADER_FILES - src/SofaPreconditioner/config.h + src/SofaPreconditioner/config.h.in ) set(SOURCE_FILES src/SofaPreconditioner/initPreconditioner.cpp diff --git a/modules/SofaPreconditioner/src/SofaPreconditioner/BlockJacobiPreconditioner.h b/modules/SofaPreconditioner/src/SofaPreconditioner/BlockJacobiPreconditioner.h index 5171c4400c5..e2d37e2b17a 100644 --- a/modules/SofaPreconditioner/src/SofaPreconditioner/BlockJacobiPreconditioner.h +++ b/modules/SofaPreconditioner/src/SofaPreconditioner/BlockJacobiPreconditioner.h @@ -21,7 +21,7 @@ ******************************************************************************/ #ifndef SOFA_COMPONENT_LINEARSOLVER_BLOCKJACOBIPRECONDITIONER_H #define SOFA_COMPONENT_LINEARSOLVER_BLOCKJACOBIPRECONDITIONER_H -#include "config.h" +#include #include #include diff --git a/modules/SofaPreconditioner/src/SofaPreconditioner/JacobiPreconditioner.h b/modules/SofaPreconditioner/src/SofaPreconditioner/JacobiPreconditioner.h index a9542c794e7..6ea7e21acf6 100644 --- a/modules/SofaPreconditioner/src/SofaPreconditioner/JacobiPreconditioner.h +++ b/modules/SofaPreconditioner/src/SofaPreconditioner/JacobiPreconditioner.h @@ -21,7 +21,7 @@ ******************************************************************************/ #ifndef SOFA_COMPONENT_LINEARSOLVER_JACOBIPRECONDITIONER_H #define SOFA_COMPONENT_LINEARSOLVER_JACOBIPRECONDITIONER_H -#include "config.h" +#include #include #include diff --git a/modules/SofaPreconditioner/src/SofaPreconditioner/PrecomputedWarpPreconditioner.h b/modules/SofaPreconditioner/src/SofaPreconditioner/PrecomputedWarpPreconditioner.h index 1d5f5723bbb..dc00ad83f8b 100644 --- a/modules/SofaPreconditioner/src/SofaPreconditioner/PrecomputedWarpPreconditioner.h +++ b/modules/SofaPreconditioner/src/SofaPreconditioner/PrecomputedWarpPreconditioner.h @@ -21,7 +21,7 @@ ******************************************************************************/ #ifndef SOFA_COMPONENT_LINEARSOLVER_PPRECOMPUTEDWARPPRECONDITIONER_H #define SOFA_COMPONENT_LINEARSOLVER_PPRECOMPUTEDWARPPRECONDITIONER_H -#include "config.h" +#include #include #include diff --git a/modules/SofaPreconditioner/src/SofaPreconditioner/SSORPreconditioner.h b/modules/SofaPreconditioner/src/SofaPreconditioner/SSORPreconditioner.h index c54f99ee929..a55727bfdf7 100644 --- a/modules/SofaPreconditioner/src/SofaPreconditioner/SSORPreconditioner.h +++ b/modules/SofaPreconditioner/src/SofaPreconditioner/SSORPreconditioner.h @@ -21,7 +21,7 @@ ******************************************************************************/ #ifndef SOFA_COMPONENT_LINEARSOLVER_SSORPRECONDITIONER_H #define SOFA_COMPONENT_LINEARSOLVER_SSORPRECONDITIONER_H -#include "config.h" +#include #include #include diff --git a/modules/SofaPreconditioner/src/SofaPreconditioner/ShewchukPCGLinearSolver.h b/modules/SofaPreconditioner/src/SofaPreconditioner/ShewchukPCGLinearSolver.h index 6c8597e4f87..817f66e6909 100644 --- a/modules/SofaPreconditioner/src/SofaPreconditioner/ShewchukPCGLinearSolver.h +++ b/modules/SofaPreconditioner/src/SofaPreconditioner/ShewchukPCGLinearSolver.h @@ -21,7 +21,7 @@ ******************************************************************************/ #ifndef SOFA_COMPONENT_LINEARSOLVER_ShewchukPCGLinearSolver_H #define SOFA_COMPONENT_LINEARSOLVER_ShewchukPCGLinearSolver_H -#include "config.h" +#include #include #include diff --git a/modules/SofaPreconditioner/src/SofaPreconditioner/WarpPreconditioner.h b/modules/SofaPreconditioner/src/SofaPreconditioner/WarpPreconditioner.h index 5b94be1bf4f..471c609de12 100644 --- a/modules/SofaPreconditioner/src/SofaPreconditioner/WarpPreconditioner.h +++ b/modules/SofaPreconditioner/src/SofaPreconditioner/WarpPreconditioner.h @@ -21,7 +21,7 @@ ******************************************************************************/ #ifndef SOFA_COMPONENT_LINEARSOLVER_WARPPRECONDITIONER_H #define SOFA_COMPONENT_LINEARSOLVER_WARPPRECONDITIONER_H -#include "config.h" +#include #include #include diff --git a/modules/SofaPreconditioner/src/SofaPreconditioner/config.h b/modules/SofaPreconditioner/src/SofaPreconditioner/config.h.in similarity index 97% rename from modules/SofaPreconditioner/src/SofaPreconditioner/config.h rename to modules/SofaPreconditioner/src/SofaPreconditioner/config.h.in index 6aea4d260ad..d15891aa8a5 100644 --- a/modules/SofaPreconditioner/src/SofaPreconditioner/config.h +++ b/modules/SofaPreconditioner/src/SofaPreconditioner/config.h.in @@ -24,6 +24,8 @@ #include +#cmakedefine01 SOFAPRECONDITIONER_HAVE_SOFASPARSESOLVER + #ifdef SOFA_BUILD_SOFAPRECONDITIONER # define SOFA_TARGET SofaPreconditioner # define SOFA_PRECONDITIONER_API SOFA_EXPORT_DYNAMIC_LIBRARY diff --git a/modules/SofaSparseSolver/src/SofaSparseSolver/PrecomputedLinearSolver.cpp b/modules/SofaSparseSolver/src/SofaSparseSolver/PrecomputedLinearSolver.cpp index db426b90ba0..d3f675d6223 100644 --- a/modules/SofaSparseSolver/src/SofaSparseSolver/PrecomputedLinearSolver.cpp +++ b/modules/SofaSparseSolver/src/SofaSparseSolver/PrecomputedLinearSolver.cpp @@ -22,6 +22,8 @@ // Author: Hadrien Courtecuisse // // Copyright: See COPYING file that comes with this distribution +#define SOFA_COMPONENT_LINEARSOLVER_PRECOMPUTEDLINEARSOLVER_CPP + #include namespace sofa @@ -40,6 +42,8 @@ int PrecomputedLinearSolverClass = core::RegisterObject("Linear system solver ba .add< PrecomputedLinearSolver< CompressedRowSparseMatrix , FullVector > >() ; +template class SOFA_SOFASPARSESOLVER_API PrecomputedLinearSolver< CompressedRowSparseMatrix , FullVector >; + } // namespace linearsolver } // namespace component diff --git a/modules/SofaSparseSolver/src/SofaSparseSolver/PrecomputedLinearSolver.h b/modules/SofaSparseSolver/src/SofaSparseSolver/PrecomputedLinearSolver.h index c741dba3b2c..45b862e4905 100644 --- a/modules/SofaSparseSolver/src/SofaSparseSolver/PrecomputedLinearSolver.h +++ b/modules/SofaSparseSolver/src/SofaSparseSolver/PrecomputedLinearSolver.h @@ -146,6 +146,10 @@ private : std::vector isActiveDofs; }; +#if !defined(SOFA_COMPONENT_LINEARSOLVER_PRECOMPUTEDLINEARSOLVER_CPP) +extern template class SOFA_SOFASPARSESOLVER_API PrecomputedLinearSolver< CompressedRowSparseMatrix , FullVector >; +#endif + } // namespace linearsolver } // namespace component diff --git a/modules/SofaSparseSolver/src/SofaSparseSolver/config.h.in b/modules/SofaSparseSolver/src/SofaSparseSolver/config.h.in index a76ee9d9dd2..9708d1d9ef6 100644 --- a/modules/SofaSparseSolver/src/SofaSparseSolver/config.h.in +++ b/modules/SofaSparseSolver/src/SofaSparseSolver/config.h.in @@ -22,7 +22,7 @@ #ifndef SOFASPARSESOLVER_CONFIG_H #define SOFASPARSESOLVER_CONFIG_H -#include +#include #cmakedefine01 SOFASPARSESOLVER_HAVE_METIS #cmakedefine01 SOFASPARSESOLVER_HAVE_CSPARSE diff --git a/modules/tests/CMakeLists.txt b/modules/tests/CMakeLists.txt index a059d525929..a9f586235c4 100644 --- a/modules/tests/CMakeLists.txt +++ b/modules/tests/CMakeLists.txt @@ -7,7 +7,6 @@ set(SOFA_EXT_MODULES_SOURCE_DIR ..) set(SOFA_EXT_MODULES_BINARY_DIR ${CMAKE_BINARY_DIR}) # SofaBase tests -add_subdirectory(${SOFA_KERNEL_MODULES_SOURCE_DIR}/SofaComponentBase/SofaComponentBase_test ${SOFA_KERNEL_MODULES_BINARY_DIR}/SofaBase/SofaComponentBase/SofaComponentBase_test) add_subdirectory(${SOFA_KERNEL_MODULES_SOURCE_DIR}/SofaBaseCollision/SofaBaseCollision_test ${SOFA_KERNEL_MODULES_BINARY_DIR}/SofaBase/SofaBaseCollision/SofaBaseCollision_test) add_subdirectory(${SOFA_KERNEL_MODULES_SOURCE_DIR}/SofaBaseLinearSolver/SofaBaseLinearSolver_test ${SOFA_KERNEL_MODULES_BINARY_DIR}/SofaBase/SofaBaseLinearSolver/SofaBaseLinearSolver_test) add_subdirectory(${SOFA_KERNEL_MODULES_SOURCE_DIR}/SofaBaseMechanics/SofaBaseMechanics_test ${SOFA_KERNEL_MODULES_BINARY_DIR}/SofaBase/SofaBaseMechanics/SofaBaseMechanics_test) @@ -53,3 +52,6 @@ add_subdirectory(${SOFA_EXT_MODULES_SOURCE_DIR}/SofaMiscMapping/SofaMiscMapping_ add_subdirectory(${SOFA_EXT_MODULES_SOURCE_DIR}/SofaMiscSolver/SofaMiscSolver_test ${SOFA_EXT_MODULES_BINARY_DIR}/SofaMisc/SofaMiscSolver/SofaMiscSolver_test) add_subdirectory(${SOFA_EXT_MODULES_SOURCE_DIR}/SofaMiscTopology/SofaMiscTopology_test ${SOFA_EXT_MODULES_BINARY_DIR}/SofaMisc/SofaMiscTopology/SofaMiscTopology_test) add_subdirectory(${SOFA_EXT_MODULES_SOURCE_DIR}/SofaMiscForceField/SofaMiscForceField_test ${SOFA_EXT_MODULES_BINARY_DIR}/SofaMisc/SofaMiscForceField/SofaMiscForceField_test) + +# SofaComponent* tests +add_subdirectory(${CMAKE_SOURCE_DIR}/applications/collections/SofaComponentBase/SofaComponentBase_test ${SOFA_EXT_MODULES_BINARY_DIR}/applications/collections/SofaComponentBase/SofaComponentBase_test) \ No newline at end of file diff --git a/package.cmake b/package.cmake index e914f7fe49d..42f76e7127a 100644 --- a/package.cmake +++ b/package.cmake @@ -58,7 +58,7 @@ setSofaOption(MODULE_SOFAOPENGLVISUAL ON) message("-------- Setting some plugins ON --------") -setSofaOption(PLUGIN_SOFAALLCOMMONCOMPONENTS ON) +setSofaOption(PLUGIN_SOFACOMPONENTALL ON) setSofaOption(PLUGIN_CIMGPLUGIN ON) setSofaOption(PLUGIN_COMPLIANT ON) setSofaOption(PLUGIN_DIFFUSIONSOLVER ON)