| 1 | Crules - CMAKE |
|---|
| 2 | ====================== |
|---|
| 3 | |
|---|
| 4 | Quick note: |
|---|
| 5 | ------------- |
|---|
| 6 | This is something i didn't think i would support at all! I personaly |
|---|
| 7 | really dislike Cmake, since it really is a hardcoded build system! |
|---|
| 8 | |
|---|
| 9 | Its merit is that it can help port software to windows, since to have |
|---|
| 10 | a nice native build on windows its prefered to use MSVC(cl.exe+link.exe), |
|---|
| 11 | and not reverting to CYGWIN. This may also be useful to Mac OSX users |
|---|
| 12 | wanting to use Xcode, which i want to support so we can access mac osx |
|---|
| 13 | frameworks easier. But in the end Cmakes is _only_ useful for Windows |
|---|
| 14 | and MacOSX, but really i support *BSD, *linux, *solaris are my main |
|---|
| 15 | interests in operating systems! |
|---|
| 16 | |
|---|
| 17 | Like it or not Autoconf+Automake are the STANDARD, and they work beautifly |
|---|
| 18 | it wasn't until i saw Drizzle (http://drizzle.org) i really understood |
|---|
| 19 | what a build system should do for developers and with Monty Taylors work |
|---|
| 20 | on Pandora i hope this is open up Autotools for more people. Cmake just |
|---|
| 21 | seems like a layer of abstraction to simply get users into an IDE and i |
|---|
| 22 | dislike IDE's to build software because developers tend to get too focused |
|---|
| 23 | in small areas and forget about deployment very quickly and the software |
|---|
| 24 | becomes a maintenance nightmare! |
|---|
| 25 | |
|---|
| 26 | Autotools seem confusing but they are so extensive and very configurable |
|---|
| 27 | for almost any setup! They really make your code much much much easier |
|---|
| 28 | to maintain for outsiders. Having a configuered build system means, |
|---|
| 29 | NOTHING is hardcoded to any paths the system literly configures your software |
|---|
| 30 | without the developers having to worry that much! This makes software Highly |
|---|
| 31 | portable and clean. Installs work easily, and creating a port very simple! |
|---|
| 32 | Some people get hung up on autoconf but in my opinion the real benifits come from |
|---|
| 33 | automake and libtool. |
|---|
| 34 | |
|---|
| 35 | HOWTO: |
|---|
| 36 | ---------------- |
|---|
| 37 | |
|---|
| 38 | To build crules with cmake: |
|---|
| 39 | |
|---|
| 40 | ** Linux/Unix: |
|---|
| 41 | --------------- |
|---|
| 42 | # get the sources git clone... or wget a release etc.. |
|---|
| 43 | $ cd crules |
|---|
| 44 | $ cmake . |
|---|
| 45 | $ make |
|---|
| 46 | |
|---|
| 47 | ** Mac OSX + XCode |
|---|
| 48 | ------------------- |
|---|
| 49 | # install cmake use the shell cd to the toplevel source dir |
|---|
| 50 | # of crules |
|---|
| 51 | $ cmake -G Xcode . |
|---|
| 52 | # open Xcode and file->open-project there should be an xcode |
|---|
| 53 | # project file that xcode can open! Now you can work away in |
|---|
| 54 | # xcode if you prefer |
|---|
| 55 | |
|---|
| 56 | ** Windows (7) + MSVC 9.0/nmake |
|---|
| 57 | -------------------------------- |
|---|
| 58 | # install cmake + MSVC express edition |
|---|
| 59 | # install gnuwin32 flex + bison |
|---|
| 60 | * http://gnuwin32.sourceforge.net/packages/bison.htm |
|---|
| 61 | * http://gnuwin32.sourceforge.net/packages/flex.htm |
|---|
| 62 | # add the C:\Program Files\gnuwin32\bin to your system PATH |
|---|
| 63 | # test this by opening a command prompt |
|---|
| 64 | $ bison.exe ... |
|---|
| 65 | $ flex.exe |
|---|
| 66 | # if they work your half way |
|---|
| 67 | $ cd to the C:\Program Files\Microsoft Visual Studio 9.0\VC |
|---|
| 68 | # vssetenv.bat to set the envoirment variables for using cl.exe |
|---|
| 69 | # in the shell. Test by exec cl.exe |
|---|
| 70 | $ cd to the crules sources |
|---|
| 71 | --------- |
|---|
| 72 | * For nmake simply: |
|---|
| 73 | $ cmake . |
|---|
| 74 | $ nmake |
|---|
| 75 | * for Visual Studio |
|---|
| 76 | $ cmake -G <generator-string> . # see cmake --help for the correct generator string |
|---|
| 77 | $ open the workspace file |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | NOTE (Windows only): |
|---|
| 81 | -------------------- |
|---|
| 82 | I need more time to fix up the windows builds using m4.exe on windows doesn't seem to like the |
|---|
| 83 | windows style paths and flex and generating the lexer and parser seems to fail. I have only tested |
|---|
| 84 | this on Windows 7 so far also but there shouldn't be a problem on other win32. If your using cygwin |
|---|
| 85 | it would be prefered to using GCC/mingw and autoconf see README follow those build instructions. |
|---|