Encapsulate the asn1c call from cmake in a cmake function run_asn1c(). As a notable change to the previous manual add_custom_command() invocation, in suppresses the output of asn1c by default [1] and stores it in a log file. In case of asn1c4 error, the output will output on stdout. Use the new run_asn1c() in all occasions for code generation. [1] it is quite verbose, with many warnings that we cannot influence nor suppress, and lists all generated files which is verified by the build system automatically, anyway.
22 lines
813 B
CMake
22 lines
813 B
CMake
set(E1AP_VERSION 16 78 0)
|
|
make_version(E1AP_cc ${E1AP_VERSION})
|
|
#add_definitions(-DE1AP_VERSION=${E1AP_cc})
|
|
string(REPLACE ";" "." E1AP_RELEASE "${E1AP_VERSION}")
|
|
|
|
if(E1AP_RELEASE VERSION_EQUAL "16.78.0")
|
|
include(ASN.1/38463-g80.R16.78.0.cmake)
|
|
else()
|
|
message(FATAL_ERROR "unknown E1AP_RELEASE ${E1AP_RELEASE}")
|
|
endif()
|
|
|
|
run_asn1c(${CMAKE_CURRENT_SOURCE_DIR}/${E1AP_GRAMMAR}
|
|
"E1AP_"
|
|
OUTPUT ${e1ap_source} ${e1ap_headers}
|
|
OPTIONS -gen-APER -gen-UPER -no-gen-JER -no-gen-BER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps
|
|
COMMENT "E1AP source files"
|
|
)
|
|
|
|
add_library(asn1_e1ap ${e1ap_source})
|
|
target_include_directories(asn1_e1ap PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")
|
|
target_compile_options(asn1_e1ap PRIVATE -DASN_DISABLE_OER_SUPPORT -w)
|