CMake: fix path checks in chipdb build scripts.

`if(NOT DEFINED)` is not appropriate since a variable that contains
`-NOTFOUND` still counts as `DEFINED`. This can cause issues if
configuration fails, writes `-NOTFOUND` to the cache, and is then
restarted.
This commit is contained in:
whitequark 2020-07-01 20:22:21 +00:00
parent c0901fb972
commit f6e30f22f4
2 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ else()
"Trellis install prefix") "Trellis install prefix")
message(STATUS "Trellis install prefix: ${TRELLIS_INSTALL_PREFIX}") message(STATUS "Trellis install prefix: ${TRELLIS_INSTALL_PREFIX}")
if(NOT DEFINED TRELLIS_LIBDIR) if(NOT TRELLIS_LIBDIR)
if(WIN32) if(WIN32)
set(pytrellis_lib pytrellis.pyd) set(pytrellis_lib pytrellis.pyd)
else() else()
@ -42,7 +42,7 @@ else()
endif() endif()
message(STATUS "Trellis library directory: ${TRELLIS_LIBDIR}") message(STATUS "Trellis library directory: ${TRELLIS_LIBDIR}")
if(NOT DEFINED TRELLIS_DATADIR) if(NOT TRELLIS_DATADIR)
set(TRELLIS_DATADIR ${TRELLIS_INSTALL_PREFIX}/share/${TRELLIS_PROGRAM_PREFIX}trellis) set(TRELLIS_DATADIR ${TRELLIS_INSTALL_PREFIX}/share/${TRELLIS_PROGRAM_PREFIX}trellis)
endif() endif()
message(STATUS "Trellis data directory: ${TRELLIS_DATADIR}") message(STATUS "Trellis data directory: ${TRELLIS_DATADIR}")

View File

@ -27,7 +27,7 @@ else()
"IceStorm install prefix") "IceStorm install prefix")
message(STATUS "IceStorm install prefix: ${ICESTORM_INSTALL_PREFIX}") message(STATUS "IceStorm install prefix: ${ICESTORM_INSTALL_PREFIX}")
if(NOT DEFINED ICEBOX_DATADIR) if(NOT ICEBOX_DATADIR)
set(ICEBOX_DATADIR ${ICESTORM_INSTALL_PREFIX}/share/icebox) set(ICEBOX_DATADIR ${ICESTORM_INSTALL_PREFIX}/share/icebox)
endif() endif()
message(STATUS "icebox data directory: ${ICEBOX_DATADIR}") message(STATUS "icebox data directory: ${ICEBOX_DATADIR}")