[CMake] how to get install/strip target ?

Martin Koller martin.koller at etm.at
Fri Mar 15 10:33:09 EDT 2013


On Friday 15 March 2013 15:25:13 Eric Noulard wrote:
> 2013/3/15 Martin Koller <martin.koller at etm.at>:
> > On Wednesday 13 March 2013 22:43:01 Alexander Neundorf wrote:
> >> On Wednesday 13 March 2013, Martin Koller wrote:
> >> > cmake 2.8.10, Linux:
> >> >
> >> > What do I need to do to have cmake creating a make install/strip target ?
> >>
> >> I guess you do have an install target ?
> >> AFAIK install/strip should be always there automatically.
> >> It works for me here.
> >>
> >> Can you post an example project where you don't get the install/strip target ?
> >
> > ok, today I had the problem again and I can reproduce it.
> > cmake version 2.8.10.2, openSuse 12.2
> >
> > x.c:
> > main(){}
> >
> > CMakeLists.txt:
> > project(test)
> > add_executable(x x.c)
> >
> > mkdir build
> > cd build
> > cmake ..
> >
> >
> > The Makefile does not have a install/strip target
> 
> And no "install" target either.
> 
> This is the expected behavior, as Alex told you,
> you need to have at least one "install" command in order to get
> install  or install/strip target.
> 
> 
> in the previous example you need something like:
> 
> install(TARGETS x DESTINATION bin)

ok, sorry. Yes, this was stupid.
In fact I have the problem with my real project, which has of course the install rules
in the cmake files.

I now found a way to reproduce the problem.
Use the example from above and include the install() rule.

Then do:

cd build
cmake ..
=> install/strip targets are there
rm CMakeCache.txt
cmake ..
=> NO install/strip targets,  but only the other install targets

-- 
Best regards/Schöne Grüße

Martin

A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?

()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments

This mail was not scanned before sending.
It was sent from a secure Linux desktop.


More information about the CMake mailing list