summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Bezemer <maarten.bezemer@gmail.com>2014-11-12 13:32:41 +0100
committerAnders Broman <a.broman58@gmail.com>2014-12-17 09:05:34 +0000
commita1d4c0a792e07af4422dfe8446e0ac63cb1131d0 (patch)
tree5b331a68a48179d96a509ed13b1a2a63b0482b9d
parentfb01f59e6924105c9ceebb6e545fc0b299c69643 (diff)
downloadwireshark-a1d4c0a792e07af4422dfe8446e0ac63cb1131d0.tar.gz
Do not force the output directory
For out of source builds, the output directory should not point to wireshark source locations. By default it does point to the wireshark source directory (to stay compatible with the build in dissectors). When the A2W_OUTPUT_DIR variable is set to "_EMPTY_" the output lcoation argument (-O) is not invoked. Use A2W_FLAGS to set an output location for out of source builds (or use A2W_OUTPUT_DIR, which has the same result) Change-Id: I48b7486fcda982f0dce57cde3beacb99f946abd9 Reviewed-on: https://code.wireshark.org/review/5254 Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--cmake/modules/UseAsn2Wrs.cmake13
1 files changed, 11 insertions, 2 deletions
diff --git a/cmake/modules/UseAsn2Wrs.cmake b/cmake/modules/UseAsn2Wrs.cmake
index dd9f5d139d..50792fdf78 100644
--- a/cmake/modules/UseAsn2Wrs.cmake
+++ b/cmake/modules/UseAsn2Wrs.cmake
@@ -1,4 +1,5 @@
-#
+# - 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)
@@ -10,6 +11,14 @@ MACRO(ASN2WRS)
set( PROTO_OPT )
endif()
+ # Backwards compability for build in dissectors,
+ # set to '_EMPTY_' for out of source dissector builds
+ if ( NOT A2W_OUTPUT_DIR )
+ set (A2W_OUTPUT_DIR -O ${CMAKE_SOURCE_DIR}/epan/dissectors)
+ elseif ( A2W_OUTPUT_DIR STREQUAL "_EMPTY_" )
+ set( A2W_OUTPUT_DIR )
+ endif()
+
# Don't use packet-${PROTOCOL_NAME}.c instead of generate_dissector, it will
# cause EXCLUDE_FROM_ALL to be ignored.
ADD_CUSTOM_TARGET(generate_dissector-${PROTOCOL_NAME} ALL
@@ -20,7 +29,7 @@ MACRO(ASN2WRS)
-c ${CMAKE_CURRENT_SOURCE_DIR}/${PROTOCOL_NAME}.cnf
-s ${CMAKE_CURRENT_SOURCE_DIR}/packet-${PROTOCOL_NAME}-template
-D ${CMAKE_CURRENT_SOURCE_DIR}
- -O ${CMAKE_SOURCE_DIR}/epan/dissectors
+ ${A2W_OUTPUT_DIR}
${EXT_ASN_FILE_LIST} ${ASN_FILE_LIST} ${EXT_ASN_FILE_LIST_LATE}
DEPENDS
${ASN2WRS_EXECUTABLE}