Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CMake Error not found QT_QT_INCLUDE_DIR when specify both --with-qt4 and --with-qt5. #62

Closed
wants to merge 1 commit into from

Conversation

dai-vdr
Copy link
Contributor

@dai-vdr dai-vdr commented Jul 21, 2015

if specify both --with-qt4 and --with-qt5 at configure,
it causes CMake Error not found QT_QT_INCLUDE_DIR.
there is no side effect outside of Qt5 branch.

@kou
Copy link
Member

kou commented Jul 22, 2015

Thanks for your report bug I couldn't reproduce the problem on my Debian GNU/Linux sid. Here are command lines I used:

% git clone --recursive git@github.com:uim/uim.git
% cd uim
% ./autogen.sh
% cd sigscheme
% ./autogen.sh
% cd libgcroots
% ./autogen.sh
% cd ../..
% ./configure QMAKE5=/usr/lib/x86_64-linux-gnu/qt5/bin/qmake --enable-maintainer-mode --with-qt4 --with-qt5
% make
% echo $?
0

(Required packages are installed by apt.)

@dai-vdr
Copy link
Contributor Author

dai-vdr commented Jul 22, 2015

hmmm, i could not reproduced your process.
i tested it in chroot'ed (pbuilder) environment on Debian GNU/Linux sid.

@dai-vdr
Copy link
Contributor Author

dai-vdr commented Jul 22, 2015

here is configure's error log, but configure itself exits with status code 0.

(snip)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
QT_QT_INCLUDE_DIR
   used as include directory in directory /tmp/uim/qt4/toolbar/build/CMakeFiles/CMakeTmp

CMake Error: Internal CMake error, TryCompile configure of cmake failed

CMake Error at /usr/share/kde4/apps/cmake/modules/FindKDE4Internal.cmake:1316 (message):
  Unable to compile a basic Qt application.  Qt has not been found correctly.
Call Stack (most recent call first):
  /usr/share/cmake-3.2/Modules/FindKDE4.cmake:108 (find_package)
  CMakeLists.txt:3 (find_package)


-- Configuring incomplete, errors occurred!
See also "/tmp/uim/qt4/toolbar/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/uim/qt4/toolbar/build/CMakeFiles/CMakeError.log".
(snip)

here is make's error log after above configured. it exits with status code 1.

make[3]: Leaving directory '/tmp/uim/qt4/toolbar'
( cd build; make  all )
make[3]: Entering directory '/tmp/uim/qt4/toolbar/build'
make[3]: *** No rule to make target 'all'.  中止.
make[3]: Leaving directory '/tmp/uim/qt4/toolbar/build'
Makefile:625: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/tmp/uim/qt4/toolbar'
Makefile:525: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/uim/qt4'
Makefile:652: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

cmake with qt4/toolbar/CMakeLists.txt spits above configure's error log.
cmake with my patched qt4/toolbar/CMakeLists.txt, all errors disapper.
but i do not know why you can not reproduce.

@dai-vdr
Copy link
Contributor Author

dai-vdr commented Jul 23, 2015

i made reproducible Dockefile.

Dockerfile:

FROM debian:sid

ENV LANG=ja_JP.UTF-8 LC_ALL=ja_JP.UTF-8

ADD sources.list /etc/apt/sources.list
ADD locale.gen /etc/locale.gen

RUN apt-get update
RUN apt-get build-dep -y uim
RUN apt-get install -y \
    git \
    build-essential \
    devscripts \
    fakeroot \
    automake1.11 \
    qtbase5-dev \
    qtbase5-private-dev \
    qt5-default \
    dh-autoreconf \
    locales \
    ruby

RUN git clone --recursive https://github.com/uim/uim.git

RUN cd uim/sigscheme/libgcroots && ./autogen.sh
RUN cd uim/sigscheme && ./autogen.sh
RUN cd uim && ./autogen.sh

CMD cd uim && ./configure QMAKE5=/usr/lib/x86_64-linux-gnu/qt5/bin/qmake \
    --enable-maintainer-mode --with-qt4 --with-qt5 && make

sources.list:

deb http://ftp.jp.debian.org/debian unstable main
deb-src http://ftp.jp.debian.org/debian unstable main

locale.gen:

ja_JP.UTF-8 UTF-8

put above 3 files into some one directory, run below commands (wait a sec) and reproduce this issue.

$ docker build -t debian/uim-pull62 .
$ docker run debian/uim-pull62

@kou
Copy link
Member

kou commented Jul 25, 2015

Thanks.
It seems that --with-qt5 isn't required to reproduce this problem. kdelibs5-dev is required to reproduce this problem.

find_package(Qt4) exists at /usr/share/kde4/apps/cmake/modules/FindKDE4Internal.cmake:425. Do you know why we need to add find_package(Qt4) in our CMakeLists.txt?

@kou
Copy link
Member

kou commented Jul 25, 2015

It seems that both cmake-data and kdelibs5-dev have FindQt4.cmake.
find_package(Qt4) in our CMakeLists.txt uses FindQt4.cmake in cmake-data.
find_package(Qt4) in FindKDE4Internal.cmake uses FindQt4.cmake in kdelibs5-dev.

I think that FindKDE4Internal.cmake should work with only FindQt4.cmake in kdelibs5-dev. (without FindQt4.cmake in cmake-data) Am I wrong?

@dai-vdr
Copy link
Contributor Author

dai-vdr commented Jul 25, 2015

thank you for your investigation.
i am not familiar with cmake and i have found adding find_package(Qt4) into CMakeLists.txt by try-and-error.

for testing, i removed FindQt4.cmake file of kdelibs5-dev temporarily, removed my adding find_package(Qt4) from CMakeLists.txt and built uim successfully.
should i report this issue to kdelibs5-dev not here?

@kou
Copy link
Member

kou commented Jul 25, 2015

should i report this issue to kdelibs5-dev not here?

Yes please. kdelibs5-dev maintainer will have more knowledge about this rather than us.

@dai-vdr
Copy link
Contributor Author

dai-vdr commented Jul 25, 2015

i reported this issue Debian BTS ( https://bugs.debian.org/793603 ), thank you!

@kou
Copy link
Member

kou commented Jul 25, 2015

Thanks!

@dai-vdr
Copy link
Contributor Author

dai-vdr commented Nov 10, 2017

Qt4 removal upcoming, so closing it.

@dai-vdr dai-vdr closed this Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants