aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--asn1/CMakeLists.txt4
-rw-r--r--asn1/acp133/CMakeLists.txt10
-rw-r--r--asn1/acse/CMakeLists.txt2
-rw-r--r--asn1/ansi_map/CMakeLists.txt2
-rw-r--r--asn1/camel/CMakeLists.txt4
-rw-r--r--asn1/cmip/CMakeLists.txt2
-rw-r--r--asn1/cmp/CMakeLists.txt2
-rw-r--r--asn1/cms/CMakeLists.txt10
-rw-r--r--asn1/crmf/CMakeLists.txt2
-rw-r--r--asn1/dap/CMakeLists.txt18
-rw-r--r--asn1/disp/CMakeLists.txt12
-rw-r--r--asn1/dop/CMakeLists.txt12
-rw-r--r--asn1/dsp/CMakeLists.txt8
-rw-r--r--asn1/ess/CMakeLists.txt6
-rw-r--r--asn1/ftam/CMakeLists.txt2
-rw-r--r--asn1/gprscdr/CMakeLists.txt2
-rw-r--r--asn1/h225/CMakeLists.txt4
-rw-r--r--asn1/h235/CMakeLists.txt2
-rw-r--r--asn1/h323/CMakeLists.txt2
-rw-r--r--asn1/h450/CMakeLists.txt4
-rw-r--r--asn1/h460/CMakeLists.txt6
-rw-r--r--asn1/h501/CMakeLists.txt4
-rw-r--r--asn1/idmp/CMakeLists.txt4
-rw-r--r--asn1/inap/CMakeLists.txt4
-rw-r--r--asn1/lcsap/CMakeLists.txt2
-rw-r--r--asn1/logotypecertextn/CMakeLists.txt2
-rw-r--r--asn1/lppe/CMakeLists.txt2
-rw-r--r--asn1/mms/CMakeLists.txt2
-rw-r--r--asn1/ocsp/CMakeLists.txt4
-rw-r--r--asn1/p1/CMakeLists.txt14
-rw-r--r--asn1/p22/CMakeLists.txt14
-rw-r--r--asn1/p7/CMakeLists.txt8
-rw-r--r--asn1/p772/CMakeLists.txt4
-rw-r--r--asn1/pkcs1/CMakeLists.txt2
-rw-r--r--asn1/pkcs12/CMakeLists.txt6
-rw-r--r--asn1/pkinit/CMakeLists.txt2
-rw-r--r--asn1/pkix1implicit/CMakeLists.txt4
-rw-r--r--asn1/pkixac/CMakeLists.txt4
-rw-r--r--asn1/pkixqualified/CMakeLists.txt6
-rw-r--r--asn1/pkixtsp/CMakeLists.txt2
-rw-r--r--asn1/pres/CMakeLists.txt2
-rw-r--r--asn1/x509af/CMakeLists.txt6
-rw-r--r--asn1/x509ce/CMakeLists.txt10
-rw-r--r--asn1/x509if/CMakeLists.txt2
-rw-r--r--asn1/x509sat/CMakeLists.txt4
-rw-r--r--cmake/modules/UseAsn2Wrs.cmake118
47 files changed, 192 insertions, 157 deletions
diff --git a/.gitignore b/.gitignore
index eb892d65a7..6ceefc482d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -131,6 +131,7 @@ build.ninja
rules.ninja
.ninja_deps
.ninja_log
+asn1/*/*-stamp
# Generated dir #
diff --git a/asn1/CMakeLists.txt b/asn1/CMakeLists.txt
index 821af65893..15fcbf4e49 100644
--- a/asn1/CMakeLists.txt
+++ b/asn1/CMakeLists.txt
@@ -130,7 +130,11 @@ set( BROKEN_ASN1_SRC_DIRS
x721
)
+set(_asn1_deps)
foreach(ASN1_DIR ${ASN1_SRC_DIRS})
add_subdirectory( ${ASN1_DIR} )
+ list(APPEND _asn1_deps ${ASN1_DIR}/generate_dissector-${ASN1_DIR})
endforeach()
+# Target to regenerate all outdated ASN.1 dissectors
+add_custom_target(asn1 DEPENDS ${_asn1_deps})
diff --git a/asn1/acp133/CMakeLists.txt b/asn1/acp133/CMakeLists.txt
index 31d3464994..8d5a5fe48b 100644
--- a/asn1/acp133/CMakeLists.txt
+++ b/asn1/acp133/CMakeLists.txt
@@ -46,11 +46,11 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- p1-exp.cnf
- x509af-exp.cnf
- x509ce-exp.cnf
- x509if-exp.cnf
- x509sat-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../p1/p1-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509ce/x509ce-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509if/x509if-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509sat/x509sat-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/acse/CMakeLists.txt b/asn1/acse/CMakeLists.txt
index 90c6b8cfe2..74eba4f198 100644
--- a/asn1/acse/CMakeLists.txt
+++ b/asn1/acse/CMakeLists.txt
@@ -49,7 +49,7 @@ set( SRC_FILES
set( A2W_FLAGS -b -C )
set( EXTRA_CNF
- x509if-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509if/x509if-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/ansi_map/CMakeLists.txt b/asn1/ansi_map/CMakeLists.txt
index 5a8f5e3950..d754b79314 100644
--- a/asn1/ansi_map/CMakeLists.txt
+++ b/asn1/ansi_map/CMakeLists.txt
@@ -40,7 +40,7 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- gsm_map-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../gsm_map/gsm_map-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/camel/CMakeLists.txt b/asn1/camel/CMakeLists.txt
index fe12367bf9..8aa9bb8329 100644
--- a/asn1/camel/CMakeLists.txt
+++ b/asn1/camel/CMakeLists.txt
@@ -63,8 +63,8 @@ set( SRC_FILES
set( A2W_FLAGS -b -L )
set( EXTRA_CNF
- inap-exp.cnf
- gsm_map-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../inap/inap-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../gsm_map/gsm_map-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/cmip/CMakeLists.txt b/asn1/cmip/CMakeLists.txt
index ac672cb49c..d8f04ab560 100644
--- a/asn1/cmip/CMakeLists.txt
+++ b/asn1/cmip/CMakeLists.txt
@@ -54,7 +54,7 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- acse-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../acse/acse-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/cmp/CMakeLists.txt b/asn1/cmp/CMakeLists.txt
index 96509f9b81..64ee4dcfe6 100644
--- a/asn1/cmp/CMakeLists.txt
+++ b/asn1/cmp/CMakeLists.txt
@@ -47,7 +47,7 @@ set( A2W_FLAGS -b )
set( EXTRA_CNF
../pkix1explicit/pkix1explicit_exp.cnf
../pkix1implicit/pkix1implicit_exp.cnf
- crmf-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../crmf/crmf-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/cms/CMakeLists.txt b/asn1/cms/CMakeLists.txt
index 32a4c7ea88..f0bc556720 100644
--- a/asn1/cms/CMakeLists.txt
+++ b/asn1/cms/CMakeLists.txt
@@ -50,14 +50,14 @@ set( SRC_FILES
set( A2W_FLAGS -b -C )
set( EXTRA_CNF
- x509af-exp.cnf
- x509ce-exp.cnf
- x509if-exp.cnf
- x509sat-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509ce/x509ce-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509if/x509if-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509sat/x509sat-exp.cnf"
)
set ( EXPORT_DEPENDS
- x509af-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/crmf/CMakeLists.txt b/asn1/crmf/CMakeLists.txt
index 9a301177cf..bc6ec91110 100644
--- a/asn1/crmf/CMakeLists.txt
+++ b/asn1/crmf/CMakeLists.txt
@@ -49,7 +49,7 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- cms-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../cms/cms-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/dap/CMakeLists.txt b/asn1/dap/CMakeLists.txt
index 04e7af4afe..53277cf453 100644
--- a/asn1/dap/CMakeLists.txt
+++ b/asn1/dap/CMakeLists.txt
@@ -50,15 +50,15 @@ set( SRC_FILES
set( A2W_FLAGS -b -L )
set( EXTRA_CNF
- acse-exp.cnf
- dop-exp.cnf
- disp-exp.cnf
- dsp-exp.cnf
- crmf-exp.cnf
- ros-exp.cnf
- x509af-exp.cnf
- x509if-exp.cnf
- x509sat-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../acse/acse-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../dop/dop-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../disp/disp-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../dsp/dsp-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../crmf/crmf-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../ros/ros-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509if/x509if-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509sat/x509sat-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/disp/CMakeLists.txt b/asn1/disp/CMakeLists.txt
index 5999088d95..38bb4787f5 100644
--- a/asn1/disp/CMakeLists.txt
+++ b/asn1/disp/CMakeLists.txt
@@ -49,15 +49,15 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- dap-exp.cnf
- dop-exp.cnf
- dsp-exp.cnf
- x509af-exp.cnf
- x509if-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../dap/dap-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../dop/dop-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../dsp/dsp-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509if/x509if-exp.cnf"
)
set( EXPORT_DEPENDS
- dop-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../dop/dop-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/dop/CMakeLists.txt b/asn1/dop/CMakeLists.txt
index cd0a329e0d..9df5fa05cb 100644
--- a/asn1/dop/CMakeLists.txt
+++ b/asn1/dop/CMakeLists.txt
@@ -49,12 +49,12 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- dap-exp.cnf
- dsp-exp.cnf
- crmf-exp.cnf
- x509af-exp.cnf
- x509if-exp.cnf
- x509sat-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../dap/dap-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../dsp/dsp-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../crmf/crmf-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509if/x509if-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509sat/x509sat-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/dsp/CMakeLists.txt b/asn1/dsp/CMakeLists.txt
index 82eb101ff5..864add0a91 100644
--- a/asn1/dsp/CMakeLists.txt
+++ b/asn1/dsp/CMakeLists.txt
@@ -49,10 +49,10 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- dap-exp.cnf
- x509af-exp.cnf
- x509if-exp.cnf
- x509sat-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../dap/dap-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509if/x509if-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509sat/x509sat-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/ess/CMakeLists.txt b/asn1/ess/CMakeLists.txt
index 3607c39271..e4f34df2bb 100644
--- a/asn1/ess/CMakeLists.txt
+++ b/asn1/ess/CMakeLists.txt
@@ -45,9 +45,9 @@ set( SRC_FILES
set( A2W_FLAGS -b -k -C )
set( EXTRA_CNF
- cms-exp.cnf
- x509af-exp.cnf
- x509ce-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../cms/cms-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509ce/x509ce-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/ftam/CMakeLists.txt b/asn1/ftam/CMakeLists.txt
index c2375cd237..e7c8a51c5b 100644
--- a/asn1/ftam/CMakeLists.txt
+++ b/asn1/ftam/CMakeLists.txt
@@ -49,7 +49,7 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- acse-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../acse/acse-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/gprscdr/CMakeLists.txt b/asn1/gprscdr/CMakeLists.txt
index 363b2644df..6678566dd7 100644
--- a/asn1/gprscdr/CMakeLists.txt
+++ b/asn1/gprscdr/CMakeLists.txt
@@ -51,7 +51,7 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- gsm_map-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../gsm_map/gsm_map-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/h225/CMakeLists.txt b/asn1/h225/CMakeLists.txt
index fe5fe4517f..5a15337e11 100644
--- a/asn1/h225/CMakeLists.txt
+++ b/asn1/h225/CMakeLists.txt
@@ -49,8 +49,8 @@ set( SRC_FILES
set( A2W_FLAGS )
set( EXTRA_CNF
- h235-exp.cnf
- h245-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../h235/h235-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../h245/h245-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/h235/CMakeLists.txt b/asn1/h235/CMakeLists.txt
index d09fa9c955..1032611e94 100644
--- a/asn1/h235/CMakeLists.txt
+++ b/asn1/h235/CMakeLists.txt
@@ -50,7 +50,7 @@ set( SRC_FILES
set( A2W_FLAGS )
set( EXTRA_CNF
- h225-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../h225/h225-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/h323/CMakeLists.txt b/asn1/h323/CMakeLists.txt
index be4d28f976..e12af18283 100644
--- a/asn1/h323/CMakeLists.txt
+++ b/asn1/h323/CMakeLists.txt
@@ -46,7 +46,7 @@ set( SRC_FILES
set( A2W_FLAGS )
set( EXTRA_CNF
- h225-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../h225/h225-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/h450/CMakeLists.txt b/asn1/h450/CMakeLists.txt
index aad3e7b1dd..a3b1237542 100644
--- a/asn1/h450/CMakeLists.txt
+++ b/asn1/h450/CMakeLists.txt
@@ -67,8 +67,8 @@ set( SRC_FILES
set( A2W_FLAGS )
set( EXTRA_CNF
- h225-exp.cnf
- h450-ros-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../h225/h225-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../h450-ros/h450-ros-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/h460/CMakeLists.txt b/asn1/h460/CMakeLists.txt
index 001bb6456f..0205c4fefc 100644
--- a/asn1/h460/CMakeLists.txt
+++ b/asn1/h460/CMakeLists.txt
@@ -54,9 +54,9 @@ set( SRC_FILES
set( A2W_FLAGS )
set( EXTRA_CNF
- h225-exp.cnf
- h235-exp.cnf
- h245-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../h225/h225-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../h235/h235-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../h245/h245-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/h501/CMakeLists.txt b/asn1/h501/CMakeLists.txt
index 02258f59ea..dc4e5a02eb 100644
--- a/asn1/h501/CMakeLists.txt
+++ b/asn1/h501/CMakeLists.txt
@@ -44,8 +44,8 @@ set( SRC_FILES
set( A2W_FLAGS )
set( EXTRA_CNF
- h225-exp.cnf
- h235-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../h225/h225-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../h235/h235-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/idmp/CMakeLists.txt b/asn1/idmp/CMakeLists.txt
index c8aef43518..f2f5472b5d 100644
--- a/asn1/idmp/CMakeLists.txt
+++ b/asn1/idmp/CMakeLists.txt
@@ -50,8 +50,8 @@ set( SRC_FILES
set( A2W_FLAGS -b -L )
set( EXTRA_CNF
- x509af-exp.cnf
- x509ce-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509ce/x509ce-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/inap/CMakeLists.txt b/asn1/inap/CMakeLists.txt
index 9079ffb7f0..88748939db 100644
--- a/asn1/inap/CMakeLists.txt
+++ b/asn1/inap/CMakeLists.txt
@@ -78,8 +78,8 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- dap-exp.cnf
- dsp-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../dap/dap-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../dsp/dsp-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/lcsap/CMakeLists.txt b/asn1/lcsap/CMakeLists.txt
index 95f1e66d26..0a18a607a1 100644
--- a/asn1/lcsap/CMakeLists.txt
+++ b/asn1/lcsap/CMakeLists.txt
@@ -54,7 +54,7 @@ set( SRC_FILES
set( A2W_FLAGS )
set( EXTRA_CNF
- x509if-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509if/x509if-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/logotypecertextn/CMakeLists.txt b/asn1/logotypecertextn/CMakeLists.txt
index d7345bddf7..64ab3dade5 100644
--- a/asn1/logotypecertextn/CMakeLists.txt
+++ b/asn1/logotypecertextn/CMakeLists.txt
@@ -45,7 +45,7 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- x509af-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/lppe/CMakeLists.txt b/asn1/lppe/CMakeLists.txt
index 3467172ccc..a28caeb62b 100644
--- a/asn1/lppe/CMakeLists.txt
+++ b/asn1/lppe/CMakeLists.txt
@@ -44,7 +44,7 @@ set( SRC_FILES
set( A2W_FLAGS )
set( EXTRA_CNF
- lpp-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../lpp/lpp-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/mms/CMakeLists.txt b/asn1/mms/CMakeLists.txt
index 9ed7e1b1ed..89a90ba1ac 100644
--- a/asn1/mms/CMakeLists.txt
+++ b/asn1/mms/CMakeLists.txt
@@ -45,7 +45,7 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- acse-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../acse/acse-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/ocsp/CMakeLists.txt b/asn1/ocsp/CMakeLists.txt
index fdbb73dad7..70b40fac44 100644
--- a/asn1/ocsp/CMakeLists.txt
+++ b/asn1/ocsp/CMakeLists.txt
@@ -45,8 +45,8 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- x509af-exp.cnf
- x509ce-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509ce/x509ce-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/p1/CMakeLists.txt b/asn1/p1/CMakeLists.txt
index 75e270491e..b9d03377cc 100644
--- a/asn1/p1/CMakeLists.txt
+++ b/asn1/p1/CMakeLists.txt
@@ -53,16 +53,16 @@ set( SRC_FILES
set( A2W_FLAGS -b -C )
set( EXTRA_CNF
- x509af-exp.cnf
- x509ce-exp.cnf
- x509if-exp.cnf
- x509sat-exp.cnf
- ros-exp.cnf
- rtse-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509ce/x509ce-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509if/x509if-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509sat/x509sat-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../ros/ros-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../rtse/rtse-exp.cnf"
)
set ( EXPORT_DEPENDS
- x509af-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/p22/CMakeLists.txt b/asn1/p22/CMakeLists.txt
index f9ebc4f656..fe1d3e1558 100644
--- a/asn1/p22/CMakeLists.txt
+++ b/asn1/p22/CMakeLists.txt
@@ -58,16 +58,16 @@ set( SRC_FILES
set( A2W_FLAGS -b -C )
set( EXTRA_CNF
- acse-exp.cnf
- ftam-exp.cnf
- p7-exp.cnf
- p1-exp.cnf
- x509af-exp.cnf
- x509ce-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../acse/acse-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../ftam/ftam-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../p7/p7-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../p1/p1-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509ce/x509ce-exp.cnf"
)
set( EXPORT_DEPENDS
- p1-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../p1/p1-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/p7/CMakeLists.txt b/asn1/p7/CMakeLists.txt
index ffb31a68f3..71477eace5 100644
--- a/asn1/p7/CMakeLists.txt
+++ b/asn1/p7/CMakeLists.txt
@@ -52,13 +52,13 @@ set( SRC_FILES
set( A2W_FLAGS -b -L -C )
set( EXTRA_CNF
- p1-exp.cnf
- ros-exp.cnf
- rtse-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../p1/p1-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../ros/ros-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../rtse/rtse-exp.cnf"
)
set( EXPORT_DEPENDS
- p1-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../p1/p1-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/p772/CMakeLists.txt b/asn1/p772/CMakeLists.txt
index f7a3a490ac..28ed9a93ed 100644
--- a/asn1/p772/CMakeLists.txt
+++ b/asn1/p772/CMakeLists.txt
@@ -52,8 +52,8 @@ set( SRC_FILES
set( A2W_FLAGS -b -C )
set( EXTRA_CNF
- p1-exp.cnf
- p22-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../p1/p1-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../p22/p22-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/pkcs1/CMakeLists.txt b/asn1/pkcs1/CMakeLists.txt
index 63076a4b76..9aab3819e4 100644
--- a/asn1/pkcs1/CMakeLists.txt
+++ b/asn1/pkcs1/CMakeLists.txt
@@ -45,7 +45,7 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- x509af-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/pkcs12/CMakeLists.txt b/asn1/pkcs12/CMakeLists.txt
index 3c3b6f5736..f805707a7c 100644
--- a/asn1/pkcs12/CMakeLists.txt
+++ b/asn1/pkcs12/CMakeLists.txt
@@ -45,9 +45,9 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- x509if-exp.cnf
- x509af-exp.cnf
- cms-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509if/x509if-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../cms/cms-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/pkinit/CMakeLists.txt b/asn1/pkinit/CMakeLists.txt
index e5022b7dd7..4b9e0657e2 100644
--- a/asn1/pkinit/CMakeLists.txt
+++ b/asn1/pkinit/CMakeLists.txt
@@ -45,7 +45,7 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- cms-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../cms/cms-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/pkix1implicit/CMakeLists.txt b/asn1/pkix1implicit/CMakeLists.txt
index c8d2321edd..9ddb1af8aa 100644
--- a/asn1/pkix1implicit/CMakeLists.txt
+++ b/asn1/pkix1implicit/CMakeLists.txt
@@ -45,8 +45,8 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- x509af-exp.cnf
- x509ce-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509ce/x509ce-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/pkixac/CMakeLists.txt b/asn1/pkixac/CMakeLists.txt
index b5d0e7493d..70d87940bb 100644
--- a/asn1/pkixac/CMakeLists.txt
+++ b/asn1/pkixac/CMakeLists.txt
@@ -47,8 +47,8 @@ set( A2W_FLAGS -b )
set( EXTRA_CNF
../pkix1explicit/pkix1explicit_exp.cnf
../pkix1implicit/pkix1implicit_exp.cnf
- x509af-exp.cnf
- x509ce-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509ce/x509ce-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/pkixqualified/CMakeLists.txt b/asn1/pkixqualified/CMakeLists.txt
index a41b117e4d..c0da0d9021 100644
--- a/asn1/pkixqualified/CMakeLists.txt
+++ b/asn1/pkixqualified/CMakeLists.txt
@@ -45,9 +45,9 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- x509af-exp.cnf
- x509ce-exp.cnf
- x509sat-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509ce/x509ce-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509sat/x509sat-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/pkixtsp/CMakeLists.txt b/asn1/pkixtsp/CMakeLists.txt
index dc0e840507..ed2299d3fa 100644
--- a/asn1/pkixtsp/CMakeLists.txt
+++ b/asn1/pkixtsp/CMakeLists.txt
@@ -45,7 +45,7 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- cms-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../cms/cms-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/pres/CMakeLists.txt b/asn1/pres/CMakeLists.txt
index 7b6677b8bd..31231dd921 100644
--- a/asn1/pres/CMakeLists.txt
+++ b/asn1/pres/CMakeLists.txt
@@ -46,7 +46,7 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- rtse-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../rtse/rtse-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/x509af/CMakeLists.txt b/asn1/x509af/CMakeLists.txt
index a8825551ad..f67d61769e 100644
--- a/asn1/x509af/CMakeLists.txt
+++ b/asn1/x509af/CMakeLists.txt
@@ -49,9 +49,9 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- x509ce-exp.cnf
- x509if-exp.cnf
- x509sat-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509ce/x509ce-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509if/x509if-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509sat/x509sat-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/x509ce/CMakeLists.txt b/asn1/x509ce/CMakeLists.txt
index 0ea5241749..dc04f53c2c 100644
--- a/asn1/x509ce/CMakeLists.txt
+++ b/asn1/x509ce/CMakeLists.txt
@@ -50,14 +50,14 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- p1-exp.cnf
- x509af-exp.cnf
- x509if-exp.cnf
- x509sat-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../p1/p1-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509if/x509if-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509sat/x509sat-exp.cnf"
)
set( EXPORT_DEPENDS
- x509af-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/x509if/CMakeLists.txt b/asn1/x509if/CMakeLists.txt
index b718482357..4bfbd394c3 100644
--- a/asn1/x509if/CMakeLists.txt
+++ b/asn1/x509if/CMakeLists.txt
@@ -50,7 +50,7 @@ set( SRC_FILES
set( A2W_FLAGS -b )
set( EXTRA_CNF
- x509sat-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509sat/x509sat-exp.cnf"
)
ASN2WRS()
diff --git a/asn1/x509sat/CMakeLists.txt b/asn1/x509sat/CMakeLists.txt
index f8bd561b78..7ebea900b7 100644
--- a/asn1/x509sat/CMakeLists.txt
+++ b/asn1/x509sat/CMakeLists.txt
@@ -49,8 +49,8 @@ set( SRC_FILES
set( A2W_FLAGS -b -r Syntax )
set( EXTRA_CNF
- x509if-exp.cnf
- p1-exp.cnf
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509if/x509if-exp.cnf"
+ "${CMAKE_CURRENT_BINARY_DIR}/../p1/p1-exp.cnf"
)
ASN2WRS()
diff --git a/cmake/modules/UseAsn2Wrs.cmake b/cmake/modules/UseAsn2Wrs.cmake
index 537398b9c6..9f3a3a93d7 100644
--- a/cmake/modules/UseAsn2Wrs.cmake
+++ b/cmake/modules/UseAsn2Wrs.cmake
@@ -1,58 +1,88 @@
# - Convert ASN.1 file into C source and header files that can be used to create a wireshark dissector
+#
+# A2W_OUTPUT_DIR - directory where the generated packet-${PROTOCOL_NAME}.c is
+# saved. The default location is meant for the Wireshark
+# source tree. For external dissectors, set it to the
+# absolute path (e.g. "${CMAKE_CURRENT_SOURCE_DIR}").
-MACRO(ASN2WRS)
+function(ASN2WRS)
include(LocatePythonModule)
- locate_python_module(asn2wrs REQUIRED PATHS ${CMAKE_SOURCE_DIR}/tools)
+ locate_python_module(asn2wrs REQUIRED PATHS "${CMAKE_SOURCE_DIR}/tools")
- set( DISSECTOR ${CMAKE_SOURCE_DIR}/epan/dissectors/packet-${PROTOCOL_NAME}.c )
-
- if ( NOT PROTO_OPT )
- set( PROTO_OPT -p ${PROTOCOL_NAME} )
- elseif ( PROTO_OPT STREQUAL "_EMPTY_" )
- set( PROTO_OPT )
+ if(NOT PROTO_OPT)
+ set(PROTO_OPT -p ${PROTOCOL_NAME})
+ elseif(PROTO_OPT STREQUAL "_EMPTY_")
+ 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 )
+ if(NOT A2W_OUTPUT_DIR)
+ set(A2W_OUTPUT_DIR "${CMAKE_SOURCE_DIR}/epan/dissectors")
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
- COMMAND ${PYTHON_EXECUTABLE}
- ${PY_ASN2WRS}
- ${A2W_FLAGS}
- ${PROTO_OPT}
- -c ${CMAKE_CURRENT_SOURCE_DIR}/${PROTOCOL_NAME}.cnf
- -s ${CMAKE_CURRENT_SOURCE_DIR}/packet-${PROTOCOL_NAME}-template
- -D ${CMAKE_CURRENT_SOURCE_DIR}
- ${A2W_OUTPUT_DIR}
- ${EXT_ASN_FILE_LIST} ${ASN_FILE_LIST} ${EXT_ASN_FILE_LIST_LATE}
+ set(DISSECTOR "${A2W_OUTPUT_DIR}/packet-${PROTOCOL_NAME}.c")
+
+ # Besides the file dependency (for timestamp comparison), add a target such
+ # that other directories can request it to be built (ordering dependency).
+ foreach(_v EXTRA_CNF EXPORT_DEPENDS)
+ set(${_v}_targets)
+ foreach(entry IN LISTS ${_v})
+ string(REGEX MATCH "[^/]+-exp\\.cnf$" _exp_cnf_filename "${entry}")
+ if(_exp_cnf_filename)
+ list(APPEND ${_v}_targets generate-${_exp_cnf_filename})
+ endif()
+ endforeach()
+ endforeach()
+
+ # Creates a dissector in the source directory and store the timestamp.
+ add_custom_command(
+ OUTPUT packet-${PROTOCOL_NAME}-stamp
+ COMMAND "${PYTHON_EXECUTABLE}"
+ ${PY_ASN2WRS}
+ ${A2W_FLAGS}
+ ${PROTO_OPT}
+ -c "${CMAKE_CURRENT_SOURCE_DIR}/${PROTOCOL_NAME}.cnf"
+ -s "${CMAKE_CURRENT_SOURCE_DIR}/packet-${PROTOCOL_NAME}-template"
+ -D "${CMAKE_CURRENT_SOURCE_DIR}"
+ -O "${A2W_OUTPUT_DIR}"
+ ${EXT_ASN_FILE_LIST} ${ASN_FILE_LIST} ${EXT_ASN_FILE_LIST_LATE}
+ COMMAND
+ "${PYTHON_EXECUTABLE}" -c
+ "import shutil, sys; x,s,d=sys.argv; open(d, 'w'); shutil.copystat(s, d)"
+ "${A2W_OUTPUT_DIR}/packet-${PROTOCOL_NAME}.c"
+ packet-${PROTOCOL_NAME}-stamp
DEPENDS
- ${PY_ASN2WRS}
- ${SRC_FILES}
- ${EXTRA_CNF}
+ "${PY_ASN2WRS}"
+ ${SRC_FILES}
+ ${EXTRA_CNF_targets}
+ ${EXTRA_CNF}
+ VERBATIM
)
- foreach( _asn2wrs_export_file IN LISTS EXPORT_FILES )
- ADD_CUSTOM_TARGET( ${_asn2wrs_export_file}
- WORKING_DIRECTORY .
- COMMAND ${PYTHON_EXECUTABLE}
- ${PY_ASN2WRS}
- -E
- ${A2W_FLAGS}
- ${PROTO_OPT}
- -c ${CMAKE_CURRENT_SOURCE_DIR}/${PROTOCOL_NAME}.cnf
- -D ${CMAKE_CURRENT_SOURCE_DIR}
- ${EXT_ASN_FILE_LIST} ${ASN_FILE_LIST} ${EXT_ASN_FILE_LIST_LATE}
+ add_custom_target(generate_dissector-${PROTOCOL_NAME} ALL
+ DEPENDS packet-${PROTOCOL_NAME}-stamp
+ )
+
+ foreach(_asn2wrs_export_file IN LISTS EXPORT_FILES)
+ add_custom_command(
+ OUTPUT ${_asn2wrs_export_file}
+ COMMAND "${PYTHON_EXECUTABLE}"
+ "${PY_ASN2WRS}"
+ -E
+ ${A2W_FLAGS}
+ ${PROTO_OPT}
+ -c "${CMAKE_CURRENT_SOURCE_DIR}/${PROTOCOL_NAME}.cnf"
+ -D "${CMAKE_CURRENT_SOURCE_DIR}"
+ ${EXT_ASN_FILE_LIST} ${ASN_FILE_LIST} ${EXT_ASN_FILE_LIST_LATE}
DEPENDS
- ${PY_ASN2WRS}
- ${SRC_FILES}
- ${EXPORT_DEPENDS}
+ "${PY_ASN2WRS}"
+ ${SRC_FILES}
+ ${EXPORT_DEPENDS_targets}
+ ${EXPORT_DEPENDS}
+ )
+ # This target enables other dissectors to trigger the -exp cnf build
+ add_custom_target(generate-${_asn2wrs_export_file}
+ DEPENDS ${_asn2wrs_export_file}
)
endforeach()
-ENDMACRO()
+
+endfunction()