Merge pull request #245 from twam/fix_osx

Use cmake's find_library to search for pytrellis.
This commit is contained in:
David Shah 2019-05-18 12:15:08 +01:00 committed by GitHub
commit c9ba65e7b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)