bitwiseworks / cmake-os2

Other
3 stars 1 forks source link

Problems with parenthesis in directory names #3

Open dmik opened 3 years ago

dmik commented 3 years ago

Therre is a cmake test in qtbase, see https://github.com/bitwiseworks/qtbase-os2/tree/master/tests/auto/cmake/test(needsquoting)dirname. This test case among other things generates the following in one of the make files (a snippet):

ui_mywidget.h: D:/Coding/qt5/qt5/qtbase/tests/auto/cmake/test(needsquoting)dirname/mywidget.ui
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir="D:/Coding/qt5/qt5-dev-build/qtbase/tests/auto/cmake/build/test(needsquoting)dirname/CMakeFiles" --progress-num=$(CMAKE_PROGRESS_1) "Generating ui_mywidget.h"
    D:/Coding/qt5/qt5-dev-build/qtbase/bin/uic.exe -o "D:/Coding/qt5/qt5-dev-build/qtbase/tests/auto/cmake/build/test(needsquoting)dirname/ui_mywidget.h" "D:/Coding/qt5/qt5/qtbase/tests/auto/cmake/test(needsquoting)dirname/mywidget.ui"

moc_mywidget.cpp: D:/Coding/qt5/qt5/qtbase/tests/auto/cmake/test(needsquoting)dirname/mywidget.h
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir="D:/Coding/qt5/qt5-dev-build/qtbase/tests/auto/cmake/build/test(needsquoting)dirname/CMakeFiles" --progress-num=$(CMAKE_PROGRESS_2) "Generating moc_mywidget.cpp"
    D:/Coding/qt5/qt5-dev-build/qtbase/bin/moc.exe "@D:/Coding/qt5/qt5-dev-build/qtbase/tests/auto/cmake/build/test(needsquoting)dirname/moc_mywidget.cpp_parameters"

CMakeFiles/mywidget.dir/mywidget.cpp.o: CMakeFiles/mywidget.dir/flags.make
CMakeFiles/mywidget.dir/mywidget.cpp.o: CMakeFiles/mywidget.dir/includes_CXX.rsp
CMakeFiles/mywidget.dir/mywidget.cpp.o: D:/Coding/qt5/qt5/qtbase/tests/auto/cmake/test(needsquoting)dirname/mywidget.cpp
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir="D:/Coding/qt5/qt5-dev-build/qtbase/tests/auto/cmake/build/test(needsquoting)dirname/CMakeFiles" --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/mywidget.dir/mywidget.cpp.o"
    C:/USR/BIN/g++.exe  $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/mywidget.dir/mywidget.cpp.o -c "D:/Coding/qt5/qt5/qtbase/tests/auto/cmake/test(needsquoting)dirname/mywidget.cpp"

an attempt to make this file with our kBuild make leads to this error:

make.exe: *** No rule to make target `needsquoting)dirname/mywidget.cpp)', needed by `CMakeFiles/mywidget.dir/mywidget.cpp.o'.  Stop.

The fun thing is that if I reorder some strings (in this particular case — move all the CMakeFiles/mywidget.dir/mywidget.cpp.o targets on top), the problem gets magically solved and the error goes away.

I have no idea what this error originates from but it might really be an issue of kBuild make. Might be extremely hard to find and fix, given make complexity, unless we are extremely lucky.

Found while working on https://github.com/bitwiseworks/qt5-os2/issues/16.

SilvanScherrer commented 1 year ago

could we test this eventually against latest kbuild?

dmik commented 1 year ago

Yes, we should. Next time we build qtbase perhaps.