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