[CMake] Bugs in cmake-2.4.6, please solve for 2.4.7

Hendrik Sattler post at hendrik-sattler.de
Mon Jul 16 16:11:23 EDT 2007


Am Montag 16 Juli 2007 20:13 schrieb Alexander Neundorf:
> On Wednesday 11 July 2007 14:17, Hendrik Sattler wrote:
> > Am Mittwoch 11 Juli 2007 16:24 schrieb Alexander Neundorf:
> > > I can't reproduce a problem. Please try the attached testcase and tell
> > > me how to reproduce your problem.
> >
> > I extended you example to trigger the problem. See the attached archive.
> > I mainly adds a static library that main2 gets linked to. This lib is
> > also excluded from all (only works with 2.6.7)
>
> Somehow I fail to find the difference between 2.4.6 and 2.4.7 RC11.
>
> If you remove the EXCLUDE_FROM_ALL from the ADD_LIBRARY() command, make and
> make install work in both cases (but the EXCLUDE_FROM_ALL target will still
> be built on make install, which shouldn't happen, but it doesn't seem to
> break anything here).
>
> If I use only EXCLUDE_FROM_ALL, then make; make install fails both with
> 2.4.6 and 2.4.7RC11.
>
> How can I reproduce the problem ?

hendrik at yavin:~/efa$ mkdir build
hendrik at yavin:~/efa$ cd build
hendrik at yavin:~/efa/build$ cmake ..
-- Check for working C compiler: /home/hendrik/bin/gcc
-- Check for working C compiler: /home/hendrik/bin/gcc -- works
-- Check size of void*
-- Check size of void* - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hendrik/efa/build
hendrik at yavin:~/efa/build$ make
Scanning dependencies of target hello1
[100%] Building C object CMakeFiles/hello1.dir/main1.o
Linking C executable hello1
[100%] Built target hello1
hendrik at yavin:~/efa/build$ make install DESTDIR=$(pwd)/local
[100%] Built target hello1
Building C object CMakeFiles/hello2.dir/main2.o
make[2]: *** Keine Regel vorhanden, um das Target »libfoo.a«,
  benötigt von »CMakeFiles/CMakeRelink.dir/hello2«, zu erstellen.  Schluss.
make[1]: *** [CMakeFiles/hello2.dir/preinstall] Fehler 2
make: *** [preinstall] Fehler 2
hendrik at yavin:~/efa/build$ make hello2
Scanning dependencies of target foo
[ 50%] Building C object CMakeFiles/foo.dir/foo.o
Linking C static library libfoo.a
[ 50%] Built target foo
Scanning dependencies of target hello2
[100%] Building C object CMakeFiles/hello2.dir/main2.o
Linking C executable hello2
[100%] Built target hello2
hendrik at yavin:~/efa/build$ make install DESTDIR=$(pwd)/local
[100%] Built target hello1
Linking C executable CMakeFiles/CMakeRelink.dir/hello2
Install the project...
-- Install configuration: ""
-- Installing /home/hendrik/efa/build/local/usr/local/bin/hello1
-- Installing /home/hendrik/efa/build/local/usr/local/bin/hello2

Removing EXCLUDE_FROM_ALL from the lib target fixes the first "make install" 
but always build that lib but that's not wanted.

The work-around is surely possible but in my project, there are 5 applications 
and I really like the possibility to build any of them with a simply make 
call.

HS


More information about the CMake mailing list