The corresponding CMakeLists.txt contains the following building blocks:
- We define the minimum CMake version, the project name and supported languages:
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)project(recipe-04 LANGUAGES CXX C Fortran)
- We require the C++11 standard:
set(CMAKE_CXX_STANDARD 11)set(CMAKE_CXX_EXTENSIONS OFF)set(CMAKE_CXX_STANDARD_REQUIRED ON)
- Further, we verify whether Fortran and C/C++ compilers work together and generate the header file which will take care of name mangling. Both functions are provided by the FortranCInterface module:
include(FortranCInterface)FortranCInterface_VERIFY(CXX)FortranCInterface_HEADER( fc_mangle.h MACRO_NAMESPACE "FC_" SYMBOLS DSCAL DGESV )
- We then ask CMake to find BLAS ...