Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cmake_macros/esrocos.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ function(esrocos_asn1_types_package NAME)
# Process optional arguments
set(MODE "ASN1")
set(ASN1_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${NAME}")
file(MAKE_DIRECTORY ${ASN1_OUT_DIR})
set(ASN1_COMPILER "$ENV{HOME}/tool-inst/share/asn1scc/asn1.exe" CACHE STRING "ASN compiler location")
set(ASN1_PREFIX "asn1Scc" CACHE STRING "ASN type prefix")
foreach(ARG ${ARGN})
if(ARG STREQUAL "ASN1")
# Set next argument mode to ASN1 file
Expand All @@ -180,6 +183,7 @@ function(esrocos_asn1_types_package NAME)
elseif(MODE STREQUAL "OUTDIR")
# Add imported package
set(ASN1_OUT_DIR "${ARG}")
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${ARG}")
else()
# Unexpected mode
message(FATAL_ERROR "Internal error at esrocos_asn1_types_package(${NAME}): wrong mode ${MODE}.")
Expand All @@ -204,7 +208,7 @@ function(esrocos_asn1_types_package NAME)
if(NOT EXISTS ${NAME}_timestamp)
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${ASN1_OUT_DIR}
COMMAND mono $ENV{HOME}/tool-inst/share/asn1scc/asn1.exe -c -typePrefix asn1Scc -uPER -wordSize 8 -ACN -o ${ASN1_OUT_DIR} -atc ${ASN1_FILES}
COMMAND mono ${ASN1_COMPILER} -c -typePrefix ${ASN1_PREFIX} -uPER -wordSize 8 -ACN -o ${ASN1_OUT_DIR} -atc ${ASN1_FILES}
RESULT_VARIABLE ASN1SCC_RESULT
)

Expand All @@ -222,7 +226,7 @@ function(esrocos_asn1_types_package NAME)
# Command for C compilation; creates timestamp file
add_custom_command(OUTPUT ${NAME}_timestamp
COMMAND ${CMAKE_COMMAND} -E make_directory ${ASN1_OUT_DIR}
COMMAND mono $ENV{HOME}/tool-inst/share/asn1scc/asn1.exe -c -typePrefix asn1Scc -uPER -wordSize 8 -ACN -o ${ASN1_OUT_DIR} -atc ${ASN1_FILES}
COMMAND mono ${ASN1_COMPILER} -c -typePrefix ${ASN1_PREFIX} -uPER -wordSize 8 -ACN -o ${ASN1_OUT_DIR} -atc ${ASN1_FILES}
COMMAND ${CMAKE_COMMAND} -E touch ${NAME}_timestamp
DEPENDS ${ASN1_FILES}
COMMENT "Generate header files for: ${ASN1_IMPORTS} ${ASN1_FILES} in ${ASN1_OUT_DIR}"
Expand Down