| Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 1 | # Apache Thrift - CMake build |
| 2 | |
| 3 | ## Goal |
| 4 | Extend Apache Thrift's *make cross* approach to the build system. |
| 5 | |
| 6 | Due to growing the field of operating system support, a proper executable |
| 7 | and library detection mechanism running on as much platforms as possible |
| 8 | becomes required. The other aspect to simplify the release process and |
| 9 | package generation process. |
| 10 | |
| 11 | As nice side benefit of CMake is the generation of development environment |
| 12 | specific soultion files. => No solution files within source tree. |
| 13 | |
| 14 | |
| 15 | ## Usage |
| 16 | just do this: |
| 17 | |
| Roger Meier | a6b6633 | 2015-05-15 15:21:50 +0200 | [diff] [blame] | 18 | mkdir cmake-build && cd cmake-build |
| 19 | cmake .. |
| Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 20 | |
| 21 | if you use a specific toolchain pass it to cmake, the same for options: |
| 22 | |
| Roger Meier | 4ead520 | 2015-05-15 16:21:41 +0200 | [diff] [blame] | 23 | cmake -DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake .. |
| Roger Meier | a6b6633 | 2015-05-15 15:21:50 +0200 | [diff] [blame] | 24 | cmake -DCMAKE_C_COMPILER=clang-3.5 -DCMAKE_CXX_COMPILER=clang++-3.5 .. |
| 25 | cmake -DTHRIFT_COMPILER_HS=OFF .. |
| 26 | cmake -DWITH_ZLIB=ON .. |
| 27 | |
| 28 | or on Windows |
| 29 | |
| 30 | cmake -G "Visual Studio 12 2013 Win64" \ |
| 31 | -DBOOST_ROOT=C:/3rdparty/boost_1_58_0 \ |
| 32 | -DZLIB_ROOT=C:/3rdparty/zlib128-dll \ |
| 33 | -DWITH_SHARED_LIB=off -DWITH_BOOSTTHREADS=ON .. |
| Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 34 | |
| 35 | and open the development environment you like with the solution or do this: |
| 36 | |
| 37 | make |
| 38 | make check |
| 39 | make cross |
| 40 | make dist |
| 41 | |
| 42 | to generate an installer and distribution package do this: |
| 43 | |
| 44 | cpack |
| 45 | |
| 46 | ## TODO |
| 47 | * git hash or tag based versioning depending on source state |
| 48 | * build tutorial |
| 49 | * build test |
| 50 | * with/without language lib/<lang>/ |
| 51 | * enable/disable |
| Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 52 | * make cross |
| 53 | * make dist (create an alias to make package_source) |
| 54 | * make doc |
| 55 | * cpack (C++ and make dist only ?) |
| 56 | * thrift-compiler |
| 57 | * libthrift |
| 58 | * tutorial |
| 59 | * test |
| 60 | * merge into /README.md |