diff --git a/bind/python/meson.build b/bind/python/meson.build index ae6d8a2a..0c4fa619 100644 --- a/bind/python/meson.build +++ b/bind/python/meson.build @@ -1,3 +1,4 @@ +pythondir = 'python' project_pkg_vars += 'pythonpath=' + '${prefix}' / pythondir install_subdir('pyiguana', install_dir: pythondir) diff --git a/meson.build b/meson.build index ba40cc0f..780cef9d 100644 --- a/meson.build +++ b/meson.build @@ -168,19 +168,35 @@ add_project_arguments( language: [ 'cpp' ], ) +# start chameleon +use_chameleon = get_option('bind_fortran') +if use_chameleon + subdir('src/chameleon') +endif + # build and install shared libraries -subdir('src/chameleon') subdir('src/iguana/services') subdir('src/iguana/algorithms') -subdir('src/iguana/bindings') subdir('src/iguana/tests') -# build bindings -pythondir = 'python' +# build and install bindings +if use_chameleon + subdir('src/iguana/bindings') +endif if get_option('bind_python') subdir('bind/python') endif +# build examples +if get_option('install_examples') + subdir('examples') +endif + +# generate documentation +if get_option('install_documentation') + subdir('doc/gen') +endif + # generate pkg-config file project_pkg_vars_nonempty = [] foreach var : project_pkg_vars @@ -196,16 +212,6 @@ pkg.generate( variables: project_pkg_vars_nonempty, ) -# build examples -if get_option('install_examples') - subdir('examples') -endif - -# generate documentation -if get_option('install_documentation') - subdir('doc/gen') -endif - # install environment setup files if get_option('z_install_envfile') configure_file( diff --git a/src/chameleon/meson.build b/src/chameleon/meson.build index 448782c2..44163b94 100644 --- a/src/chameleon/meson.build +++ b/src/chameleon/meson.build @@ -1,5 +1,3 @@ -use_chameleon = get_option('bind_fortran') - chameleon_sources = files( 'chameleon', 'src' / 'generator.rb', diff --git a/src/iguana/bindings/meson.build b/src/iguana/bindings/meson.build index 87fb6eb0..909390b6 100644 --- a/src/iguana/bindings/meson.build +++ b/src/iguana/bindings/meson.build @@ -1,26 +1,22 @@ -if use_chameleon +algo_bind_c_sources += [ 'Bindings.cc' ] +algo_bind_c_headers = [ 'Bindings.h' ] - algo_bind_c_sources += [ 'Bindings.cc' ] - algo_bind_c_headers = [ 'Bindings.h' ] - - # build C bindings - if get_option('bind_fortran') - algo_bind_c_lib = shared_library( - 'IguanaBindingsC', - algo_bind_c_sources, - include_directories: [ project_inc ] + ROOT_dep_inc_dirs, - dependencies: project_deps, - link_with: [ services_lib, algo_lib ], - link_args: ROOT_dep_link_args + ROOT_dep_link_args_for_validators, - install: true, - build_rpath: ROOT_dep_rpath, - ) - project_libs += algo_bind_c_lib - endif - install_headers( - algo_bind_c_headers, - subdir: meson.project_name() / 'bindings', - preserve_path: true, +# build C bindings +if get_option('bind_fortran') + algo_bind_c_lib = shared_library( + 'IguanaBindingsC', + algo_bind_c_sources, + include_directories: [ project_inc ] + ROOT_dep_inc_dirs, + dependencies: project_deps, + link_with: [ services_lib, algo_lib ], + link_args: ROOT_dep_link_args + ROOT_dep_link_args_for_validators, + install: true, + build_rpath: ROOT_dep_rpath, ) - + project_libs += algo_bind_c_lib endif +install_headers( + algo_bind_c_headers, + subdir: meson.project_name() / 'bindings', + preserve_path: true, +)