Home › Forum › SOFA › Building SOFA › [SOLVED] Can’t build PluginExample
Tagged: 64_bits, GCC, Linux_ubuntu, SOFA_1512
- This topic has 10 replies, 4 voices, and was last updated 8 years, 3 months ago by Madani.
-
AuthorPosts
-
12 April 2016 at 08:13 #6526fgafarovBlocked
I’m trying to build the PluginExample plugin, but I receive an error:
~/sofa/v15.12/build/applications/plugins/PluginExample$ cmake .
CMake Error at CMakeLists.txt:28 (find_package):
By not providing “FindSofaGui.cmake” in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by “SofaGui”, but
CMake did not find one.Could not find a package configuration file provided by “SofaGui” with any
of the following names:SofaGuiConfig.cmake
sofagui-config.cmakeAdd the installation prefix of “SofaGui” to CMAKE_PREFIX_PATH or set
“SofaGui_DIR” to a directory containing one of the above files. If
“SofaGui” provides a separate development package or SDK, be sure it has
been installed.— Configuring incomplete, errors occurred!
Please, help me
12 April 2016 at 12:58 #6528MadaniBlockedcan you post your CMAKELists.txt in PluginExample?
and do you want to add anything else to Plugin or just want to see the default plugin?12 April 2016 at 13:38 #6530fgafarovBlockedI am using default plugin.
It is CMAKELists.txt file:
cmake_minimum_required(VERSION 2.8.12) project(PluginExample) set(HEADER_FILES MyBehaviorModel.h MyMappingPendulumInPlane.h MyMappingPendulumInPlane.inl MyProjectiveConstraintSet.h MyProjectiveConstraintSet.inl config.h ) set(HEADER_FILES_TO_MOC MyDataWidgetUnsigned.h ) set(SOURCE_FILES MyBehaviorModel.cpp MyDataWidgetUnsigned.cpp MyMappingPendulumInPlane.cpp MyProjectiveConstraintSet.cpp initPlugin.cpp ) set(README_FILES PluginExample.txt) find_package(SofaGui REQUIRED) find_package(Qt5 COMPONENTS Core QUIET) if(Qt5Core_FOUND) qt5_wrap_cpp(MOCCED_HEADER_FILES ${HEADER_FILES_TO_MOC}) else() find_package(Qt4 COMPONENTS qtcore) qt4_wrap_cpp(MOCCED_HEADER_FILES ${HEADER_FILES_TO_MOC}) endif() add_library(${PROJECT_NAME} SHARED ${HEADER_FILES_TO_MOC} ${MOCCED_HEADER_FILES} ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES}) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_PLUGINEXAMPLE") target_link_libraries(${PROJECT_NAME} SofaGuiQt) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") install(TARGETS ${PROJECT_NAME} COMPONENT PluginExample_libraries EXPORT PluginExampleTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
12 April 2016 at 14:28 #6531MadaniBlockedI checked it with mine and it seems fine. I think Cmake has problem finding your SofaGUI. Try to follow the compilation steps in https://www.sofa-framework.org/community/doc/getting-started/build/build-on-windows/
let me know if it works or not.
Regards,
Mehdi
14 April 2016 at 08:58 #6534fgafarovBlockedThank you. But I am working on Ubuntu not on Windows. I have not experience with cmake earlier.
My steps:
1) I have compiled and run Sofa according https://www.sofa-framework.org/community/doc/getting-started/build/build-on-linux/
2) copied PluginExample to /sofa/v15.12/build/applications/plugins/
3) in /sofa/v15.12/build/applications/plugins/PluginExample executed command cmake .and I have the error mentioned above.
14 April 2016 at 10:14 #6535FabienBlockedStep 2 and step 3 are not right.
– Copy PluginExample to /sofa/v15.12/src/applications/plugins/
– Update /sofa/v15.12/src/applications/plugins/CMakeLists.txt
– Run from directory /sofa/v15.12/build/ the command ccmake ../src/
– Activate the line PLUGIN_PLUGINEXAMPLE
– Configure and finally Generate20 April 2016 at 17:58 #6551fgafarovBlockedThank you!
– Copy PluginExample to /sofa/v15.12/src/applications/plugins/ — the PluginExample is initially in this folder– Update /sofa/v15.12/src/applications/plugins/CMakeLists.txt — I can’t understand what I should do, what means ‘Update’. This file initially contains sofa_add_plugin(PluginExample PluginExample)
– Activate the line PLUGIN_PLUGINEXAMPLE — Where is this line
– Configure and finally Generate –please write me which commands I need to execute20 April 2016 at 19:43 #6552FabienBlocked– Copy PluginExample to /sofa/v15.12/src/applications/plugins/ — the PluginExample is initially in this folder
Yes my bad, by that I mean you shouldn’t copy it elsewhere 🙂
– Update /sofa/v15.12/src/applications/plugins/CMakeLists.txt — I can’t understand what I should do, what means ‘Update’. This file initially contains sofa_add_plugin(PluginExample PluginExample)
Then everything is ok there
– Activate the line PLUGIN_PLUGINEXAMPLE — Where is this line
– Configure and finally Generate –please write me which commands I need to executeYou should do first
cd build/ cmake-gui ../src/
Then tick the box appearing on the line where PLUGIN_PLUGINEXAMPLE is written
Followed by click Configure until no line appears red and finish with a click on Generate
Finally type make in the terminal in the build/ directoryI hope this helps.
6 June 2016 at 14:54 #7032HugoKeymaster10 August 2016 at 09:23 #7307HugoKeymaster15 August 2016 at 09:04 #7362MadaniBlockedHey Hugo!
My problem is solved and thanks again for your assistance!
Regards,
Mehdi
-
AuthorPosts
- You must be logged in to reply to this topic.