|
@@ -237,6 +237,10 @@ endfunction()
|
|
# [OUTPUT_DIR] Optional target directory for the generated files. Default is '${PROJECT_BINARY_DIR}/src_generated'
|
|
# [OUTPUT_DIR] Optional target directory for the generated files. Default is '${PROJECT_BINARY_DIR}/src_generated'
|
|
# [IGNORE] Optional file containing a list of node ids which should be ignored. The file should have one id per line.
|
|
# [IGNORE] Optional file containing a list of node ids which should be ignored. The file should have one id per line.
|
|
# [TARGET_PREFIX] Optional prefix for the resulting target. Default `open62541-generator`
|
|
# [TARGET_PREFIX] Optional prefix for the resulting target. Default `open62541-generator`
|
|
|
|
+# [BLACKLIST] Blacklist file passed as --blacklist to the nodeset compiler. All the given nodes will be removed from the generated
|
|
|
|
+# nodeset, including all the references to and from that node. The format is a node id per line.
|
|
|
|
+# Supported formats: "i=123" (for NS0), "ns=2;s=asdf" (matches NS2 in that specific file), or recommended
|
|
|
|
+# "ns=http://opcfoundation.org/UA/DI/;i=123" namespace index independent node id
|
|
#
|
|
#
|
|
# Arguments taking multiple values:
|
|
# Arguments taking multiple values:
|
|
#
|
|
#
|
|
@@ -249,7 +253,7 @@ endfunction()
|
|
function(ua_generate_nodeset)
|
|
function(ua_generate_nodeset)
|
|
|
|
|
|
set(options INTERNAL )
|
|
set(options INTERNAL )
|
|
- set(oneValueArgs NAME TYPES_ARRAY OUTPUT_DIR IGNORE TARGET_PREFIX)
|
|
|
|
|
|
+ set(oneValueArgs NAME TYPES_ARRAY OUTPUT_DIR IGNORE TARGET_PREFIX BLACKLIST)
|
|
set(multiValueArgs FILE DEPENDS_TYPES DEPENDS_NS DEPENDS_TARGET)
|
|
set(multiValueArgs FILE DEPENDS_TYPES DEPENDS_NS DEPENDS_TARGET)
|
|
cmake_parse_arguments(UA_GEN_NS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
|
cmake_parse_arguments(UA_GEN_NS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
|
|
|
|
|
@@ -277,6 +281,14 @@ function(ua_generate_nodeset)
|
|
set(UA_GEN_NS_TARGET_PREFIX "open62541-generator")
|
|
set(UA_GEN_NS_TARGET_PREFIX "open62541-generator")
|
|
endif()
|
|
endif()
|
|
|
|
|
|
|
|
+ # Set blacklist file
|
|
|
|
+ set(GEN_BLACKLIST "")
|
|
|
|
+ set(GEN_BLACKLIST_DEPENDS "")
|
|
|
|
+ if(UA_GEN_NS_BLACKLIST)
|
|
|
|
+ set(GEN_BLACKLIST "--blacklist=${UA_GEN_NS_BLACKLIST}")
|
|
|
|
+ set(GEN_BLACKLIST_DEPENDS "${UA_GEN_NS_BLACKLIST}")
|
|
|
|
+ endif()
|
|
|
|
+
|
|
# ------ Add custom command and target -----
|
|
# ------ Add custom command and target -----
|
|
|
|
|
|
set(GEN_INTERNAL_HEADERS "")
|
|
set(GEN_INTERNAL_HEADERS "")
|
|
@@ -334,6 +346,7 @@ function(ua_generate_nodeset)
|
|
${GEN_NS0}
|
|
${GEN_NS0}
|
|
${GEN_BIN_SIZE}
|
|
${GEN_BIN_SIZE}
|
|
${GEN_IGNORE}
|
|
${GEN_IGNORE}
|
|
|
|
+ ${GEN_BLACKLIST}
|
|
${TYPES_ARRAY_LIST}
|
|
${TYPES_ARRAY_LIST}
|
|
${DEPENDS_FILE_LIST}
|
|
${DEPENDS_FILE_LIST}
|
|
${FILE_LIST}
|
|
${FILE_LIST}
|
|
@@ -348,6 +361,7 @@ function(ua_generate_nodeset)
|
|
${open62541_TOOLS_DIR}/nodeset_compiler/backend_open62541_datatypes.py
|
|
${open62541_TOOLS_DIR}/nodeset_compiler/backend_open62541_datatypes.py
|
|
${UA_GEN_NS_FILE}
|
|
${UA_GEN_NS_FILE}
|
|
${UA_GEN_NS_DEPENDS_NS}
|
|
${UA_GEN_NS_DEPENDS_NS}
|
|
|
|
+ ${GEN_BLACKLIST_DEPENDS}
|
|
)
|
|
)
|
|
|
|
|
|
add_custom_target(${UA_GEN_NS_TARGET_PREFIX}-${TARGET_SUFFIX}
|
|
add_custom_target(${UA_GEN_NS_TARGET_PREFIX}-${TARGET_SUFFIX}
|
|
@@ -410,6 +424,10 @@ endfunction()
|
|
# passed which will all combined to one resulting code.
|
|
# passed which will all combined to one resulting code.
|
|
# [NAMESPACE_IDX] Optional namespace index of the nodeset, when it is loaded into the server. This parameter is mandatory if FILE_CSV
|
|
# [NAMESPACE_IDX] Optional namespace index of the nodeset, when it is loaded into the server. This parameter is mandatory if FILE_CSV
|
|
# or FILE_BSD is set. See ua_generate_datatypes function.
|
|
# or FILE_BSD is set. See ua_generate_datatypes function.
|
|
|
|
+# [BLACKLIST] Blacklist file passed as --blacklist to the nodeset compiler. All the given nodes will be removed from the generated
|
|
|
|
+# nodeset, including all the references to and from that node. The format is a node id per line.
|
|
|
|
+# Supported formats: "i=123" (for NS0), "ns=2;s=asdf" (matches NS2 in that specific file), or recommended
|
|
|
|
+# "ns=http://opcfoundation.org/UA/DI/;i=123" namespace index independent node id
|
|
# [TARGET_PREFIX] Optional prefix for the resulting targets. Default `open62541-generator`
|
|
# [TARGET_PREFIX] Optional prefix for the resulting targets. Default `open62541-generator`
|
|
#
|
|
#
|
|
# Arguments taking multiple values:
|
|
# Arguments taking multiple values:
|
|
@@ -420,7 +438,7 @@ endfunction()
|
|
function(ua_generate_nodeset_and_datatypes)
|
|
function(ua_generate_nodeset_and_datatypes)
|
|
|
|
|
|
set(options INTERNAL)
|
|
set(options INTERNAL)
|
|
- set(oneValueArgs NAME FILE_NS FILE_CSV FILE_BSD NAMESPACE_IDX OUTPUT_DIR TARGET_PREFIX)
|
|
|
|
|
|
+ set(oneValueArgs NAME FILE_NS FILE_CSV FILE_BSD NAMESPACE_IDX OUTPUT_DIR TARGET_PREFIX BLACKLIST)
|
|
set(multiValueArgs DEPENDS)
|
|
set(multiValueArgs DEPENDS)
|
|
cmake_parse_arguments(UA_GEN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
|
cmake_parse_arguments(UA_GEN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
|
|
|
|
|
@@ -499,7 +517,11 @@ function(ua_generate_nodeset_and_datatypes)
|
|
|
|
|
|
# Create a list of nodesets on which this nodeset depends on
|
|
# Create a list of nodesets on which this nodeset depends on
|
|
if (NOT UA_GEN_DEPENDS OR "${UA_GEN_DEPENDS}" STREQUAL "" )
|
|
if (NOT UA_GEN_DEPENDS OR "${UA_GEN_DEPENDS}" STREQUAL "" )
|
|
- set(NODESET_DEPENDS "${open62541_NODESET_DIR}/Schema/Opc.Ua.NodeSet2.xml")
|
|
|
|
|
|
+ if(NOT UA_FILE_NS0)
|
|
|
|
+ set(NODESET_DEPENDS "${open62541_NODESET_DIR}/Schema/Opc.Ua.NodeSet2.xml")
|
|
|
|
+ else()
|
|
|
|
+ set(NODESET_DEPENDS "${UA_FILE_NS0}")
|
|
|
|
+ endif()
|
|
set(TYPES_DEPENDS "UA_TYPES")
|
|
set(TYPES_DEPENDS "UA_TYPES")
|
|
else()
|
|
else()
|
|
foreach(f ${UA_GEN_DEPENDS})
|
|
foreach(f ${UA_GEN_DEPENDS})
|
|
@@ -530,6 +552,7 @@ function(ua_generate_nodeset_and_datatypes)
|
|
NAME "${UA_GEN_NAME}"
|
|
NAME "${UA_GEN_NAME}"
|
|
FILE "${UA_GEN_FILE_NS}"
|
|
FILE "${UA_GEN_FILE_NS}"
|
|
TYPES_ARRAY "${NODESET_TYPES_ARRAY}"
|
|
TYPES_ARRAY "${NODESET_TYPES_ARRAY}"
|
|
|
|
+ BLACKLIST "${UA_GEN_BLACKLIST}"
|
|
${NODESET_INTERNAL}
|
|
${NODESET_INTERNAL}
|
|
DEPENDS_TYPES ${TYPES_DEPENDS}
|
|
DEPENDS_TYPES ${TYPES_DEPENDS}
|
|
DEPENDS_NS ${NODESET_DEPENDS}
|
|
DEPENDS_NS ${NODESET_DEPENDS}
|