diff options
Diffstat (limited to 'cmake/modules')
-rw-r--r-- | cmake/modules/FindAsn2Wrs.cmake | 16 | ||||
-rw-r--r-- | cmake/modules/UseAsn2Wrs.cmake | 11 |
2 files changed, 6 insertions, 21 deletions
diff --git a/cmake/modules/FindAsn2Wrs.cmake b/cmake/modules/FindAsn2Wrs.cmake deleted file mode 100644 index a618649f25..0000000000 --- a/cmake/modules/FindAsn2Wrs.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# -# Look for the asn2wrs.py utility -# - -find_program( ASN2WRS_EXECUTABLE - NAMES - asn2wrs.py - HINTS - # First try to find it in wireshark sources - ${CMAKE_SOURCE_DIR}/tools -) - -include( FindPackageHandleStandardArgs ) -find_package_handle_standard_args( ASN2WRS DEFAULT_MSG ASN2WRS_EXECUTABLE ) - -mark_as_advanced( ASN2WRS_EXECUTABLE ) diff --git a/cmake/modules/UseAsn2Wrs.cmake b/cmake/modules/UseAsn2Wrs.cmake index f8c317e565..14821bb81c 100644 --- a/cmake/modules/UseAsn2Wrs.cmake +++ b/cmake/modules/UseAsn2Wrs.cmake @@ -1,7 +1,8 @@ # - Convert ASN.1 file into C source and header files that can be used to create a wireshark dissector MACRO(ASN2WRS) - find_package(Asn2Wrs REQUIRED) + include(LocatePythonModule) + locate_python_module(asn2wrs REQUIRED PATHS ${CMAKE_SOURCE_DIR}/tools) set( DISSECTOR ${CMAKE_SOURCE_DIR}/epan/dissectors/packet-${PROTOCOL_NAME}.c ) @@ -24,7 +25,7 @@ MACRO(ASN2WRS) ADD_CUSTOM_COMMAND( OUTPUT packet-${PROTOCOL_NAME}.c COMMAND ${PYTHON_EXECUTABLE} - ${ASN2WRS_EXECUTABLE} + ${PY_ASN2WRS} ${A2W_FLAGS} ${PROTO_OPT} -c ${CMAKE_CURRENT_SOURCE_DIR}/${PROTOCOL_NAME}.cnf @@ -33,7 +34,7 @@ MACRO(ASN2WRS) ${A2W_OUTPUT_DIR} ${EXT_ASN_FILE_LIST} ${ASN_FILE_LIST} ${EXT_ASN_FILE_LIST_LATE} DEPENDS - ${ASN2WRS_EXECUTABLE} + ${PY_ASN2WRS} ${SRC_FILES} ${EXTRA_CNF} ) @@ -42,7 +43,7 @@ MACRO(ASN2WRS) ADD_CUSTOM_COMMAND( OUTPUT ${_asn2wrs_export_file} COMMAND ${PYTHON_EXECUTABLE} - ${ASN2WRS_EXECUTABLE} + ${PY_ASN2WRS} -E ${A2W_FLAGS} ${PROTO_OPT} @@ -50,7 +51,7 @@ MACRO(ASN2WRS) -D ${CMAKE_CURRENT_SOURCE_DIR} ${EXT_ASN_FILE_LIST} ${ASN_FILE_LIST} ${EXT_ASN_FILE_LIST_LATE} DEPENDS - ${ASN2WRS_EXECUTABLE} + ${PY_ASN2WRS} ${SRC_FILES} ${EXPORT_DEPENDS} ) |