diff --git a/src/plugins/qmlprojectmanager/cmakegen/boilerplate.qrc b/src/plugins/qmlprojectmanager/cmakegen/boilerplate.qrc
index a48666d883e..b4eb027e830 100644
--- a/src/plugins/qmlprojectmanager/cmakegen/boilerplate.qrc
+++ b/src/plugins/qmlprojectmanager/cmakegen/boilerplate.qrc
@@ -10,6 +10,7 @@
templates/environment_h.tpl
templates/import_qml_components_h.tpl
templates/qtquickcontrols2_conf.tpl
+ templates/cmakelists_txt_shared.tpl
diff --git a/src/plugins/qmlprojectmanager/cmakegen/cmakewriterv1.cpp b/src/plugins/qmlprojectmanager/cmakegen/cmakewriterv1.cpp
index d78abd227d7..096ceb5d19e 100644
--- a/src/plugins/qmlprojectmanager/cmakegen/cmakewriterv1.cpp
+++ b/src/plugins/qmlprojectmanager/cmakegen/cmakewriterv1.cpp
@@ -70,6 +70,10 @@ void CMakeWriterV1::writeRootCMakeFile(const NodePtr &node) const
const QString fileContent = fileTemplate.arg(appName, fileSection);
writeFile(file, fileContent);
+ const Utils::FilePath sharedFile = node->dir.pathAppended("CMakeLists.txt.shared");
+ const QString sharedTemplate = readTemplate(":/templates/cmake_shared");
+ writeFile(sharedFile, sharedTemplate);
+
const Utils::FilePath userFile = node->dir.pathAppended("qds.cmake");
QString userFileContent(DO_NOT_EDIT_FILE);
userFileContent.append(makeSubdirectoriesBlock(node));
diff --git a/src/plugins/qmlprojectmanager/cmakegen/templates/cmakelists_txt_shared.tpl b/src/plugins/qmlprojectmanager/cmakegen/templates/cmakelists_txt_shared.tpl
new file mode 100644
index 00000000000..3db7152bffa
--- /dev/null
+++ b/src/plugins/qmlprojectmanager/cmakegen/templates/cmakelists_txt_shared.tpl
@@ -0,0 +1,16 @@
+
+
+
+
+ ProjectExplorer.Project.PluginSettings
+
+
+ QTC_DEFAULT_BUILD_DIRECTORY_TEMPLATE=../%{Asciify:%{Project:Name}-%{BuildConfig:Name}}
+
+
+
+
+ Version
+ 22
+
+