Add cmake option to select asn1c, and test asn1c parameters
CMake now takes the option ASN1C_EXEC to select an asn1c to use for compilation. For instance, run with cmake .. -GNinja -DASN1C_EXEC=/opt/asn1c/bin/asn1c or ./build_oai --cmake-opt -DASN1C_EXEC=/opt/asn1c/bin/asn1c to select the alternative asn1c. For instance, this is important for the CI to allow to build multiple versions of OAI in parallel that might use different commits of OAI. Further, this patch introduces functionality to check for the support of asn1c options that we require, and alerts the user if they are missing, alongside a message of how to resolve the problem.
This commit is contained in:
@@ -46,6 +46,17 @@ include_directories(${CONFIG_INCLUDE_DIRS})
|
||||
pkg_search_module(CRYPTO libcrypto REQUIRED)
|
||||
include_directories(${CRYPTO_INCLUDE_DIRS})
|
||||
|
||||
# Check if asn1c is installed, and check if it supports all options we need
|
||||
# a user can provide ASN1C_EXEC to override an asn1c to use (e.g., parallel
|
||||
# installation)
|
||||
find_program(ASN1C_EXEC_PATH asn1c)
|
||||
set(ASN1C_EXEC ${ASN1C_EXEC_PATH} CACHE FILEPATH "path to asn1c executable")
|
||||
check_option(${ASN1C_EXEC} -gen-APER ASN1C_EXEC)
|
||||
check_option(${ASN1C_EXEC} -no-gen-UPER ASN1C_EXEC)
|
||||
check_option(${ASN1C_EXEC} -no-gen-JER ASN1C_EXEC)
|
||||
check_option(${ASN1C_EXEC} -no-gen-BER ASN1C_EXEC)
|
||||
check_option(${ASN1C_EXEC} -no-gen-OER ASN1C_EXEC)
|
||||
|
||||
#uhd 4.0 and iris installs by default in /usr/local
|
||||
include_directories("/usr/local/include/")
|
||||
#use native cmake method as this package is not in pkg-config
|
||||
|
||||
Reference in New Issue
Block a user