Hi all,

I am trying to investigate a case of strange path in CMake build. I get this error.

Qt Code:
  1. c:\__TE\te>cmake -S . -B ./../CDebug -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTE_WARNINGS_AS_ERRORS=ON -DTE_USE_DEFAULT_LIB_PATH=ON -DTE_USE_WEBENGINE=OFF -DCMAKE_PREFIX_PATH=%MEMSOURCE_LIB%\qt5\qtbase\lib\cmake\Qt5
  2. -- Building for: Visual Studio 16 2019
  3. -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.14393.
  4. -- The CXX compiler identification is MSVC 19.28.29915.0
  5. -- Detecting CXX compiler ABI info
  6. -- Detecting CXX compiler ABI info - done
  7. -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
  8. -- Detecting CXX compile features
  9. -- Detecting CXX compile features - done
  10. Not using WebEngine
  11. install prefixXXX
  12. C:/__TE/lib_qt5_15_2_x64/qt5/qtbase
  13. XXXX3
  14. C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/../qt5/qtbase//mkspecs/win32-msvc
  15. CMake Error at C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:14 (message):
  16. The imported target "Qt5::Core" references the file
  17.  
  18. "C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/../qt5/qtbase//mkspecs/win32-msvc"
  19.  
  20. but this file does not exist. Possible reasons include:
  21.  
  22. * The file was deleted, renamed, or moved to another location.
  23.  
  24. * An install or uninstall procedure did not complete successfully.
  25.  
  26. * The installation package was faulty and contained
  27.  
  28. "C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake"
  29.  
  30. but not all the files it references.
  31.  
  32. Call Stack (most recent call first):
  33. C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake:57 (_qt5_Core_check_file_exists)
  34. C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:244 (include)
  35. C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package)
  36. CMakeLists.txt:85 (find_package)
  37.  
  38.  
  39. -- Configuring incomplete, errors occurred!
  40. See also "C:/__TE/CDebug/CMakeFiles/CMakeOutput.log".
  41.  
  42. c:\__TE\te>cmake -S . -B ./../CDebug -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTE_WARNINGS_AS_ERRORS=ON -DTE_USE_DEFAULT_LIB_PATH=ON -DTE_USE_WEBENGINE=OFF -DCMAKE_PREFIX_PATH=%MEMSOURCE_LIB%\qt5\qtbase\lib\cmake\Qt5 -DCMAKE_INSTALL_PREFIX=%MEMSOURCE_LIB%
  43. -- Building for: Visual Studio 16 2019
  44. -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.14393.
  45. -- The CXX compiler identification is MSVC 19.28.29915.0
  46. -- Detecting CXX compiler ABI info
  47. -- Detecting CXX compiler ABI info - done
  48. -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
  49. -- Detecting CXX compile features
  50. -- Detecting CXX compile features - done
  51. Not using WebEngine
  52. install prefixXXX
  53. C:/__TE/lib_qt5_15_2_x64/qt5/qtbase
  54. C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/../qt5/qtbase//mkspecs/win32-msvc
  55. CMake Error at C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:14 (message):
  56. The imported target "Qt5::Core" references the file
  57.  
  58. "C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/../qt5/qtbase//mkspecs/win32-msvc"
  59.  
  60. but this file does not exist. Possible reasons include:
  61.  
  62. * The file was deleted, renamed, or moved to another location.
  63.  
  64. * An install or uninstall procedure did not complete successfully.
  65.  
  66. * The installation package was faulty and contained
  67.  
  68. "C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake"
  69.  
  70. but not all the files it references.
  71.  
  72. Call Stack (most recent call first):
  73. C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake:57 (_qt5_Core_check_file_exists)
  74. C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:244 (include)
  75. C:/__TE/lib_qt5_15_2_x64/qt5/qtbase/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package)
  76. CMakeLists.txt:85 (find_package)
  77.  
  78.  
  79. -- Configuring incomplete, errors occurred!
  80. See also "C:/__TE/CDebug/CMakeFiles/CMakeOutput.log".
To copy to clipboard, switch view to plain text mode 

Similar or identical has already been reported https://bugreports.qt.io/browse/QTBUG-61768 and https://bugreports.qt.io/browse/QTBUG-70189.
Especially the second case is exactly like mine. It says "not reproduced" so no much help.

It was first published here https://stackoverflow.com/questions/...der-windows-10

And I could make the same "fix".

But I wonder... I went through all the project folder to search for _qt5_corelib_extra_includes, to find out where it is set, why is it set to this path that causes the confusion. But to now prevail.
Can someone help me understand where the value of this variable is set? How is it set?

Thanks all