laserpants / qt-material-widgets

:art: Qt widgets-based implementation of the Material Design specification.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About the build process

fperillo opened this issue · comments

The build process using command line on windows fails to build examples. I see 3 errors:

  1. when I ask to use more than 1 core with -j 8, the examples are built immediately, and of course they fail since the library is not built yet. This is probably a side-effect of 3.

  2. the c++11 config added in your last is not "expanded" to examples\makefile.release. You can remove from qt-material-widgets.pro and add in examples.pro. Now -std=c++0x is added and compilation is ok. I don't know why it "downgrades" to c++0x but qmake knows better than me...

  3. The dependency of the lib is not satisfied.

win-make[2]: Entering directory 'C:/cvs/qt-material-widgets/components'
win-make[2]: Nothing to be done for 'first'.
win-make[2]: Leaving directory 'C:/cvs/qt-material-widgets/components'
win-make[1]: Leaving directory 'C:/cvs/qt-material-widgets/components'
cd examples\ && ( if not exist Makefile C:\qt\qt5.5.0\5.5\mingw492_32\bin\qmake.exe C:\cvs\qt-material-widgets\examples\
examples.pro -o Makefile ) && C:/cvs/harbour/win-make -f Makefile
win-make[1]: Entering directory 'C:/cvs/qt-material-widgets/examples'
C:/cvs/harbour/win-make -f Makefile.Release
win-make[2]: Entering directory 'C:/cvs/qt-material-widgets/examples'
win-make[2]: *** No rule to make target '../components/libcomponents.a', needed by 'examples-exe.exe'.  Stop.
win-make[2]: Leaving directory 'C:/cvs/qt-material-widgets/examples'
Makefile:34: recipe for target 'release' failed
win-make[1]: *** [release] Error 2
win-make[1]: Leaving directory 'C:/cvs/qt-material-widgets/examples'
makefile:64: recipe for target 'sub-examples-make_first' failed
win-make: *** [sub-examples-make_first] Error 2

I had to add the directory to examples.pro:

diff --git a/examples/examples.pro b/examples/examples.pro
index b53fb99..a29c562 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -1,4 +1,5 @@
 QT += core gui widgets
+CONFIG += c++11
 TEMPLATE = app
 SOURCES = mainwindow.cpp \
     main.cpp \
@@ -39,10 +40,10 @@ HEADERS = mainwindow.h \
     dialogsettingseditor.h \
     drawersettingseditor.h \
     scrollbarsettingseditor.h
-LIBS += ../components/libcomponents.a
+LIBS += ../components/release/libcomponents.a
 INCLUDEPATH += ../components/
 TARGET = ../examples-exe
-PRE_TARGETDEPS += ../components/libcomponents.a
+PRE_TARGETDEPS += ../components/release/libcomponents.a

 RESOURCES += \
     examples.qrc

I created a pull request for point 2 but not for point 3 since it seems that compilation is working for you.

I then deleted my form and created a new one since I messed it up too much and was not able to reset it... easier to delete and fork again.

The directory structure is probably different on Windows. I am using Ubuntu. There must be a standard, cross-platform way to do it though. I will search around for it later.

I made this change and added this file. Could you try and see if it works in your build env. also.

created a PR... as I said I'm a novice git user and it takes me a lot of time just to create a simple PR....

Ok. Thanks, and sorry about that. One thing though; could the TARGET be set to

TARGET = $$top_builddir/examples/examples-exe

That relative path is problematic here. Don't worry about making the changes in git. I just want to make sure it doesn't mess up your setup before I push it to master.

no, it can't be used this way on windows, unfortunately.

If you can't use relative paths (why?) just keep examples-exe

C:\qt\qt5.5.0\5.5\mingw492_32\bin\qmake.exe -o Makefile examples.pro
WARNING: DESTDIR: Cannot access directory 'release\C:\cvs\qt-material-widgets-fperillo\examples'
WARNING: DESTDIR: Cannot access directory 'debug\C:\cvs\qt-material-widgets-fperillo\examples'

Ok, leaving it just as examples-exe works now. That seems much easier then. I don't know why, but for some reason it was giving me some permission errors before. So, TARGET = examples-exe is working for you then, or?

Please reopen if it is not working. I may have changed some other variables in the build file after this.

revise examples.pro to this:
`QT += core gui widgets
TEMPLATE = app
CONFIG += c++11
SOURCES = mainwindow.cpp
main.cpp
avatarsettingseditor.cpp
badgesettingseditor.cpp
checkboxsettingseditor.cpp
fabsettingseditor.cpp
raisedbuttonsettingseditor.cpp
flatbuttonsettingseditor.cpp
iconbuttonsettingseditor.cpp
progresssettingseditor.cpp
circularprogresssettingseditor.cpp
slidersettingseditor.cpp
radiobuttonsettingseditor.cpp
togglesettingseditor.cpp
textfieldsettingseditor.cpp
tabssettingseditor.cpp
snackbarsettingseditor.cpp
dialogsettingseditor.cpp
drawersettingseditor.cpp
scrollbarsettingseditor.cpp
appbarsettingseditor.cpp
autocompletesettingseditor.cpp
menusettingseditor.cpp
HEADERS = mainwindow.h
avatarsettingseditor.h
badgesettingseditor.h
checkboxsettingseditor.h
fabsettingseditor.h
raisedbuttonsettingseditor.h
flatbuttonsettingseditor.h
iconbuttonsettingseditor.h
progresssettingseditor.h
circularprogresssettingseditor.h
slidersettingseditor.h
radiobuttonsettingseditor.h
togglesettingseditor.h
textfieldsettingseditor.h
tabssettingseditor.h
snackbarsettingseditor.h
dialogsettingseditor.h
drawersettingseditor.h
scrollbarsettingseditor.h
appbarsettingseditor.h
autocompletesettingseditor.h
menusettingseditor.h

win32{
LIBS += $$top_builddir/components/$(OBJECTS_DIR)/components.lib
INCLUDEPATH += $$top_srcdir/components/
TARGET = examples-exe
PRE_TARGETDEPS += $$top_builddir/components/$(OBJECTS_DIR)/components.lib
}
else {
LIBS += $$top_builddir/components/$(OBJECTS_DIR)/libcomponents.a
INCLUDEPATH += $$top_srcdir/components/
TARGET = examples-exe
PRE_TARGETDEPS += $$top_builddir/components/$(OBJECTS_DIR)/libcomponents.a
}

RESOURCES +=
examples.qrc

FORMS +=
avatarsettingsform.ui
badgesettingsform.ui
checkboxsettingsform.ui
fabsettingsform.ui
flatbuttonsettingsform.ui
iconbuttonsettingsform.ui
progresssettingsform.ui
circularprogresssettingsform.ui
slidersettingsform.ui
snackbarsettingsform.ui
radiobuttonsettingsform.ui
togglesettingsform.ui
textfieldsettingsform.ui \
tabssettingsform.ui
dialogsettingsform.ui
drawersettingsform.ui
scrollbarsettingsform.ui
appbarsettingsform.ui
`