Qt 6.9 ds-build conflicts with ds-src
-
wrote 13 days ago last edited by
After I upgrade my Qt from 6.8.2 to 6.9.0, the CMake configuration fails:
[cmake] CMake Error at qmlcomponents:33 (add_subdirectory): [cmake] The binary directory [cmake] [cmake] E:/Documents/GitHub/Suis/build/Desktop_Qt_6_9_0_MSVC2022_64bit-Debug/_deps/ds-build [cmake] [cmake] is already used to build a source directory. It cannot be used to build [cmake] source directory [cmake] [cmake] E:/Documents/GitHub/Suis/build/Desktop_Qt_6_9_0_MSVC2022_64bit-Debug/_deps/ds-src [cmake] [cmake] Specify a unique binary directory name. [cmake] Call Stack (most recent call first): [cmake] CMakeLists.txt:117 (include) [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred!
I found that the
_deps
directory does not exist in my Qt 6.8.2 build but exists in my Qt 6.9.0 build. Theqmlcomponent
file was automatically generated by Qt Design Studio:### This file is automatically generated by Qt Design Studio. ### Do not change message("Building designer components.") set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml") include(FetchContent) FetchContent_Declare( ds GIT_TAG qds-4.7 # https://github.com/qt-labs/qtquickdesigner-components GIT_REPOSITORY https://code.qt.io/qt-labs/qtquickdesigner-components.git ) FetchContent_GetProperties(ds) # Calling FetchContent_Populate(ds) is deprecated, call FetchContent_MakeAvailable(ds) instead. # Policy CMP0169 can be set to OLD to allow FetchContent_Populate(ds) to be called directly for now, # but the ability to call it with declared details will be removed completely in a future version. FetchContent_MakeAvailable(ds) target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE QuickStudioComponentsplugin QuickStudioEffectsplugin QuickStudioApplicationplugin FlowViewplugin QuickStudioLogicHelperplugin QuickStudioMultiTextplugin QuickStudioEventSimulatorplugin QuickStudioEventSystemplugin ) add_subdirectory(${ds_SOURCE_DIR} ${ds_BINARY_DIR}) target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE BULD_QDS_COMPONENTS=true )
I only changed line 20 to avoid the deprecated
FetchContent_Populate
, but line 33 is not changed. How to fix this error? -
There must be some old cmake files from your old build.
wrote 13 days ago last edited by@Christian-Ehrlicher Hi, I found that if I downgrade CMake to 3.28 and change line 20 back to
FetchContent_Populate
then the CMake build can run successfully. I learned that different fromFetchContent_Populate
,FetchContent_MakeAvailable
not only downloads and unpacks the content but also automatically adds it to my build by calling add_subdirectory() internally. Aftter I removeadd_subdirectory(${ds_SOURCE_DIR} ${ds_BINARY_DIR})
then the CMake build can run successfully -
Lifetime Qt Championwrote 13 days ago last edited by Christian Ehrlicher
Use a clean build dir and make sure you did not do an in-source build by accident (aka remove all build artifacts from your source dir).
-
Use a clean build dir and make sure you did not do an in-source build by accident (aka remove all build artifacts from your source dir).
wrote 13 days ago last edited by@Christian-Ehrlicher Hi, I clean the build dir and redo the build but the error still exists
-
There must be some old cmake files from your old build.
-
There must be some old cmake files from your old build.
wrote 13 days ago last edited by@Christian-Ehrlicher Hi, I found that if I downgrade CMake to 3.28 and change line 20 back to
FetchContent_Populate
then the CMake build can run successfully. I learned that different fromFetchContent_Populate
,FetchContent_MakeAvailable
not only downloads and unpacks the content but also automatically adds it to my build by calling add_subdirectory() internally. Aftter I removeadd_subdirectory(${ds_SOURCE_DIR} ${ds_BINARY_DIR})
then the CMake build can run successfully -
1/5