16 lines
592 B
CMake
16 lines
592 B
CMake
if(NOT DEFINED ASN1C_OUTPUT_DIR)
|
|||
|
|
message(FATAL_ERROR "Missing ASN.1 output directory (ASN1C_OUTPUT_DIR)")
|
||
|
|
elseif(NOT DEFINED ASN1C_PREFIX)
|
||
|
|
message(FATAL_ERROR "Missing ASN.1 prefix (ASN1C_PREFIX)")
|
||
|
|
endif()
|
||
|
|
|
||
|
|
message(STATUS "removing prefix '${ASN1C_PREFIX}' from files in ${ASN1C_OUTPUT_DIR}")
|
||
|
|
file(GLOB _files ${ASN1C_OUTPUT_DIR}/${ASN1C_PREFIX}*)
|
||
|
|
foreach(_from ${_files})
|
||
|
|
get_filename_component(_dir ${_from} DIRECTORY)
|
||
|
|
get_filename_component(_name ${_from} NAME)
|
||
|
|
string(REPLACE "${ASN1C_PREFIX}" "" _to "${_name}")
|
||
|
|
file(RENAME ${_from} ${_dir}/${_to})
|
||
|
|
endforeach()
|
||
|
|
|