project('usadelndsoc', ['cpp', 'fortran'], version : '0.1', meson_version: '>= 0.55.0', default_options : ['cpp_std=c++17', 'build.cpp_std=c++17']) cpp = meson.get_compiler('cpp') cppad_dep = dependency('cppad') eigen3_dep = dependency('eigen3') if not cppad_dep.found() cppad_dep = cpp.find_library('libcppad_lib', dirs : [get_option('cppad_lib')], has_headers : ['cppad/cppad.h'], header_include_directories : [get_option('cppad_inc')]) if not cppad_dep.found() cppad_dep = cpp.find_library('cppad_lib', dirs : [get_option('cppad_lib')], has_headers : ['cppad/cppad.h'], header_include_directories : [get_option('cppad_inc')], required : true) endif endif if not eigen3_dep.found() if cpp.has_header('Eigen/Core', include_directories : [get_option('eigen_lib')]) eigen3_dep = declare_dependency(include_directories : [get_option('eigen_lib')]) else error('Eigen/Core header not found') endif endif py_mod = import('python') py3 = py_mod.find_installation('python3') py3_dep = py3.dependency() incdir_numpy = run_command(py3, [ '-c', 'import numpy; print(numpy.get_include())' ], check: true ).stdout().strip() cc = meson.get_compiler('cpp') numpy_dep = declare_dependency( compile_args : ['-DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION'], include_directories : [include_directories(incdir_numpy)], dependencies : [py3_dep], ) incdir_pybind11 = run_command(py3, [ '-c', 'import pybind11; print(pybind11.get_include())' ], check: true ).stdout().strip() inc_pybind11 = include_directories(incdir_pybind11) pybind11_dep = declare_dependency( include_directories : [include_directories(incdir_pybind11)], dependencies : [py3_dep] ) deps = [cppad_dep, eigen3_dep] #executable('main', ['src/main.cpp'], dependencies : deps) #executable('main2', ['src/xtest.f95', 'src/adjac/adjac.f95']) subdir('usadelndsoc')