Skip to content

Commit

Permalink
remove checks, fix interface target
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaskenez committed Nov 8, 2024
1 parent 29e8d87 commit 8ee357c
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions cmake/carmaDependencyTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,14 @@ IF (NOT TARGET armadillo AND NOT TARGET armadillo::armadillo)
ENDIF ()
ENDIF ()
IF (NOT TARGET armadillo::armadillo)
IF (TARGET armadillo)
ADD_LIBRARY(armadillo::armadillo ALIAS armadillo)
ELSEIF (Armadillo_FOUND)
IF (NOT ARMADILLO_INCLUDE_DIRS OR NOT ARMADILLO_LIBRARIES)
message(FATAL_ERROR "Armadillo_FOUND is true but ARMADILLO_INCLUDE_DIRS or ARMADILLO_LIBRARIES are not set.")
ENDIF ()
ADD_LIBRARY(armadillo::armadillo INTERFACE)
TARGET_INCLUDE_DIRECTORIES(armadillo::armadillo INTERFACE ${ARMADILLO_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(armadillo::armadillo INTERFACE ${ARMADILLO_LIBRARIES})
IF (Armadillo_FOUND AND NOT TARGET armadillo)
ADD_LIBRARY(armadillo INTERFACE)
TARGET_INCLUDE_DIRECTORIES(armadillo INTERFACE ${ARMADILLO_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(armadillo INTERFACE ${ARMADILLO_LIBRARIES})
ENDIF ()
ADD_LIBRARY(armadillo::armadillo ALIAS armadillo)
ENDIF ()
IF (TARGET armadillo::armadillo)
IF (NOT ARMADILLO_INCLUDE_DIRS)
message(FATAL_ERROR "armadillo::armadillo is a target but ARMADILLO_INCLUDE_DIRS is not set.")
ENDIF ()
LIST(APPEND carma_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIRS})
ENDIF ()

Expand Down

0 comments on commit 8ee357c

Please sign in to comment.