Hello All,<br><br>I'm a student new to cmake and I ran into a stump with compiling some code. <br><br>When I apply the cmake_policy as instructed in a previous compiling error, no executables are generated even when the output says otherwise. <br>
<br><br>-- Generating done<br>-- Build files have been written to: /home/mdtom/mpp/<div id=":en" class="ii gt">build<br><br><br><br>Line from CMakeList.txt<br></div><br># avoid warning with CMake 2.6 <br>cmake_policy(VERSION 2.4)<br>
add_executable(test<br> main.cc<br> testwin.cc<br> testwin.h<br> cairovol.cc<br> cairovol.h<br> )<br><br><br>When I also try to apply CMP0003 before the add_executable, no executables are generated. <br><br> if(COMMAND cmake_policy)<br>
cmake_policy(SET CMP0003 NEW)<br> endif(COMMAND cmake_policy)<br><br><br>Is there a better approach to using the cmake_policy I may have overlooked?<br><br>Thanks,<br><br>-F<br><br><br><br>Output from shell:<br><br>
<br>mdtom@ubuntu:~/<div id=":en" class="ii gt">mpp/build$ cmake ..<br>-- The C compiler identification is GNU<br>-- The CXX compiler identification is GNU<br>-- Check for working C compiler: /usr/bin/gcc<br>
-- Check for working C compiler: /usr/bin/gcc -- works<br>-- Detecting C compiler ABI info<br>-- Detecting C compiler ABI info - done<br>-- Check for working CXX compiler: /usr/bin/c++<br>-- Check for working CXX compiler: /usr/bin/c++ -- works<br>
-- Detecting CXX compiler ABI info<br>-- Detecting CXX compiler ABI info - done<br>-- checking for module 'ImageMagick++'<br>-- found ImageMagick++, version 6.4.5<br>-- checking for module 'gtkmm-2.4>=2.10'<br>
-- found gtkmm-2.4, version 2.16.0<br>-- checking for module 'cairomm-1.0'<br>-- found cairomm-1.0, version 1.6.4<br>-- checking for module 'gthread-2.0'<br>-- found gthread-2.0, version 2.20.1<br>-- Configuring done<br>
CMake Warning (dev) at gui/CMakeLists.txt:12 (add_executable):<br> Policy CMP0003 should be set before this line. Add code such as<br><br> if(COMMAND cmake_policy)<br> cmake_policy(SET CMP0003 NEW)<br> endif(COMMAND cmake_policy)<br>
<br> as early as possible but after the most recent call to<br> cmake_minimum_required or cmake_policy(VERSION). This warning appears<br> because target "test" links to some libraries for which the linker must<br>
search:<br><br> gtkmm-2.4, giomm-2.4, gdkmm-2.4, atkmm-1.6, gtk-x11-2.0, pangomm-1.4<br> cairomm-1.0, glibmm-2.4, sigc-2.0, gdk-x11-2.0, atk-1.0, pangoft2-1.0<br> gdk_pixbuf-2.0, m, pangocairo-1.0, gio-2.0, cairo, pango-1.0, freetype<br>
fontconfig, gobject-2.0, gmodule-2.0, glib-2.0, cairomm-1.0, cairo<br> Magick++, MagickCore, gthread-2.0, rt, glib-2.0, cairomm-1.0, glibmm-2.4<br> sigc-2.0, gdk-x11-2.0, atk-1.0, pangoft2-1.0, gdk_pixbuf-2.0, m<br>
pangocairo-1.0, gio-2.0, cairo, pango-1.0, freetype, fontconfig<br> gobject-2.0, gmodule-2.0, Magick++, MagickCore, gthread-2.0, rt<br><br> and other libraries with known full path:<br><br> mdtom/mpp/build/core/libcore.a<br>
mdtom/mpp/build/ext/newmat/libnewmat.a<br><br> CMake is adding directories in the second list to the linker search path in<br> case they are needed to find libraries from the first list (for backwards<br>
compatibility with CMake 2.4). Set policy CMP0003 to OLD or NEW to enable<br> or disable this behavior explicitly. Run "cmake --help-policy CMP0003" for<br> more information.<br>This warning is for project developers. Use -Wno-dev to suppress it.<br>
<br>-- Generating done<br>-- Build files have been written to: /home/mdtom/mpp/build<br>mdtom@ubuntu:~/mpp/build$ </div>