Skip to content

Commit 8ee357c

Browse files
committed
remove checks, fix interface target
1 parent 29e8d87 commit 8ee357c

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

cmake/carmaDependencyTargets.cmake

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,14 @@ IF (NOT TARGET armadillo AND NOT TARGET armadillo::armadillo)
3333
ENDIF ()
3434
ENDIF ()
3535
IF (NOT TARGET armadillo::armadillo)
36-
IF (TARGET armadillo)
37-
ADD_LIBRARY(armadillo::armadillo ALIAS armadillo)
38-
ELSEIF (Armadillo_FOUND)
39-
IF (NOT ARMADILLO_INCLUDE_DIRS OR NOT ARMADILLO_LIBRARIES)
40-
message(FATAL_ERROR "Armadillo_FOUND is true but ARMADILLO_INCLUDE_DIRS or ARMADILLO_LIBRARIES are not set.")
41-
ENDIF ()
42-
ADD_LIBRARY(armadillo::armadillo INTERFACE)
43-
TARGET_INCLUDE_DIRECTORIES(armadillo::armadillo INTERFACE ${ARMADILLO_INCLUDE_DIRS})
44-
TARGET_LINK_LIBRARIES(armadillo::armadillo INTERFACE ${ARMADILLO_LIBRARIES})
36+
IF (Armadillo_FOUND AND NOT TARGET armadillo)
37+
ADD_LIBRARY(armadillo INTERFACE)
38+
TARGET_INCLUDE_DIRECTORIES(armadillo INTERFACE ${ARMADILLO_INCLUDE_DIRS})
39+
TARGET_LINK_LIBRARIES(armadillo INTERFACE ${ARMADILLO_LIBRARIES})
4540
ENDIF ()
41+
ADD_LIBRARY(armadillo::armadillo ALIAS armadillo)
4642
ENDIF ()
4743
IF (TARGET armadillo::armadillo)
48-
IF (NOT ARMADILLO_INCLUDE_DIRS)
49-
message(FATAL_ERROR "armadillo::armadillo is a target but ARMADILLO_INCLUDE_DIRS is not set.")
50-
ENDIF ()
5144
LIST(APPEND carma_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIRS})
5245
ENDIF ()
5346

0 commit comments

Comments
 (0)