Browse Source

Merge pull request #17 from eidheim/master

Some doc-cleanups, added OS X installation and libclang version 3.6.2.
merge-requests/37/head
Jørgen Lien Sellæg 10 years ago
parent
commit
b940986a0a
  1. 2
      CMakeLists.txt
  2. 24
      README.md
  3. 3
      cmake/Modules/FindLibClang.cmake
  4. 56
      docs/install.md
  5. 9
      src/CMakeLists.txt

2
CMakeLists.txt

@ -1,8 +1,6 @@
cmake_minimum_required (VERSION 2.8.4)
set(project_name clangmm)
project(${project_name})
set(library_path "/usr/local/lib/")
set(include_path "/usr/local/include/")
if(APPLE)
set(Boost_USE_STATIC_LIBS "YES")

24
README.md

@ -1,8 +1,7 @@
# libclangmm - An easy to use C++-wrapper for libclang #
## About ##
This is a highlevel wrapper for [libclang](http://www.llvm.org). It
provides highlevel C++11 access to complicated C code.
Provides C++ bindings and class structure to the [libclang](http://www.llvm.org) C library.
## Dependencies ##
* libclang
@ -10,13 +9,6 @@ provides highlevel C++11 access to complicated C code.
## Installation ##
See [installation guide](https://github.com/cppit/libclangmm/blob/master/docs/install.md)
### Quickstart ###
```sh
$ git clone https://github.com/cppit/libclangmm.git clangmm
$ cd clangmm
$ make
$ sudo make install
```
# Tests #
The compilation of the tests are disabled due to ease of installation. Simply enter CMakeList.txt and uncomment the last two lines in the file to enable testing.
@ -26,16 +18,16 @@ The compilation of the tests are disabled due to ease of installation. Simply en
```
Then simply:
```sh
$ cmake .
$ make
$ ctest
cmake .
make
ctest
```
If you want an more detailed look at the tests run the binary instead
```sh
$ cmake .
$ make
$ cd tests
$ ./clangmm_tests --log_level=all
cmake .
make
cd tests
./clangmm_tests --log_level=all
```
To see more log parameters see [here](http://www.boost.org/doc/libs/1_58_0/libs/test/doc/html/utf/user-guide/runtime-config/reference.html).

3
cmake/Modules/FindLibClang.cmake

@ -14,7 +14,8 @@
# Known LLVM release numbers.
# most recent versions come first
set(LIBCLANG_KNOWN_LLVM_VERSIONS 3.6.1
set(LIBCLANG_KNOWN_LLVM_VERSIONS 3.6.2
3.6.1
3.6
3.5.1
3.5.0 #Arch Linux

56
docs/install.md

@ -2,12 +2,58 @@
## Debian/Ubuntu
```sh
$ sudo apt-get install libclang-dev make cmake gcc g++ git
sudo apt-get install git cmake make g++ libclang-dev
```
```sh
$ git clone https://github.com/cppit/libclangmm.git clangmm
$ cd clangmm
$ make
$ sudo make install
git clone https://github.com/cppit/libclangmm.git
cd libclangmm
cmake .
make
sudo make install
```
## OS X with Homebrew (http://brew.sh/)
```sh
brew install cmake --with-clang llvm
```
```sh
git clone https://github.com/cppit/libclangmm.git
cd libclangmm
cmake .
make
make install
```
##Windows with MSYS2 (https://msys2.github.io/)
Install dependencies(replace [arch] with i686 or x86_64 depending on your MSYS2 install):
```sh
pacman -S git mingw-w64-[arch]-cmake make mingw-w64-[arch]-toolchain mingw-w64-[arch]-clang
```
```sh
git clone https://github.com/cppit/libclangmm.git
cd libclangmm
cmake -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/mingw[32 or 64] .
make
make install
```
<!--
## Windows with Cygwin (https://www.cygwin.com/)
**Make sure the PATH environment variable does not include paths to non-Cygwin cmake, make and g++.**
Select and install the following packages from the Cygwin-installer:
```
git cmake make gcc-g++ libclang-devel
```
Then run the following in the Cygwin Terminal:
```sh
git clone https://github.com/cppit/libclangmm.git
cd libclangmm
cmake .
make
make install
```
-->

9
src/CMakeLists.txt

@ -48,7 +48,12 @@ set(cc_files
add_library(${project_name} SHARED ${header_files} ${cc_files})
include_directories(${LIBCLANG_INCLUDE_DIRS})
#TODO: till clang is fixed on MSYS2 ((lib)clang.dll.a is missing):
if(MSYS)
set(LIBCLANG_LIBRARIES "${CMAKE_INSTALL_PREFIX}/bin/clang.dll")
endif()
target_link_libraries(${project_name} ${LIBCLANG_LIBRARIES})
install(TARGETS ${project_name} LIBRARY DESTINATION ${library_path})
install(FILES ${header_files} DESTINATION ${include_path}/libclangmm)
install(TARGETS ${project_name} RUNTIME DESTINATION bin LIBRARY DESTINATION lib)
install(FILES ${header_files} DESTINATION include/libclangmm)

Loading…
Cancel
Save