CMake QT_INSTALL_BIN_DIR not set to the value of CMAKE_INSTALL_BINDIR as expected
-
My CMakeLists.txt starts like this:
set(PROJECT_NAME DeepSkyStacker) set(COMPILE_WARNING_AS_ERROR YES) set(CMAKE_INSTALL_BINDIR ".") find_package(Qt6 6.8 REQUIRED COMPONENTS Core Gui Widgets Network Charts LinguistTools) qt_standard_project_setup()
Later on I have:
message ("Qt Deploy Bin Dir: " ${QT_DEPLOY_BIN_DIR}) message ("Target filename:" $<TARGET_FILE_NAME:DeepSkyStacker>) set(executable_path "\${QT_DEPLOY_BIN_DIR}/$<TARGET_FILE_NAME:DeepSkyStacker>") message ("executable_path: " ${executable_path}) qt_generate_deploy_script( TARGET DeepSkyStacker OUTPUT_SCRIPT deploy_script CONTENT " qt_deploy_runtime_dependencies( EXECUTABLE \"${executable_path}\" GENERATE_QT_CONF VERBOSE )")
The generate step produces output:
1> [CMake] System Name is: Windows prefix path: C:/Qt/6.8.0/msvc2022_64 1> [CMake] x64 architecture in use 1> [CMake] Install prefix set to: C:/Users/amonra/Documents/GitHub/DSS/x64/Debug 1> [CMake] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 1> [CMake] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 1> [CMake] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 1> [CMake] Qt Deploy Bin Dir: 1> [CMake] Target filename:$<TARGET_FILE_NAME:DeepSkyStacker> 1> [CMake] executable_path: ${QT_DEPLOY_BIN_DIR}/$<TARGET_FILE_NAME:DeepSkyStacker>
Note that QT_INSTALL_BIN_DIR is empty, NOT the character .
The result is that the install fails:
-- Installing: C:/Users/amonra/Documents/GitHub/DSS/x64/Debug/./DeepSkyStacker.exe -- Writing C:/Users/amonra/Documents/GitHub/DSS/x64/Debug/./qt.conf -- Running Qt deploy tool for /DeepSkyStacker.exe in working directory 'C:/Users/amonra/Documents/GitHub/DSS/x64/Debug' 'C:/Qt/6.8.0/msvc2022_64/bin/windeployqt.exe' '/DeepSkyStacker.exe' '--verbose' '2' '--dir' '.' '--libdir' '--plugindir' 'plugins' '--qml-deploy-dir' 'qml' '--translationdir' 'translations' '--force' '--qtpaths' 'C:/Qt/6.8.0/msvc2022_64/bin/qtpaths6.exe' Running: C:/Qt/6.8.0/msvc2022_64/bin/qtpaths6.exe -query Trying to read translation catalogs from "C:/Qt/6.8.0/msvc2022_64/translations/catalogs.json". Found catalog "qtbase". : : readPeExecutable: C:\Qt\6.8.0\msvc2022_64\plugins\tls\qschannelbackend.dll 64 bit, release readPeExecutable: C:\Qt\6.8.0\msvc2022_64\plugins\tls\qschannelbackendd.dll 64 bit, debug "\DeepSkyStacker.exe" does not exist. readPeExecutable: C:\Qt\6.8.0\msvc2022_64\plugins\webview\qtwebview_webengine.dll 64 bit, release readPeExecutable: C:\Qt\6.8.0\msvc2022_64\plugins\webview\qtwebview_webengined.dll 64 bit, debug CMake Error at C:/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:535 (message): Executing C:/Qt/6.8.0/msvc2022_64/bin/windeployqt.exe failed: 1
which isn't surprising because it was looking for /DeepSkyStacker.exe, when it should have been looking for ./DeepSkyStacker.exe
So why was QT_INSTALL_BIN_DIR not set to the value of CMAKE_INSTALL_BINDIR?
-
My CMakeLists.txt starts like this:
set(PROJECT_NAME DeepSkyStacker) set(COMPILE_WARNING_AS_ERROR YES) set(CMAKE_INSTALL_BINDIR ".") find_package(Qt6 6.8 REQUIRED COMPONENTS Core Gui Widgets Network Charts LinguistTools) qt_standard_project_setup()
Later on I have:
message ("Qt Deploy Bin Dir: " ${QT_DEPLOY_BIN_DIR}) message ("Target filename:" $<TARGET_FILE_NAME:DeepSkyStacker>) set(executable_path "\${QT_DEPLOY_BIN_DIR}/$<TARGET_FILE_NAME:DeepSkyStacker>") message ("executable_path: " ${executable_path}) qt_generate_deploy_script( TARGET DeepSkyStacker OUTPUT_SCRIPT deploy_script CONTENT " qt_deploy_runtime_dependencies( EXECUTABLE \"${executable_path}\" GENERATE_QT_CONF VERBOSE )")
The generate step produces output:
1> [CMake] System Name is: Windows prefix path: C:/Qt/6.8.0/msvc2022_64 1> [CMake] x64 architecture in use 1> [CMake] Install prefix set to: C:/Users/amonra/Documents/GitHub/DSS/x64/Debug 1> [CMake] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 1> [CMake] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 1> [CMake] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 1> [CMake] Qt Deploy Bin Dir: 1> [CMake] Target filename:$<TARGET_FILE_NAME:DeepSkyStacker> 1> [CMake] executable_path: ${QT_DEPLOY_BIN_DIR}/$<TARGET_FILE_NAME:DeepSkyStacker>
Note that QT_INSTALL_BIN_DIR is empty, NOT the character .
The result is that the install fails:
-- Installing: C:/Users/amonra/Documents/GitHub/DSS/x64/Debug/./DeepSkyStacker.exe -- Writing C:/Users/amonra/Documents/GitHub/DSS/x64/Debug/./qt.conf -- Running Qt deploy tool for /DeepSkyStacker.exe in working directory 'C:/Users/amonra/Documents/GitHub/DSS/x64/Debug' 'C:/Qt/6.8.0/msvc2022_64/bin/windeployqt.exe' '/DeepSkyStacker.exe' '--verbose' '2' '--dir' '.' '--libdir' '--plugindir' 'plugins' '--qml-deploy-dir' 'qml' '--translationdir' 'translations' '--force' '--qtpaths' 'C:/Qt/6.8.0/msvc2022_64/bin/qtpaths6.exe' Running: C:/Qt/6.8.0/msvc2022_64/bin/qtpaths6.exe -query Trying to read translation catalogs from "C:/Qt/6.8.0/msvc2022_64/translations/catalogs.json". Found catalog "qtbase". : : readPeExecutable: C:\Qt\6.8.0\msvc2022_64\plugins\tls\qschannelbackend.dll 64 bit, release readPeExecutable: C:\Qt\6.8.0\msvc2022_64\plugins\tls\qschannelbackendd.dll 64 bit, debug "\DeepSkyStacker.exe" does not exist. readPeExecutable: C:\Qt\6.8.0\msvc2022_64\plugins\webview\qtwebview_webengine.dll 64 bit, release readPeExecutable: C:\Qt\6.8.0\msvc2022_64\plugins\webview\qtwebview_webengined.dll 64 bit, debug CMake Error at C:/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:535 (message): Executing C:/Qt/6.8.0/msvc2022_64/bin/windeployqt.exe failed: 1
which isn't surprising because it was looking for /DeepSkyStacker.exe, when it should have been looking for ./DeepSkyStacker.exe
So why was QT_INSTALL_BIN_DIR not set to the value of CMAKE_INSTALL_BINDIR?
@Perdrix said in CMake QT_INSTALL_BIN_DIR not set to the value of CMAKE_INSTALL_BINDIR as expected:
set(executable_path "${QT_DEPLOY_BIN_DIR}/$<TARGET_FILE_NAME:DeepSkyStacker>")
Why is there \ in front of ${QT_DEPLOY_BIN_DIR}?
-
Hmm - good question but it was there until a few moments back and removing it didn't change the behaviour. This thread now superseded, please see:
https://forum.qt.io/topic/159565/problems-with-qt_deploy_runtime_dependencies