Skip to content

Commit

Permalink
Fix cmake: cannot create directory: /cmake/Amici
Browse files Browse the repository at this point in the history
Fixes cmake-install failures during model import in cases where BLAS was not found via FindBLAS.

Needs a prettier solution at some point, but it does the job for now.
  • Loading branch information
dweindl committed Mar 28, 2024
1 parent 790ab44 commit 195588e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cmake/AmiciFindBLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ if(NOT TARGET BLAS::BLAS)
INTERFACE_INCLUDE_DIRECTORIES "${BLAS_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${BLAS_LIBRARIES}")
add_library(BLAS::BLAS ALIAS BLAS)
install(TARGETS BLAS EXPORT BLAS)
export(EXPORT BLAS NAMESPACE BLAS::)
install(
EXPORT BLAS
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Amici"
NAMESPACE BLAS::)

if("${PROJECT_NAME}" STREQUAL "amici")
install(TARGETS BLAS EXPORT BLAS)
export(EXPORT BLAS NAMESPACE BLAS::)
install(
EXPORT BLAS
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Amici"
NAMESPACE BLAS::)
endif()

# legacy python package environment variables:
if(DEFINED ENV{BLAS_CFLAGS})
Expand Down

0 comments on commit 195588e

Please sign in to comment.