Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 17th, 2007, 3:10 AM   #1
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
GNU Makefile or SCons???

whats your pros/cons?
rwm is offline   Reply With Quote
Old Aug 17th, 2007, 8:22 AM   #2
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 644
Rep Power: 4 Jessehk is on a distinguished road
I don't know SCons, But I've used Makefiles. What I think is neat is CMake, which I tried when I heard KDE 4 switched to it. It's basically a replacement for autotools, but cross-platform. It can generate project files for Visual Studio, KDevelop, or generate Makefiles for Unix-like systems including Linux.
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Old Aug 17th, 2007, 9:26 AM   #3
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 644
Rep Power: 4 Jessehk is on a distinguished road
Sorry, I realized I wanted to add to that, but the edit time ran out.

Here's the CMakeLists.txt file from that small tic-tac-toe game I wrote. It properly calls all the Qt tools to handle built-in resources and automatic file generation (for things like signals and slots) through included macros for Qt.

project (qtictac)

find_package (Boost REQUIRED)

find_package (Qt4 REQUIRED)
include (${QT_USE_FILE})

set (qtictac_SRCS
    board.cpp
    main.cpp
    node.cpp
    spot.cpp
    tree.cpp
    uiBoard.cpp
    uiMain.cpp
    uiResultsDialog.cpp
    uiSettings.cpp
    uiSpot.cpp
)

set (qtictac_MOC_HDRS
    uiBoard.hpp
    uiMain.hpp
    uiResultsDialog.hpp
    uiSettings.hpp
    uiSpot.hpp
)

set (qtictac_RCS
    ../qtictac.qrc
)

include_directories (${Boost_INCLUDE_DIRS})
link_directories (${Boost_LIBRARY_DIRS})

qt4_add_resources (qtictac_RC_SRCS ${qtictac_RCS})
qt4_wrap_cpp (qtictac_MOC_SRCS ${qtictac_MOC_HDRS})

add_executable (qtictac ${qtictac_SRCS} ${qtictac_MOC_SRCS} ${qtictac_RC_SRCS})
target_link_libraries (qtictac ${QT_LIBRARIES})

And the output when I build it on Linux:
$ cmake ../src
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Check size of void*
-- Check size of void* - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Found Qt-Version 4.3.1
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jesse/programs/cpp/qtictac/build
$ make
[  4%] Generating qrc_qtictac.cxx
[  9%] Generating moc_uiBoard.cxx
[ 13%] Generating moc_uiMain.cxx
[ 18%] Generating moc_uiResultsDialog.cxx
[ 22%] Generating moc_uiSettings.cxx
[ 27%] Generating moc_uiSpot.cxx
Scanning dependencies of target qtictac
[ 31%] Building CXX object CMakeFiles/qtictac.dir/board.o
[ 36%] Building CXX object CMakeFiles/qtictac.dir/main.o
[ 40%] Building CXX object CMakeFiles/qtictac.dir/node.o
[ 45%] Building CXX object CMakeFiles/qtictac.dir/spot.o
[ 50%] Building CXX object CMakeFiles/qtictac.dir/tree.o
[ 54%] Building CXX object CMakeFiles/qtictac.dir/uiBoard.o
[ 59%] Building CXX object CMakeFiles/qtictac.dir/uiMain.o
[ 63%] Building CXX object CMakeFiles/qtictac.dir/uiResultsDialog.o
[ 68%] Building CXX object CMakeFiles/qtictac.dir/uiSettings.o
[ 72%] Building CXX object CMakeFiles/qtictac.dir/uiSpot.o
[ 77%] Building CXX object CMakeFiles/qtictac.dir/moc_uiBoard.o
[ 81%] Building CXX object CMakeFiles/qtictac.dir/moc_uiMain.o
[ 86%] Building CXX object CMakeFiles/qtictac.dir/moc_uiResultsDialog.o
[ 90%] Building CXX object CMakeFiles/qtictac.dir/moc_uiSettings.o
[ 95%] Building CXX object CMakeFiles/qtictac.dir/moc_uiSpot.o
[100%] Building CXX object CMakeFiles/qtictac.dir/qrc_qtictac.o
Linking CXX executable qtictac
[100%] Built target qtictac

I've heard SCons is good too though, so I wouldn't necessarily listen to me.
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Old Aug 17th, 2007, 10:01 AM   #4
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
hey thanks man! that looks interesting!

ill check it out

rwm is offline   Reply With Quote
Old Aug 17th, 2007, 2:28 PM   #5
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
I use both SCons and CMake on reasonably large projects so I have a little bit of perspective on both. SCons is great to use and the flexibility and ease of use that Python gives you are great. The downside is you have to setup the IDE projects by hand to call SCons and you have add all the files to the IDE. It also doesn't have any built in system for build profiles (ie "debug" and "release"). SCons is also extremely accurate it will never fail to build you source file if a dependency changes (includes headers that you reference through dependent libraries).

CMake does more out of the box then SCons and its configuration steps are faster. The downside is that the CMake language will get in your way anytime you wish to write anything complex in it. This shouldn't be an issue for a simple project though. The accuracy of CMake is wholly dependent on the generator being used. They appear to do a good job with Makefile generator, but there XCode is not very good at cross directory dependencies.
__________________
Robotics @ Maryland AUV Team - Software Lead

Last edited by Game_Ender; Aug 17th, 2007 at 2:39 PM.
Game_Ender is offline   Reply With Quote
Old Aug 17th, 2007, 3:09 PM   #6
Eoin
Hobbyist Programmer
 
Eoin's Avatar
 
Join Date: Jun 2006
Location: Ireland
Posts: 152
Rep Power: 3 Eoin is on a distinguished road
I don't have experience of either SCons or CMake so I can't offer any comparisons, but I myself tend to use Boost.Build v2 and find it very powerful.
__________________
Visit my website BinaryNotions.
Eoin is offline   Reply With Quote
Old Aug 18th, 2007, 2:31 AM   #7
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
The features that Boost.Build v2 has going for it is the:
* "feature normalization" - which I assume means I can stuff like "I want warnings" and it will do the right thing regardless of platform or compiler
* built in variant build support (CMake has this to) - ie. release, debug, etc.
* support for lots of compilers

To bad it doesn't generate native build files.
__________________
Robotics @ Maryland AUV Team - Software Lead
Game_Ender is offline   Reply With Quote
Old Aug 20th, 2007, 2:51 AM   #8
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
cool! im looking at that now! looks interesting! thanks guys!
rwm is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you create a project from a makefile? Duck C++ 5 Aug 24th, 2006 6:34 AM
Simple makefile elliot C++ 6 Mar 14th, 2006 10:26 PM
Makefile and java MegaArcon Java 6 Nov 7th, 2005 1:03 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:50 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC