forked from qt-creator/qt-creator
CMakeProjectManager: Use CMAKE_HOME_DIRECTORY as source directory
The CMakeCache.txt file has CMAKE_HOME_DIRECTORY pointing to the project source directory used to configure the project. When importing a cmake build the CMAKE_HOME_DIRECTORY from CMakeCache.txt might not point to the same CMakeLists.txt that was opened as a project. qt-cmake-standalone-test from Qt6 uses a CMake template project which does a add_subdirectory with the test source directory, which will not work if opened standalone. Normally this is a user error though, so ask the user if this was intended, before actually importing the build. Task-number: QTBUG-88776 Change-Id: Ifdd5e1d1cb8a1ef9955d22493eba3a1a55dc689f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -37,6 +37,7 @@ const char RESCAN_PROJECT[] = "CMakeProject.RescanProject";
|
||||
const char RUN_CMAKE_CONTEXT_MENU[] = "CMakeProject.RunCMakeContextMenu";
|
||||
const char BUILD_FILE_CONTEXT_MENU[] = "CMakeProject.BuildFileContextMenu";
|
||||
const char BUILD_FILE[] = "CMakeProject.BuildFile";
|
||||
const char CMAKE_HOME_DIR[] = "CMakeProject.HomeDirectory";
|
||||
|
||||
// Project
|
||||
const char CMAKE_PROJECT_ID[] = "CMakeProjectManager.CMakeProject";
|
||||
|
||||
Reference in New Issue
Block a user