We will start with the main CMakeLists.txt and later move to deps/CMakeLists.txt:
- As before, we declare a C++11 project:
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) project(recipe-04 LANGUAGES CXX Fortran)set(CMAKE_CXX_STANDARD 11)set(CMAKE_CXX_EXTENSIONS OFF)set(CMAKE_CXX_STANDARD_REQUIRED ON)
- At this point, we move on to deps/CMakeLists.txt. This is achieved with the add_subdirectory command:
add_subdirectory(deps)
- Inside deps/CMakeLists.txt, we first locate the necessary libraries (BLAS and LAPACK):
find_package(BLAS REQUIRED)find_package(LAPACK REQUIRED)
- Then, we collect the contents of the tarball archive into a variable, MATH_SRCS:
set(MATH_SRCS ${CMAKE_CURRENT_BINARY_DIR}/wrap_BLAS_LAPACK/CxxBLAS.cpp ${CMAKE_CURRENT_BINARY_DIR}/wrap_BLAS_LAPACK/CxxLAPACK.cpp ...