I'm writing code using CLion and CMake. When I try to compile the code within CLion, I get the following error: Failed call: C:/Users/dlink/qt_src/install/bin/qmake.exe -query QMake call failed: The system cannot find the file specified The issue arises in the following lines of the CMake file: execute_process( COMMAND "qmake -query" RESULT_VARIABLE return_code OUTPUT_VARIABLE ALL_VARS ) if(EXISTS "${QT_QMAKE_EXECUTABLE}") message(It exist) endif() if(NOT return_code EQUAL 0) message(WARNING "Failed call: ${QT_QMAKE_EXECUTABLE} -query") message(FATAL_ERROR "QMake call failed: ${return_code}") endif() However, if I execute the same code from the command line, everything works correctly, and the qmake file exists at the specified path. I can run failed command in terminal > C:/Users/dlink/qt_src/install/bin/qmake.exe -query QT_SYSROOT: QT_INSTALL_PREFIX:C:/Users/dlink/qt_src/install QT_INSTALL_ARCHDATA:C:/Users/dlink/qt_src/install QT_INSTALL_DATA:C:/Users/dlink/qt_src/install QT_INSTALL_DOCS:C:/Users/dlink/qt_src/install/doc QT_INSTALL_HEADERS:C:/Users/dlink/qt_src/install/include QT_INSTALL_LIBS:C:/Users/dlink/qt_src/install/lib QT_INSTALL_LIBEXECS:C:/Users/dlink/qt_src/install/bin QT_INSTALL_BINS:C:/Users/dlink/qt_src/install/bin QT_INSTALL_TESTS:C:/Users/dlink/qt_src/install/tests QT_INSTALL_PLUGINS:C:/Users/dlink/qt_src/install/plugins QT_INSTALL_QML:C:/Users/dlink/qt_src/install/qml QT_INSTALL_TRANSLATIONS:C:/Users/dlink/qt_src/install/translations QT_INSTALL_CONFIGURATION: QT_INSTALL_EXAMPLES:C:/Users/dlink/qt_src/install/examples QT_INSTALL_DEMOS:C:/Users/dlink/qt_src/install/examples QT_HOST_PREFIX:C:/Users/dlink/qt_src/install QT_HOST_DATA:C:/Users/dlink/qt_src/install QT_HOST_BINS:C:/Users/dlink/qt_src/install/bin QT_HOST_LIBEXECS:C:/Users/dlink/qt_src/install/bin QT_HOST_LIBS:C:/Users/dlink/qt_src/install/lib QMAKE_SPEC:win32-g++ QMAKE_XSPEC:win32-g++ QMAKE_VERSION:3.1 QT_VERSION:6.5.0