| 1 |
2 |
jamieiles |
find_path(VERILATOR_INCLUDE_DIR verilated.h
|
| 2 |
|
|
HINTS /usr/share/verilator/include
|
| 3 |
|
|
/usr/local/share/verilator/include)
|
| 4 |
|
|
find_path(VERILATOR_VPI_INCLUDE_DIR vpi_user.h
|
| 5 |
|
|
HINTS /usr/share/verilator/include/vltstd
|
| 6 |
|
|
/usr/local/share/verilator/include/vltstd)
|
| 7 |
|
|
find_path(VERILATOR_VCD_INCLUDE_DIR verilated_vcd_c.h
|
| 8 |
|
|
HINTS /usr/share/verilator/include
|
| 9 |
|
|
/usr/local/share/verilator/include)
|
| 10 |
|
|
find_file(VERILATED_CPP verilated.cpp
|
| 11 |
|
|
HINTS /usr/share/verilator/include
|
| 12 |
|
|
/usr/local/share/verilator/include)
|
| 13 |
|
|
find_file(VERILATED_COV_CPP verilated_cov.cpp
|
| 14 |
|
|
HINTS /usr/share/verilator/include
|
| 15 |
|
|
/usr/local/share/verilator/include)
|
| 16 |
|
|
find_file(VERILATED_VCD_CPP verilated_vcd_c.cpp
|
| 17 |
|
|
HINTS /usr/share/verilator/include
|
| 18 |
|
|
/usr/local/share/verilator/include)
|
| 19 |
|
|
find_file(VERILATED_DPI_CPP verilated_dpi.cpp
|
| 20 |
|
|
HINTS /usr/share/verilator/include
|
| 21 |
|
|
/usr/local/share/verilator/include)
|
| 22 |
|
|
|
| 23 |
|
|
if (VERILATOR_INCLUDE_DIR AND EXISTS "${VERILATOR_INCLUDE_DIR}/verilated_config.h")
|
| 24 |
|
|
file(STRINGS "${VERILATOR_INCLUDE_DIR}/verilated_config.h" VERILATOR_VERSION_STRING_LINE REGEX "^#define[ \t]+VERILATOR_VERSION[ \t]+\".*\"$")
|
| 25 |
|
|
string(REGEX REPLACE "^#define[ \t]+VERILATOR_VERSION[ \t]+\"(.*)\"$" "\\1" VERILATOR_VERSION_STRING "${VERILATOR_VERSION_STRING_LINE}")
|
| 26 |
|
|
endif ()
|
| 27 |
|
|
|
| 28 |
|
|
set(VERILATOR_INCLUDE_DIRS ${VERILATOR_INCLUDE_DIR} ${VERILATOR_VPI_INCLUDE_DIR} ${VERILATOR_VCD_INCLUDE_DIR})
|
| 29 |
|
|
set(VERILATOR_LIB_SOURCES ${VERILATED_CPP} ${VERILATED_COV_CPP} ${VERILATED_VCD_CPP} ${VERILATED_DPI_CPP})
|
| 30 |
|
|
|
| 31 |
|
|
include(FindPackageHandleStandardArgs)
|
| 32 |
|
|
|
| 33 |
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(VERILATOR
|
| 34 |
|
|
REQUIRED_VARS VERILATOR_LIB_SOURCES VERILATOR_INCLUDE_DIRS
|
| 35 |
|
|
VERSION_VAR VERILATOR_VERSION_STRING)
|