diff --git a/verilator-config.cmake.in b/verilator-config.cmake.in index 6b2338662..5abcc1711 100644 --- a/verilator-config.cmake.in +++ b/verilator-config.cmake.in @@ -142,6 +142,10 @@ function(verilate TARGET) endif() if (NOT VERILATE_PREFIX) + list(LENGTH VERILATE_SOURCES NUM_SOURCES) + if (${NUM_SOURCES} GREATER 1) + message(WARNING "Specify PREFIX if there are multiple SOURCES") + endif() list(GET VERILATE_SOURCES 0 TOPSRC) get_filename_component(_SRC_NAME ${TOPSRC} NAME_WE) set(VERILATE_PREFIX V${_SRC_NAME})