# CMAKE\_OBJECT\_PATH\_MAX does it also apply to dependency files ('.d') ?

**URL:** https://discourse.cmake.org/t/cmake-object-path-max-does-it-also-apply-to-dependency-files-d/5319
**Category:** Usage
**Created:** [March 29, 2022, 6:37pm UTC](https://discourse.cmake.org/t/cmake-object-path-max-does-it-also-apply-to-dependency-files-d/5319 "2022-03-29T18:37:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Rich\_von\_Lehe](https://discourse.cmake.org/user_avatar/discourse.cmake.org/rich_von_lehe/32/307_2.png) [@Rich\_von\_Lehe](https://discourse.cmake.org/u/Rich_von_Lehe)
#### Post date: [March 29, 2022, 6:37pm UTC](https://discourse.cmake.org/t/cmake-object-path-max-does-it-also-apply-to-dependency-files-d/5319/1 "2022-03-29T18:37:56Z")

</div>

I’m getting an error that I believe is due to a very long pathname:

```auto
[1711/2435 12.4/sec] Building CXX object eSW/Qt/AEPPApps/ManufacturingCalibration/CMakeFiles/ManufacturingCalibration.dir/.._.._.._.._.._build-AEPP-Qt5_6_3_QNX_Arm-Release_eSW_Qt_AEPPApps_ManufacturingCalibration_ManufacturingCalibrationButton_qml.cpp.o
FAILED: eSW/Qt/AEPPApps/ManufacturingCalibration/CMakeFiles/ManufacturingCalibration.dir/.._.._.._.._.._build-AEPP-Qt5_6_3_QNX_Arm-Release_eSW_Qt_AEPPApps_ManufacturingCalibration_ManufacturingCalibrationButton_qml.cpp.o 
C:\qnx700\host\win64\x86_64\usr\bin\q++.exe -Vgcc_ntoarmv7le -Wc,-isysroot,C:/qnx700/target/qnx7 -lang-c++ -DCMAKE_BUILD -DMANUFACTURINGCALIBRATIONPLUGIN_LIBRARY -DManufacturingCalibration_EXPORTS -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NOSTANDARDSHELL_UI_MODEL -DQT_NO_ACCESSIBILITY -DQT_NO_CLIPBOARD -DQT_NO_DEBUG -DQT_NO_NATIVE_GESTURES -DQT_NO_WINCE_NUIOUSER -DQT_NO_WINCE_SHELLSDK -DQT_QML_LIB -DUNICODE -D_UNICODE -IC:/Projects/build-AEPP-Qt5_6_3_QNX_Arm-Release/eSW/Qt/AEPPApps/ManufacturingCalibration/ManufacturingCalibration_autogen/include -IC:/qnx700/target/qnx7/usr/include/io -IC:/qnx700/target/qnx7/usr/include/c++/v1 -IC:/Projects/AEPP/./BSPs/QNX7/BSP/src/hardware/startup/lib/public/arm -IC:/Qt/5.6.3/qnx7_armv7/include/QtQml/5.6.3 -IC:/Qt/5.6.3/qnx7_armv7/include/QtQml/5.6.3/QtQml -IC:/Qt/5.6.3/qnx7_armv7/include/QtCore/5.6.3 -IC:/Qt/5.6.3/qnx7_armv7/include/QtCore/5.6.3/QtCore -IC:/Projects/AEPP/eSW/Qt/AEPPApps/ManufacturingCalibration/. -IC:/Projects/AEPP/eSW/Qt/CPPLibs/BQIF/. -IC:/Projects/AEPP/eSW/Qt/CPPLibs/Preferences/. -IC:/Projects/AEPP/CoreCode/System/Common/BradyUtils/. -IC:/Projects/AEPP/eSW/Qt/CPPLibs/AppData/. -IC:/Projects/AEPP/CoreCode/PropertyInterCommunicationLibrary/. -IC:/Projects/AEPP/CoreCode/System/Common/. -IC:/Projects/AEPP/CoreCode/System/Properties/. -IC:/Projects/AEPP/CoreCode/System/Networking/PICL -IC:/Projects/AEPP/CoreCode/System/OS/. -IC:/Projects/AEPP/CoreCode/System/OS/POSIX/. -IC:/Projects/AEPP/CoreCode/System/OS/QNX7/. -IC:/Projects/AEPP/CoreCode/System/SoC/Am335x/Qnx/. -IC:/Projects/AEPP/CoreCode/System/SoC/Am335x/. -IC:/Projects/AEPP/CoreCode/System/SoC/. -IC:/Projects/AEPP/CoreCode/System/SoC/Am335x -IC:/Projects/AEPP/CoreCode/System/Peripherals/. -IC:/Projects/AEPP/CoreCode/System/Upgrade/. -IC:/Projects/AEPP/CoreCode/System/ImageUtils/. -IC:/Projects/AEPP/CoreCode/System/ThirdParty/. -IC:/Projects/AEPP/Projects/rapidjson/include/rapidjson/. -IC:/Projects/AEPP/eSW/Qt/CPPLibs/PrinterIF/. -Wp,-isystem,C:/Qt/5.6.3/qnx7_armv7/include -Wp,-isystem,C:/Qt/5.6.3/qnx7_armv7/include/QtCore -Wp,-isystem,C:/Qt/5.6.3/qnx7_armv7/./mkspecs/qnx-armle-v7-qcc -Wp,-isystem,C:/Qt/5.6.3/qnx7_armv7/include/QtQml -Wp,-isystem,C:/Qt/5.6.3/qnx7_armv7/include/QtNetwork -O3 -DNDEBUG -O3 -DNDEBUG -fPIC -fno-operator-names -Wall -Werror -Wno-error=format= -Wno-error=sequence-point -Wno-error=unknown-pragmas -fPIC -std=gnu++14 -Wp,-MD,eSW\Qt\AEPPApps\ManufacturingCalibration\CMakeFiles\ManufacturingCalibration.dir\.._.._.._.._.._build-AEPP-Qt5_6_3_QNX_Arm-Release_eSW_Qt_AEPPApps_ManufacturingCalibration_ManufacturingCalibrationButton_qml.cpp.o.d -Wp,-MT,eSW/Qt/AEPPApps/ManufacturingCalibration/CMakeFiles/ManufacturingCalibration.dir/.._.._.._.._.._build-AEPP-Qt5_6_3_QNX_Arm-Release_eSW_Qt_AEPPApps_ManufacturingCalibration_ManufacturingCalibrationButton_qml.cpp.o -Wp,-MF,eSW\Qt\AEPPApps\ManufacturingCalibration\CMakeFiles\ManufacturingCalibration.dir\.._.._.._.._.._build-AEPP-Qt5_6_3_QNX_Arm-Release_eSW_Qt_AEPPApps_ManufacturingCalibration_ManufacturingCalibrationButton_qml.cpp.o.d -o eSW/Qt/AEPPApps/ManufacturingCalibration/CMakeFiles/ManufacturingCalibration.dir/.._.._.._.._.._build-AEPP-Qt5_6_3_QNX_Arm-Release_eSW_Qt_AEPPApps_ManufacturingCalibration_ManufacturingCalibrationButton_qml.cpp.o -c C:/Projects/build-AEPP-Qt5_6_3_QNX_Arm-Release/eSW/Qt/AEPPApps/ManufacturingCalibration/.._.._.._.._.._build-AEPP-Qt5_6_3_QNX_Arm-Release_eSW_Qt_AEPPApps_ManufacturingCalibration_ManufacturingCalibrationButton_qml.cpp
C:/Projects/build-AEPP-Qt5_6_3_QNX_Arm-Release/eSW/Qt/AEPPApps/ManufacturingCalibration/.._.._.._.._.._build-AEPP-Qt5_6_3_QNX_Arm-Release_eSW_Qt_AEPPApps_ManufacturingCalibration_ManufacturingCalibrationButton_qml.cpp:412:1: fatal error: opening dependency file eSW\Qt\AEPPApps\ManufacturingCalibration\CMakeFiles\ManufacturingCalibration.dir\.._.._.._.._.._build-AEPP-Qt5_6_3_QNX_Arm-Release_eSW_Qt_AEPPApps_ManufacturingCalibration_ManufacturingCalibrationButton_qml.cpp.o.d: No such file or directory
 } // namespace QtQuickCompilerGeneratedModule
 ^

```

I read about CMAKE\_OBJECT\_PATH\_MAX but it seems like in addition to object files that dependency files would have the same issue. Is that what I’m seeing here? I increased the CMAKE\_OBJECT\_PATH\_MAX and also enabled Windows long paths but that didn’t seem to have any effect on .d files. Can anyone confirm this?

The extra long path arises because of a workaround I implemented that auto-generates a qrc file in the binary folder. This is done to satisfy the Qt5 build and its use of qtquick\_compiler\_add\_resources. The same code also is fed to a Qt6 build which uses qml\_add\_module that does _not_ use a qrc file for the same list of QML and image files.

---

<div class="post-metadata">

### Author: ![Rich\_von\_Lehe](https://discourse.cmake.org/user_avatar/discourse.cmake.org/rich_von_lehe/32/307_2.png) [@Rich\_von\_Lehe](https://discourse.cmake.org/u/Rich_von_Lehe)
#### Post date: [March 29, 2022, 8:48pm UTC](https://discourse.cmake.org/t/cmake-object-path-max-does-it-also-apply-to-dependency-files-d/5319/2 "2022-03-29T20:48:27Z")

</div>

FWIW I seem to have worked around this by being slightly smarter about avoiding long paths that create long mangled filenames.

---

<div class="post-metadata">

### Author: ![Pahlden](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@Pahlden](https://discourse.cmake.org/u/Pahlden)
#### Post date: [March 22, 2023, 6:35am UTC](https://discourse.cmake.org/t/cmake-object-path-max-does-it-also-apply-to-dependency-files-d/5319/3 "2023-03-22T06:35:31Z")

</div>

I’m running in the same error with dependency files which seem to be too long for CMAKE:  
L:\bin\_target\dm\DEBUG\fs\_a\_cyclonvsoc\_gcc\_g1\_cpu2\x\_service\_server\_ServiceRplOnlineChange.pro\CMakeFiles\x\_service\_server\_ServiceRplOnlineChange.pro.dir\aa5c030395ffb07dc8b198181308a9b1\SvcRplOnlineChangeReq\_eGetActivePouTypeChangeListReq\_SkelDesFac\_.cpp.obj.d

I also increased the variable “CMAKE\_OBJECT\_PATH\_MAX” and enabled Windows long paths.  
Unfortunately, I have no simple way to reduce the directory structure created by CMAKE. Is there any way of solving that problem?
