diff --git a/CMakeLists.txt b/CMakeLists.txt index 25343e9d0bff5e6fb63bdb107f64f74936b61b7e..b0202f4ff506d8c5812d44aaf81fae618745c927 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -303,7 +303,14 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/") list(APPEND CMAKE_EXE_LINKER_FLAGS "${BLAS_LINKER_FLAGS}") endif() else() - message(FATAL_ERROR "A BLAS library is required but has not been found") + message(FATAL_ERROR "BLAS library has not been found") + #install_package(BLAS DOWNLOAD) + #find_package(BLASEXT) + #if (BLAS_FOUND) + # message(STATUS "BLAS library has been found after automatic installation") + #else() + # message(FATAL_ERROR "BLAS library has not been found after automatic installation") + #endif() endif() if(CBLAS_FOUND) include_directories(${CBLAS_INCLUDE_DIRS}) diff --git a/cmake_modules/morse/MorseInit.cmake b/cmake_modules/morse/MorseInit.cmake index ccb52876201ceca6e85d975ae6c2a6da8e2e5b7f..6e24ceaa789a8fba1733031be13d1eeb76ed83c8 100644 --- a/cmake_modules/morse/MorseInit.cmake +++ b/cmake_modules/morse/MorseInit.cmake @@ -46,6 +46,9 @@ include(AuxilaryFlags) # Add the path where we handle our FindFOO.cmake to seek for liraries list(APPEND CMAKE_MODULE_PATH ${MORSE_CMAKE_MODULE_PATH}/find) +# Install libraries if not discovered on the system +include(InstallPackage) + option(MORSE_VERBOSE_FIND_PACKAGE "Add additional messages concerning no found packages" OFF) #message("-- ${BoldGreen}MORSE_VERBOSE_FIND_PACKAGE is set to OFF, turn it ON to get" # "information about packages not found${ColourReset}") diff --git a/cmake_modules/morse/find/FindCBLAS.cmake b/cmake_modules/morse/find/FindCBLAS.cmake index 15994828fb2af983b79833972bac3c58864c6447..c3945f718cb7a7143e4cfcaf6e472ea3209c42ec 100644 --- a/cmake_modules/morse/find/FindCBLAS.cmake +++ b/cmake_modules/morse/find/FindCBLAS.cmake @@ -102,7 +102,9 @@ endif() if (CBLAS_FIND_COMPONENTS) foreach( component ${CBLAS_FIND_COMPONENTS} ) if(CBLAS_FIND_REQUIRED_${component}) - find_package(${component} REQUIRED) + if (CBLAS_FIND_REQUIRED) + find_package(${component} REQUIRED) + endif() else() find_package(${component}) endif()