-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
open62541: add scripts to generate custom servers #7314
open62541: add scripts to generate custom servers #7314
Conversation
This comment has been minimized.
This comment has been minimized.
I don't fully understand these changes. Who does provide the cmake function |
recipes/open62541/all/conanfile.py
Outdated
@@ -361,6 +377,12 @@ def package_info(self): | |||
os.path.join("include", "plugin") | |||
] | |||
|
|||
#required for creating servers from ua nodesets | |||
self.env_info.open62541_TOOLS_DIR = os.path.join(self.package_folder, "share", "tools") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a cmake variable, not an environment variable.
https://github.com/open62541/open62541/search?q=open62541_TOOLS_DIR
I think you need to add this variable to a cmake script.
Like lib/cmake/open62541/open62541Macros.cmake
, but then specific for this variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using an environment variable is problematic when using a 2 profile build (one for host and one for build machine), because environment variables from host requirements are not applied.
recipes/open62541/all/conanfile.py
Outdated
self.copy("generate_*.py", dst="share/tools", src=self._tools_subfolder) | ||
self.copy("nodeset_compiler/*", dst="share/tools", src=self._tools_subfolder) | ||
#use local local ua-nodeset instead of the OPC Founation files (NOT RECOMMENDED) Use the UA-Nodeset package instead | ||
#self.copy("ua-nodeset/*", dst="share", src=self._deps_subfolder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.copy("generate_*.py", dst="share/tools", src=self._tools_subfolder) | |
self.copy("nodeset_compiler/*", dst="share/tools", src=self._tools_subfolder) | |
#use local local ua-nodeset instead of the OPC Founation files (NOT RECOMMENDED) Use the UA-Nodeset package instead | |
#self.copy("ua-nodeset/*", dst="share", src=self._deps_subfolder) | |
self.copy("generate_*.py", src=self._tools_subfolder, dst=os.path.join("res", "tools")) | |
self.copy("nodeset_compiler/*", src=self._tools_subfolder, dst=os.path.join("res", "tools")) |
recipes/open62541/all/conanfile.py
Outdated
return os.path.join(self._source_subfolder, "tools") | ||
|
||
# @property | ||
# def _deps_subfolder(self): | ||
# return os.path.join(self._source_subfolder, "deps") | ||
|
||
def package(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return os.path.join(self._source_subfolder, "tools") | |
# @property | |
# def _deps_subfolder(self): | |
# return os.path.join(self._source_subfolder, "deps") | |
def package(self): | |
return os.path.join(self._source_subfolder, "tools") | |
def package(self): |
recipes/open62541/all/conanfile.py
Outdated
@@ -322,10 +322,18 @@ def _configure_cmake(self): | |||
|
|||
def build(self): | |||
for patch in self.conan_data.get("patches", {}).get(self.version, []): | |||
tools.patch(**patch) | |||
tools.patch(**patch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tools.patch(**patch) | |
tools.patch(**patch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@madebr I add the requirement for the ua-nodeset directly in my application "the OPC UA server" since probably I will only require it when I am creating a server using the ua-nodeset compiler.
regarding the ua_generate_nodeset_and_datatypes
"to my knowledge" the macro was written by @Pro he has also made a nice tutorial for creating servers using nodeset files https://opcua.rocks/step-9-using-a-custom-uanodeset-with-open62541/#comment-893
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider Mo-Tay#1 |
This comment has been minimized.
This comment has been minimized.
open62541: add scripts for creating custom servers/nodeset/datatypes
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This package depends on #7312 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
07a29f7
to
0ee8f8f
Compare
This comment has been minimized.
This comment has been minimized.
0ee8f8f
to
db69aae
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
0aba13b
to
fa42f53
Compare
All green in build 35 (
|
This new recipe is not a requirement 🤔 what is the depency? |
The open62541 package (i.e., the library) is not directly dependent on ua-nodest. I.e., ua-nodeset is not required to build the library. The ua-nodeset is required when you build an executable using the library and creating an OPC UA server. |
Thank you for explaining! |
* feat: add tools files, variables for ua-nodeset * open62541: add custom server example * open62541: rename test package exe + fix path of exe in chmod +x * fix: rename nodeset_path to nodeset_dir * fix: use the correct ua-nodeset version * fix: add NAMESPACE_IDX for older versions * fix: minimize custom server for testing * fix: add newlines * fix: update modify model csv file * fix: add custom DataType for nodeset test server * fix: add newline * fix: decrease server runtime for test packages * fix: triger build * fix: use different server's port, decrease runtime * fix: use NULL instead of nullptr * fix: disable Windows shared build for 1.2.2 * fix: use C++ for test package * fix: use c++ for test package * Revert "fix: use c++ for test package" This reverts commit 39dcb20. * Revert "fix: use C++ for test package" This reverts commit 0b902c0. * fix: remove server default confing * fix: start test server on different port * fix: remove repeated test, corret port adaptation * fix: older versions issues * feat: formating Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com> Co-authored-by: Stefan Profanter <stefan.profanter@agile-robots.com>
Building the project with the CMake Macro "ua_generate_nodeset_and_datatypes" provided in in "[https://opcua.rocks/step-9-using-a-custom-uanodeset-with-open62541/]" gave the following exception:
`CMake Error at /home/xx/.conan/data/open62541/1.2.2/sp/prerelease/package /c32e2434a9be6dcdf5509b2f4986160a64168842/lib/cmake/open62541/open62541Macros.cmake:456 (message):
open62541_TOOLS_DIR must point to the open62541 tools directory Call Stack (most recent call first): xx/xx/FooServer/CMakeLists.txt:10 (ua_generate_nodeset_and_datatypes)`
see issue #7312
Fix:
conan-center hook activated.