File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -25,18 +25,29 @@ IF (NOT DEFINED PYTHON_EXECUTABLE)
2525ENDIF ()
2626
2727# Armadillo dependency
28- IF (NOT TARGET armadillo)
28+ IF (NOT TARGET armadillo AND NOT TARGET armadillo::armadillo )
2929 IF (carma_FIND_REQUIRED)
3030 FIND_PACKAGE (Armadillo REQUIRED)
3131 ELSE ()
3232 FIND_PACKAGE (Armadillo)
3333 ENDIF ()
34- ADD_LIBRARY (armadillo INTERFACE )
35- TARGET_INCLUDE_DIRECTORIES (armadillo INTERFACE ${ARMADILLO_INCLUDE_DIRS} )
36- TARGET_LINK_LIBRARIES (armadillo INTERFACE ${ARMADILLO_LIBRARIES} )
3734ENDIF ()
38- IF (armadillo_FOUND OR ARMADILLO_FOUND OR TARGET armadillo)
39- ADD_LIBRARY (armadillo::armadillo ALIAS armadillo)
35+ 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} )
45+ ENDIF ()
46+ ENDIF ()
47+ IF (TARGET armadillo::armadillo)
48+ if (NOT ARMADILLO_INCLUDE_DIRS OR NOT ARMADILLO_LIBRARIES)
49+ message (FATAL_ERROR "armadillo::armadillo is a target but ARMADILLO_INCLUDE_DIRS is not set." )
50+ ENDIF ()
4051 LIST (APPEND carma_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIRS} )
4152ENDIF ()
4253
You can’t perform that action at this time.
0 commit comments