Skip to content
Snippets Groups Projects
Commit a90e1d94 authored by Martin Beseda's avatar Martin Beseda
Browse files

FIX: Trying to fix Armadillo finding module

parent 713b2e30
No related branches found
No related tags found
No related merge requests found
...@@ -24,48 +24,45 @@ FIND_PATH( ...@@ -24,48 +24,45 @@ FIND_PATH(
include/armadillo include/armadillo
) )
# Find library # Is Armadillo downloaded locally?
set(LIBNAME ${LIB_PREFIX}armadillo.so) option(LOCAL OFF)
message(${LIBNAME}) IF(${ARMADILLO_INCLUDE_DIR} MATCHES "^.*external_dependencies.*$")
FIND_LIBRARY( set(LOCAL ON)
ARMADILLO_LIBRARY_DIR set(TMP "")
string(REGEX REPLACE "/include" "" TMP ${ARMADILLO_INCLUDE_DIR})
add_subdirectory(${TMP} ${TMP})
endif()
NAMES if(LOCAL)
${LIBNAME} # If Armadillo is downloaded locally, the library will be compiled during build-time
INCLUDE(FindPackageHandleStandardArgs)
HINTS FIND_PACKAGE_HANDLE_STANDARD_ARGS(
external_dependencies/armadillo armadillo
"Armadillo was NOT found!"
PATHS ARMADILLO_INCLUDE_DIR)
/usr/lib
/usr/local/lib
)
# Set ARMADILLO_FOUND honoring the QUIET and REQUIRED arguments
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
armadillo
"Armadillo was NOT found!"
ARMADILLO_INCLUDE_DIR
ARMADILLO_LIBRARY_DIR)
# Output variables else()
IF(ARMADILLO_FOUND) # Find library
# Include dirs set(LIBNAME ${LIB_PREFIX}armadillo.so)
SET(ARMADILLO_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIR}) FIND_LIBRARY(
ARMADILLO_LIBRARY_DIR
# If Armadillo is downloaded as a source code, add it to the project, so the library will be compiled NAMES
# automatically ${LIBNAME}
IF(${ARMADILLO_INCLUDE_DIR} MATCHES "^.*external_dependencies.*$")
set(TMP "")
string(REGEX REPLACE "/include" "" TMP ${ARMADILLO_INCLUDE_DIR})
add_subdirectory(${TMP} ${TMP})
ENDIF()
message("Armadillo was successfully found.") HINTS
ENDIF() external_dependencies/armadillo
# Advanced options for not cluttering the cmake UIs: PATHS
MARK_AS_ADVANCED(ARMADILLO_INCLUDE_DIR) /usr/lib
MARK_AS_ADVANCED(ARMADILLO_LIBRARY_DIR) /usr/local/lib
)
# Set ARMADILLO_FOUND honoring the QUIET and REQUIRED arguments
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
armadillo
"Armadillo was NOT found!"
ARMADILLO_INCLUDE_DIR
ARMADILLO_LIBRARY_DIR)
endif()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment