Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: tfoote on January 02, 2011, 08:14:00 PM



Title: CMake build system
Post by: tfoote on January 02, 2011, 08:14:00 PM
I've put together the required CMake rules to allow bitcoin to be built using CMake.  The branch is posted on github at https://github.com/tfoote/bitcoin/tree/cmake_devel

CMake is a very powerful tool and it makes developing across multiple platforms easier.  http://www.cmake.org/  It's also more flexible for finding non standard libraries such as the ones bitcoin currently requires.   

I've only been able to test this on Lucid 64 machines.  I'll try to test on more platforms.  However right now it's not clear what platforms are expected to work.  If anyone can test it that would be great.  And if you have any feedback or suggestions that'd be great too.


Title: Re: CMake build system
Post by: puddinpop on January 02, 2011, 08:24:02 PM
I think there are a few CMake build files for bitcoin already in existence.  For instance, there's one I put together, which you can find in the source package here (http://bitcointalk.org/index.php?topic=2444.0).


Title: Re: CMake build system
Post by: Gavin Andresen on January 07, 2011, 05:24:16 PM
Great!  I'd like to see this good work make it back into mainline bitcoin; please talk with the other improve-the-build-process efforts and submit some patches.


Title: Re: CMake build system
Post by: dkaparis on January 14, 2011, 11:33:09 AM
I have a CMake-integrated branch here (https://bitbucket.org/dkaparis/bitcoin-cmake/), that I keep in synch with the official repository. I've tested it on Windows (MSVC++ 8 and 9) and FreeBSD (without GUI).

There's also this hsoft (https://bitbucket.org/hsoft/bitcoin-clean)'s clone of mine that has added support of OS X and is cleaning up the code.


Title: Re: CMake build system
Post by: tfoote on February 03, 2011, 08:38:00 AM
I've merged the CMake changes from https://bitbucket.org/dkaparis/bitcoin-cmake/overview and https://bitbucket.org/hsoft/bitcoin-clean I've tested it on Ubuntu Lucid.  https://github.com/bitcoin/bitcoin/pull/56


Title: Re: CMake build system
Post by: alkor on February 03, 2011, 06:05:46 PM
I just tried to test on the Mac (commenting out the GUI building part of the code), and I get the following error:

Code:
[  9%] Building CXX object CMakeFiles/btc.dir/irc.cpp.o
/Users/alkor/Desktop/Dev/bitcoin/irc.cpp: In function ‘bool Send(SOCKET, const char*)’:
/Users/alkor/Desktop/Dev/bitcoin/irc.cpp:61: error: ‘MSG_NOSIGNAL’ was not declared in this scope
make[2]: *** [CMakeFiles/btc.dir/irc.cpp.o] Error 1
make[1]: *** [CMakeFiles/btc.dir/all] Error 2
make: *** [all] Error 2


Title: Re: CMake build system
Post by: Luke-Jr on February 03, 2011, 06:09:08 PM
I thought we were going with autotools from jgarzik?