[CMake] FindQt4.cmake broken without C language

Hendrik Sattler post at hendrik-sattler.de
Thu May 10 18:07:38 EDT 2007


Am Donnerstag 10 Mai 2007 19:39 schrieb Alan W. Irwin:
> On 2007-05-10 19:06+0200 Hendrik Sattler wrote:
> > the following case does not work:
> > $ cat CMakeLists.txt
> > project(foo CXX)
>
> This has just been covered in another thread.  That particular project
> command gives you just C++ support.  As documented for "project", drop the
> CXX to get both C and CXX (by default) or specify both C and CXX.

But Qt4 is only about C++.

> > find_package(Qt4)
> > $ cmake .
> > -- Check for working CXX compiler: /usr/bin/c++
> > -- Check for working CXX compiler: /usr/bin/c++ -- works
> > -- Looking for Q_WS_X11
> > CMake Error: Unknown extension ".c" for
>
>                                   ^^^^
> This error is caused by lack of C support.

Yes. It is obviously that way. But it is kind of non-sense to require a C 
compiler for a library like Qt4.
Either that or it's non-sense to be able to specify that only C++ will be 
needed, which means to always pull in C in that case:
  CXX -> search for C _and_ C++ compiler
  C   -> search for C compiler, only

Another possibility: Modules that _require_ a C compiler should enable that 
language themselves.

HS


More information about the CMake mailing list