From ad3869da115fb9986228a9d892486c32cc9e2a9d Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Wed, 17 Mar 2021 00:43:46 +0100 Subject: [PATCH] Emit add_subdirectory calls after the project but before the targets --- src/cmkrlib/cmake.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cmkrlib/cmake.cpp b/src/cmkrlib/cmake.cpp index 014015b..0ae3898 100644 --- a/src/cmkrlib/cmake.cpp +++ b/src/cmkrlib/cmake.cpp @@ -64,10 +64,6 @@ CMake::CMake(const std::string &path, bool build) { if (cmake.contains("link-flags")) { linkflags = detail::to_string_vec(toml::find(cmake, "link-flags").as_array()); } - - if (cmake.contains("subdirs")) { - subdirs = detail::to_string_vec(toml::find(cmake, "subdirs").as_array()); - } } if (toml.contains("project")) { @@ -86,6 +82,9 @@ CMake::CMake(const std::string &path, bool build) { if (project.contains("include-after")) { include_after = detail::to_string_vec(toml::find(project, "include-after").as_array()); } + if (project.contains("subdirs")) { + subdirs = detail::to_string_vec(toml::find(project, "subdirs").as_array()); + } } if (toml.contains("settings")) {