@@ -42,6 +42,7 @@ subroutine build_model(model, settings, package, error)
42
42
integer :: i
43
43
type (package_config_t) :: dependency
44
44
character (len= :), allocatable :: manifest, lib_dir
45
+ type (string_t) :: include_dir
45
46
46
47
if (settings% verbose)then
47
48
write (* ,* )' <INFO>BUILD_NAME:' ,settings% build_name
@@ -50,6 +51,7 @@ subroutine build_model(model, settings, package, error)
50
51
51
52
model% package_name = package% name
52
53
54
+ allocate (model% include_dirs(0 ))
53
55
allocate (model% link_libraries(0 ))
54
56
55
57
call new_dependency_tree(model% deps, cache= join_path(" build" , " cache.toml" ))
@@ -141,10 +143,23 @@ subroutine build_model(model, settings, package, error)
141
143
model% packages(i)% name = dependency% name
142
144
143
145
if (allocated (dependency% library)) then
144
- lib_dir = join_path(dep% proj_dir, dependency% library% source_dir)
145
- call add_sources_from_dir(model% packages(i)% sources, lib_dir, FPM_SCOPE_LIB, &
146
- error= error)
147
- if (allocated (error)) exit
146
+
147
+ if (allocated (dependency% library% source_dir)) then
148
+ lib_dir = join_path(dep% proj_dir, dependency% library% source_dir)
149
+ if (is_dir(lib_dir)) then
150
+ call add_sources_from_dir(model% packages(i)% sources, lib_dir, FPM_SCOPE_LIB, &
151
+ error= error)
152
+ if (allocated (error)) exit
153
+ end if
154
+ end if
155
+
156
+ if (allocated (dependency% library% include_dir)) then
157
+ include_dir% s = join_path(dep% proj_dir, dependency% library% include_dir)
158
+ if (is_dir(include_dir% s)) then
159
+ model% include_dirs = [model% include_dirs, include_dir]
160
+ end if
161
+ end if
162
+
148
163
end if
149
164
150
165
if (allocated (dependency% build% link)) then
0 commit comments