Use cmake's find_library to search for pytrellis.

This commit is contained in:
Tobias Müller 2019-03-03 11:11:33 +01:00
parent 643d7dec4c
commit ea91ea163e

View File

@ -6,18 +6,18 @@ if (NOT EXTERNAL_CHIPDB)
set(TRELLIS_ROOT "/usr/local/share/trellis")
endif()
file(GLOB found_pytrellis ${TRELLIS_ROOT}/libtrellis/pytrellis.*
/usr/lib/pytrellis.*
/usr/lib64/pytrellis.*
/usr/lib/trellis/pytrellis.*
/usr/lib64/trellis/pytrellis.*)
if (NOT DEFINED PYTRELLIS_LIBDIR)
find_library(PYTRELLIS pytrellis.so
PATHS ${TRELLIS_ROOT}/libtrellis
PATH_SUFFIXES trellis
DOC "Location of pytrellis library")
if ("${found_pytrellis}" STREQUAL "")
message(FATAL_ERROR "failed to locate pytrellis library!")
if ("${PYTRELLIS}" STREQUAL "PYTRELLIS-NOTFOUND")
message(FATAL_ERROR "Failed to locate pytrellis library!")
endif()
list(GET found_pytrellis 0 PYTRELLIS_LIB)
get_filename_component(PYTRELLIS_LIBDIR ${PYTRELLIS_LIB} DIRECTORY)
get_filename_component(PYTRELLIS_LIBDIR ${PYTRELLIS} DIRECTORY)
endif()
set(DB_PY ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/trellis_import.py)