[CMake] Fwd: cmake_policy(VERSION 2.4) = no exe's generated

Frank Bonniwell valefar4 at gmail.com
Sat Jan 30 19:39:47 EST 2010


Hello Eric,


Thank you so much for the tip. I was able to successfully compile.
The cmake_minimum_required(VERSION 2.6.0) is what fixed it!

Also thank you for the "make VERBOSE =1" tip.
This was also very helpful.


If you are beginning to use CMake why do you have such an older policy
as of CMake 2.4?

The code was originally developed with CMake 2.4. It just required some
library and CMakeList.txt updates.


Cheers,

Frank


On Sat, Jan 30, 2010 at 3:44 AM, Eric Noulard <eric.noulard at gmail.com>wrote:

> 2010/1/29 Frank Bonniwell <valefar4 at gmail.com>:
> > Hello All,
> >
> > I'm a student new to cmake and I ran into a stump with compiling some
> code.
> >
> > When I apply the cmake_policy as instructed in a previous compiling
> error,
> > no executables are generated even when the output says otherwise.
>
> Did you try
>
> make VERBOSE=1
>
> > -- Generating done
> > -- Build files have been written to: /home/mdtom/mpp/
> > build
> >
> > Line from CMakeList.txt
> >
> > # avoid warning with CMake 2.6
> > cmake_policy(VERSION 2.4)
> > add_executable(test
> >   main.cc
> >   testwin.cc
> >   testwin.h
> >   cairovol.cc
> >   cairovol.h
> >   )
> >
> >
> > When I also try to apply CMP0003 before the add_executable, no
> executables
> > are generated.
> >
> >     if(COMMAND cmake_policy)
> >       cmake_policy(SET CMP0003 NEW)
> >     endif(COMMAND cmake_policy)
> >
> >
> > Is there a better approach to using the cmake_policy I may have
> overlooked?
>
> If you are beginning to use CMake why do you have such an older policy
> as of CMake 2.4?
>
> I would at least recommend:
> cmake_minimum_required(VERSION 2.6.0)
> then keep reading...
>
> >  This warning appears
> >   because target "test" links to some libraries for which the linker must
> >   search:
> >
> >     gtkmm-2.4, giomm-2.4, gdkmm-2.4, atkmm-1.6, gtk-x11-2.0, pangomm-1.4
> >     cairomm-1.0, glibmm-2.4, sigc-2.0, gdk-x11-2.0, atk-1.0, pangoft2-1.0
> >     gdk_pixbuf-2.0, m, pangocairo-1.0, gio-2.0, cairo, pango-1.0,
> freetype
> [...]
>
> Your CMakeLists.txt excerpt is too small
> it did not show us
> the find_package
> and target_link_libraries part which may help us to help you.
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100130/003b6b10/attachment.htm>


More information about the CMake mailing list