Home › Forum › SOFA › Programming with SOFA › [SOLVED] Calling header files between sofa plugins
Tagged: 64_bits, CMakeLists.txt, configurations, Fedora 64 bits, Linux_mint, plugin, SOFA, SOFA_1706
- This topic has 17 replies, 2 voices, and was last updated 6 years, 8 months ago by bgarcial.
-
AuthorPosts
-
9 March 2018 at 23:16 #10597bgarcialBlocked
Hi Sofa People
Currently, I have two plugins such as follow:
/applications/plugins/SerialCommunication
/applications/plugins/ZMQCommunication
We need to use some
SerialCommunication
classes fromZMQCommunication
pluginIn
SerialCommunication
, we have the following in theSerialDriver.h
:namespace sofa { namespace simulation { class Node; } namespace component { namespace visualModel { class OglModel; } namespace controller { class SerialDriver : public sofa::core::objectmodel::BaseObject { private: float posDOFEST; void handleEvent(core::objectmodel::Event *); bool noDevice; //Serial Functions int serial_open(char *serial_name, speed_t baud); void serial_send(int serial_fd, char *data, int size); int serial_read(int serial_fd, char *data, int size, int timeout_usec); void serial_close(int fd); }; } } }
From
ZMQCommunication
plugin we want import and use theSerialDriver
class methods and we try use the respective namespaces such as following:#include <../SerialCommunication/SerialDriver.h> using sofa::component::controller; SerialDriver serial;
And this does not work and we get an error which says:
In file included from /home/asanchez/Universidad/Investigación/Christian/SimDesign2/src/applications/plugins/ZeroMQCommunication/ZMQServerComponent.cpp:7:0: /home/asanchez/Universidad/Investigación/Christian/SimDesign2/src/applications/plugins/ZeroMQCommunication/ZMQServerComponent.h:5:49: fatal error: ../SerialCommunication/SerialDriver.h: No such file or directory <strong>#include <../SerialCommunication/SerialDriver.h></strong>
In addition, we get these other errors:
applications/plugins/ZeroMQCommunication/ZMQServerComponent.cpp: In member function ‘void sofa::component::controller::ZMQServerComponent::instrumentDataSend(sofa::component::controller::instrumentData)’: /home/asanchez/Universidad/Investigación/Christian/SimDesign2/src/applications/plugins/ZeroMQCommunication/ZMQServerComponent.cpp:49:5: error: ‘SerialDriver’ was not declared in this scope SerialDriver serial;
How can I instance the
SerialCommunication
classes fromZMQCommunication
classes to be used?We are using Fedora 24 x64
12 March 2018 at 10:19 #10599GuillaumeKeymasterHi bgarcial,
Using components from another plugin is very similar to using components from a SOFA module. I think you missed the CMake part.
Here are the main steps :
1. Create your plugin’s CMake variables:find_package(SerialCommunication)
2. Get access to your plugin files:target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${SerialCommunication_INCLUDE_DIRS}>")
3. Link with your plugin:target_link_libraries(${PROJECT_NAME} SerialCommunication)
An example is available in
applications/plugins/image
. See how it includes CImgPlugin.Hope that helps,
Guillaume.16 March 2018 at 23:13 #10690bgarcialBlockedHi Guillaume,
In first instance thanks for their answering
I followed the steps that you described above, in the CMakeList.txt of ZMQCommunication plugin I Include following things.
1. Create your plugin’s CMake variables:
find_package(SerialCommunication)
2. Get access to your plugin files:target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${SerialCommunication_INCLUDE_DIRS}>")
3. Link with your plugin:target_link_libraries(${PROJECT_NAME} SerialCommunication)
But When I compiled I got the next error:
Adding Plugin ZeroMQCommunication CMake Error at applications/plugins/ZeroMQCommunication/CMakeLists.txt:23 (find_package): By not providing "FindSerialComunication.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "SerialComunication", but CMake did not find one. Could not find a package configuration file provided by "SerialComunication" with any of the following names: SerialComunicationConfig.cmake serialcomunication-config.cmake Add the installation prefix of "SerialComunication" to CMAKE_PREFIX_PATH or set "SerialComunication_DIR" to a directory containing one of the above files. If "SerialComunication" provides a separate development package or SDK, be sure it has been installed.
What can I do? I tried to create
SerialComunicationConfig.cmake
and I can’t solve that problemI really would appreciate the support that you can give me.
19 March 2018 at 10:55 #10691GuillaumeKeymasterHi,
Every SOFA plugin has to generate a MyPluginConfig.cmake file to permit others to find it with
find_package
.
In SerialCommunication, to generate this file, you have to create a SerialCommunicationConfig.cmake.in that will be handled bysofa_create_package
.See how it is done for example in the LeapMotion plugin 😉
Guillaume.
21 March 2018 at 00:03 #10705bgarcialBlockedHi Guillaume.
I don’t understand what is FindSerialComunication because the name of my plugin is SerialComunication. Aditionally, I’ve created SerialComunicationConfig.cmake.in but anyway continues.
The structure directory of my SerialComunication plugin is:
SerialComunication
CMakeLists.txt
initSerial.cpp
SerialComunicationConfig.cmake.in
SerialDriver.cpp
SerialDriver.hand SerialComunicationConfig.cmake has the following content:
# CMake package configuration file for the LeapMotion library @PACKAGE_INIT@ set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH} @CMAKE_MODULE_PATH@") find_package(SofaFramework REQUIRED) find_package(SofaBase REQUIRED) find_package(SofaGeneral REQUIRED) #link_directories(@LEAP_INCLUDE_DIR@) #find_package(Leap REQUIRED) if(NOT TARGET SerialComunication) include("${CMAKE_CURRENT_LIST_DIR}/SerialComunicationTargets.cmake") endif() set(SerialComunication_LIBRARIES SerialComunication) set(SerialComunication_INCLUDE_DIRS @PACKAGE_SERIALCOMUNICATION_INCLUDE_DIR@)
21 March 2018 at 00:04 #10706bgarcialBlockedHi Guillaume, I don’t understand what is FindSerialComunication because the name of my plugin is SerialComunitacion. Additionally, I created SerialComunicationConfig.cmake.in but anyway the error continues.
21 March 2018 at 11:13 #10707GuillaumeKeymasterHi,
Sorry I didn’t mean FindSerialCommunication but SerialCommunication. I just updated my previous post.
Could you show me the CMakeLists.txt of SerialCommunication and the CMakeLists.txt of ZeroMQCommunication please?
We are close to the solution 😉
Guillaume.21 March 2018 at 15:58 #10708bgarcialBlockedHi Guillaume, thank you so much for your help, here is the code of those files:
CMakeLists.txt of SerialCommunication
cmake_minimum_required(VERSION 2.8.12) project(SerialComunication) set(HEADER_FILES SerialDriver.h ) set(SOURCE_FILES SerialDriver.cpp initSerial.cpp ) find_package(SofaFramework REQUIRED) find_package(SofaBase REQUIRED) find_package(SofaGeneral REQUIRED) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) set_target_properties(${PORJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_SERIALPLUGIN") target_link_libraries(${PROJECT_NAME} SofaCore SofaComponentGeneral) install(TARGETS ${PROJECT_NAME} COMPONENT SerialComunication_libraries EXPORT SerialComunicationTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) install(DIRECTORY examples/ DESTINATION share/sofa/plugins/${PROJECT_NAME})
CMakeLists.txt of ZMQCommunication
cmake_minimum_required(VERSION 3.1) project(ZeroMQCommunication) set(HEADER_FILES initZeroMQCommunication.h ZMQServerComponent.h PointNet.h SofaTypeMessages.h ) set(SOURCE_FILES initZeroMQCommunication.cpp ZMQServerComponent.cpp PointNet.cpp SofaTypeMessages.cpp ) set(EXTRA_FILES README.md ) find_package(SofaFramework REQUIRED) find_package(SerialComunication REQUIRED) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${EXTRA_FILES}) target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${SerialComunication_INCLUDE_DIRS}>") target_link_libraries(${PROJECT_NAME} -lzmq ${} SofaCore) target_link_libraries(${PROJECT_NAME} SerialComunication) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_ZeroMQCommunication") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") install(TARGETS ZMQCommunication RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
I really would appreciate the support that you can give me 🙂
22 March 2018 at 10:39 #10711GuillaumeKeymasterAs I said in my previous reply, to use SerialCommunication from ZMQCommunication you have to make SerialCommunication findable by creating a SerialCommunicationConfig.cmake.in (you did it) AND by calling
sofa_create_package
in SerialCommunication’s CMakeLists.
To understand what sofa_create_package does, check SofaMacros.cmakeHere is a corrected version of SerialCommunication’s CMakeLists:
cmake_minimum_required(VERSION 2.8.12) project(SerialComunication) set(${PROJECT_NAME}_VERSION 1.0) set(HEADER_FILES SerialDriver.h ) set(SOURCE_FILES SerialDriver.cpp initSerial.cpp ) find_package(SofaFramework REQUIRED) find_package(SofaBase REQUIRED) find_package(SofaGeneral REQUIRED) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) set_target_properties(${PORJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_SERIALPLUGIN") target_link_libraries(${PROJECT_NAME} SofaCore SofaComponentGeneral) ## Install rules for the library; CMake package configurations files sofa_create_package(${PROJECT_NAME} ${${PROJECT_NAME}_VERSION} ${PROJECT_NAME} ${PROJECT_NAME}) install(DIRECTORY examples/ DESTINATION share/sofa/plugins/${PROJECT_NAME})
27 March 2018 at 16:01 #1072927 March 2018 at 18:16 #10730bgarcialBlockedHi @guillaumeparan
At this moment my partner and I we are awaiting find us again to test this latest consideration which you gave us.Coming soon we keep you informed about it.
Thanks for being pending2 April 2018 at 22:04 #10740bgarcialBlockedHi @guillaumeparan
Again, thanks a lot to you for the support. Our apologies for the late in response in relation to the progress topic.The last recommendation that you give us it’s working, finally, we can call
SerialCommunication
Plug-in fromZeroMQCommunication
, but when we can try to apply the opposite objective, CallZeroMQCommunication
fromSerialCommunication
we got the following error:CMake Error at applications/plugins/SerialComunication/CMakeLists.txt:18 (find_package): By not providing "FindZeroMQCommunication.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "ZeroMQCommunication", but CMake did not find one. Could not find a package configuration file provided by "ZeroMQCommunication" with any of the following names: ZeroMQCommunicationConfig.cmake zeromqcommunication-config.cmake Add the installation prefix of "ZeroMQCommunication" to CMAKE_PREFIX_PATH or set "ZeroMQCommunication_DIR" to a directory containing one of the above files. If "ZeroMQCommunication" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! See also "/home/asanchez/Universidad/Investigación/Christian/SimDesign2/build/v17.06/CMakeFiles/CMakeOutput.log". See also "/home/asanchez/Universidad/Investigación/Christian/SimDesign2/build/v17.06/CMakeFiles/CMakeError.log". Makefile:1842: recipe for target 'cmake_check_build_system' failed make: *** [cmake_check_build_system] Error 1
This is our
CmakeList.txt
ofZeroMQCommunication
plugin, in which we are including thesofa_create_package
directivecmake_minimum_required(VERSION 2.8.12) project(ZeroMQCommunication) set(${PROJECT_NAME}_VERSION 1.0) set(HEADER_FILES initZeroMQCommunication.h ZMQClientComponent.h PointNet.h SofaTypeMessages.h ) set(SOURCE_FILES initZeroMQCommunication.cpp ZMQClientComponent.cpp PointNet.cpp SofaTypeMessages.cpp ) set(EXTRA_FILES README.md ) find_package(SofaFramework REQUIRED) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${EXTRA_FILES}) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_ZEROMQCOMMUNICATION") target_link_libraries(${PROJECT_NAME} -lzmq ${} SofaCore) ## Install rules for the library; CMake package configurations files sofa_create_package(${PROJECT_NAME} ${${PROJECT_NAME}_VERSION} ${PROJECT_NAME} ${PROJECT_NAME}) install(DIRECTORY examples/ DESTINATION share/sofa/plugins/${PROJECT_NAME})
In addition, we did have to make
ZeroMQCommunication
findable by creating aZeroMQCommunicationConfig.cmake.in
file which has the following content:# CMake package configuration file for the ZMQCommunication library @PACKAGE_INIT@ set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH} @CMAKE_MODULE_PATH@") find_package(SofaFramework REQUIRED) find_package(SofaBase REQUIRED) find_package(SofaGeneral REQUIRED) if(NOT TARGET ZeroMQCommunication) include("${CMAKE_CURRENT_LIST_DIR}/ZeroMQCommunicationTargets.cmake") endif() set(ZeroMQCommunication_LIBRARIES ZeroMQCommunication) set(ZeroMQCommunication_INCLUDE_DIRS @PACKAGE_ZEROMQCOMMUNICATION_INCLUDE_DIR@)
Thank you for your help.
6 April 2018 at 17:19 #10762bgarcialBlockedMy apologies for the inconvenience
Can you give us any suggests or recommend it?In addition I was not correctly making the mention to your username profile @guillaumeparan 😛
9 April 2018 at 14:07 #10768GuillaumeKeymasterHi,
I never tried to create a circular dependency between plugins and I don’t think it is a good idea actually.
Are you sure your design is OK?Guillaume.
9 April 2018 at 15:20 #10769bgarcialBlockedHi @guillaumeparan.
Again thanks for your support 🙂
Is possible that I did haven’t a clear explanation in my latest posts in this question. It’s not circular dependency, at this moment, we want a call to
ZeroMQCommunication
fromSerialCommunication
and nothing more. Of course, a circular dependency it’s definitively a bad idea.Basically, the error which we get it’s related to our firsts interactions on this question, but we cannot meet how to address it.
In this latest post on this question we are making to make
ZeroMQCommunication
findable by creating aZeroMQCommunicationConfig.cmake.in
but the error persist14 April 2018 at 02:25 #10774bgarcialBlockedI’ve created and builded on SOFA of a separately way these two plugins:
/applications/plugins/SerialComunication
– SerialComunication plugin
/applications/plugins/ZeroMQCommunication
– ZeroMQCommunication pluginOn my plugins/CMakeLists.txt global configuration plugins I’ve added together plugins in this way:
sofa_add_plugin(SerialComunication SerialComunication) sofa_add_plugin(ZeroMQCommunication ZeroMQCommunication ON)
Currently, I want from
SerialComunication
plugin call or include theZeroMQCommunication
In other question, @guillaumeparan was supported me in relation to this task. He told me the following:
Every SOFA plugin has to generate a MyPluginConfig.cmake file to permit others to find it with
find_package
.Then, in ZeroMQCommunication, I’ve created the
ZeroMQCommunicationConfig.cmake.in
file based on the same file in the LeapMotion pluginSo, this is my
ZeroMQCommunicationConfig.cmake.in
file:# CMake package configuration file for the ZeroMQCommunication library @PACKAGE_INIT@ set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH} @CMAKE_MODULE_PATH@") find_package(SofaFramework REQUIRED) find_package(SofaBase REQUIRED) find_package(SofaGeneral REQUIRED) # link_directories(@LEAP_INCLUDE_DIR@) # find_package(Leap REQUIRED) if(NOT TARGET ZeroMQCommunication) include("${CMAKE_CURRENT_LIST_DIR}/ZeroMQCommunicationTargets.cmake") endif() set(ZeroMQCommunication_LIBRARIES ZeroMQCommunication) set(ZeroMQCommunication_INCLUDE_DIRS @PACKAGE_ZEROMQCOMMUNICATION_INCLUDE_DIR@)
In this way, I did make findable to
ZeroMQCommunication
plugin and from theSerialComunication/CMakeList.txt
I’ve added the following directives line variables:find_package(ZeroMQCommunication REQUIRED)
to find the ZeroMQCommunication plugin. I guess that makes this viaZeroMQCommunicationConfig.cmake.in
file created previously, I am not sure …target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${ZeroMQCommunication_INCLUDE_DIRS}>")
to get access to ZeroMQCommunication plugin filestarget_link_libraries(${PROJECT_NAME} ZeroMQCommunication)
to linking with ZeroMQCommunication pluginThen my
SerialComunication/CMakeList.txt
file has been stayed complete in this way:cmake_minimum_required(VERSION 2.8.12) project(SerialComunication) set(HEADER_FILES SerialDriver.h ) set(SOURCE_FILES SerialDriver.cpp initSerial.cpp ) find_package(SofaFramework REQUIRED) find_package(SofaBase REQUIRED) find_package(SofaGeneral REQUIRED) # Added find_package(ZeroMQCommunication REQUIRED) # list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") # include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) # ---------------------------------------- # Added. Get access to ZeroMQCommunication plugin files: target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${ZeroMQCommunication_INCLUDE_DIRS}>") # --------------------------------------- # ---------------------------------------- # Added. Linking with ZeroMQCommunication target_link_libraries(${PROJECT_NAME} ZeroMQCommunication) # ---------------------------------------- set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_SerialComunication") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") install(TARGETS SerialComunication RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
Finally, Guillerme told me that is necessary use the
sofa_create_package
directive which will handleZeroMQCommunicationConfig.cmake.in
file, or at least that’s what I understood 😛Then, until here, I’ve made findable ZeroMQCommunication from SerialComunication. Now I should call the
sofa_create_package
in theZeroMQCommunication/CMakeList.txt
which has stayed of the following way:cmake_minimum_required(VERSION 2.8.12) project(ZeroMQCommunication) set(HEADER_FILES initZeroMQCommunication.h ZMQClientComponent.h PointNet.h SofaTypeMessages.h ) set(SOURCE_FILES initZeroMQCommunication.cpp ZMQClientComponent.cpp PointNet.cpp SofaTypeMessages.cpp ) set(EXTRA_FILES README.md ) find_package(SofaFramework REQUIRED) find_package(SofaBase REQUIRED) find_package(SofaGeneral REQUIRED) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${EXTRA_FILES}) target_link_libraries(${PROJECT_NAME} -lzmq ${} SofaCore) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_ZEROPLUGIN") # set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_SERIALPLUGIN") # set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_ZeroMQCommunication") target_link_libraries(${PROJECT_NAME} SofaCore SofaComponentGeneral) ## Added! Install rules for the library; CMake package configurations files # sofa_create_package(${PROJECT_NAME} ${${ZEROMQCOMMUNICATION}_VERSION} ${PROJECT_NAME} ${PROJECT_NAME}) sofa_create_package(${PROJECT_NAME} ${${PROJECT_NAME}_VERSION} ${PROJECT_NAME} ${PROJECT_NAME}) install(DIRECTORY examples/ DESTINATION share/sofa/plugins/${PROJECT_NAME})
When I build sofa I get this error:
λ bgarcial [sofa/build/v17.06] → make -j7 -- Install prefix: /home/bgarcial/workspace/sofa/build/v17.06/install -- Boost version: 1.58.0 -- Boost version: 1.58.0 -- Found the following Boost libraries: -- system -- filesystem -- locale -- thread -- date_time -- chrono -- atomic -- SofaSparseSolver: metis was not found, SparseLDLSolver won't be built -- SofaSparseSolver: csparse was found, SparseLUSolver and SparseCholeskySolver will be built QGLViewer: Using Qt5 SofaGUIQt: Using Qt5 -- SofaTest: optional dependency SofaPython NOT found, Python_test won't be built Adding Plugin CImgPlugin -- CImgPlugin: Enable TIFF Image Format -- CImgPlugin: Enable JPEG Image Format -- CImgPlugin: Enable PNG Image Format Adding Plugin SerialComunication CMake Error at applications/plugins/SerialComunication/CMakeLists.txt:18 (find_package): By not providing "FindZeroMQCommunication.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "ZeroMQCommunication", but CMake did not find one. Could not find a package configuration file provided by "ZeroMQCommunication" with any of the following names: ZeroMQCommunicationConfig.cmake zeromqcommunication-config.cmake Add the installation prefix of "ZeroMQCommunication" to CMAKE_PREFIX_PATH or set "ZeroMQCommunication_DIR" to a directory containing one of the above files. If "ZeroMQCommunication" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! See also "/home/bgarcial/workspace/sofa/build/v17.06/CMakeFiles/CMakeOutput.log". See also "/home/bgarcial/workspace/sofa/build/v17.06/CMakeFiles/CMakeError.log". Makefile:1840: recipe for target 'cmake_check_build_system' failed make: *** [cmake_check_build_system] Error 1 λ bgarcial [sofa/build/v17.06] →
This
CMake Error at applications/plugins/SerialComunication/CMakeLists.txt:18
error is related when I callZeroMQCommunication
fromSerialComunication
, exactly in this linefind_package(ZeroMQCommunication REQUIRED)
Additionally, SOFA propose to me one solution and it’s related with:
Add the installation prefix of "ZeroMQCommunication" to CMAKE_PREFIX_PATH or set "ZeroMQCommunication_DIR" to a directory containing one of the above files . If "ZeroMQCommunication" provides a separate development package or SDK, be sure it has been installed.
The, I’ve renamed the ZeroMQCommunicationConfig.cmake.in file to ZeroMQCommunicationConfig.cmake file.
Then I’ve searched and checked and when I perform the
cmake-gui ../../src
command In the interface I found theZeroMQCommunication_DIR
variable and I set their value to the ZeroMQCommunication folder, in which is located theZeroMQCommunicationConfig.cmake
fileAnd when I configure or build again I get this different error:
Adding Plugin SerialComunication CMake Error: Error in cmake code at /home/bgarcial/workspace/sofa/src/applications/plugins/ZeroMQCommunication/ZeroMQCommunicationConfig.cmake:3: Parse error. Expected a command name, got unquoted argument with text "@PACKAGE_INIT@". CMake Error at applications/plugins/SerialComunication/CMakeLists.txt:18 (find_package): find_package Error reading CMake code from "/home/bgarcial/workspace/sofa/src/applications/plugins/ZeroMQCommunication/ZeroMQCommunicationConfig.cmake". Adding Plugin ZeroMQCommunication CMake Error at applications/plugins/ZeroMQCommunication/CMakeLists.txt:39 (sofa_create_package): sofa_create_package Macro invoked with incorrect arguments for macro named: sofa_create_package Adding Application Modeler Modeler executable: Using Qt5 Modeler library: Using Qt5 Adding Application runSofa Configuring incomplete, errors occurred! See also "/home/bgarcial/workspace/sofa/build/v17.06/CMakeFiles/CMakeOutput.log". See also "/home/bgarcial/workspace/sofa/build/v17.06/CMakeFiles/CMakeError.log".
Is very very possible that something it’s wrong of my part in all these configuration and call process described above …
I’m sure there is an obvious fix for this, or unless more logic but I haven’t found it yet even despite of Guillerme support
16 April 2018 at 16:11 #10777GuillaumeKeymasterHey, I just merged your new topic to this one, no need to separate both.
Thanks for the summary but I’m still unsure of which plugin you want to be the parent plugin and which one to be the child plugin.
Anyway, here are my advices rephrased with “parent plugin” and “child plugin”.
– The parent plugin must be findable so it has to contain a XXXConfig.cmake.in file and to call
sofa_create_package
in its CMakeLists.– The child plugin must call
find_package
to find the parent plugin and will then be able to link with it intarget_link_libraries
.– The two plugins must be added with
sofa_add_plugin
in the right order: first the parent, then the child.Hope that helps,
Guillaume.17 April 2018 at 16:48 #10778bgarcialBlockedHi Guillaurme, it’s true, my apologies for create a new post with the same topic.
Currently, and with your analysis about of plugin child and parent plugin, my needs are related with the first question on this topic question in where from ZMQCommunication (parent plugin), I include to SerialCommunication (child plugin)
In this way I was able to get what I wanted, which was a first step to start integrating these two plugins/components into a scene
In this ideas order my question has been solved
Thaks a lot for you for the support. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.