diff --git a/CMakeLists.txt b/CMakeLists.txt index dab3e5d..6a50a0f 100644 --- a/CMakeLists.txt +++ b/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") diff --git a/README.md b/README.md index 538864e..dee4f50 100644 --- a/README.md +++ b/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). diff --git a/cmake/Modules/FindLibClang.cmake b/cmake/Modules/FindLibClang.cmake index 3d15636..f294979 100644 --- a/cmake/Modules/FindLibClang.cmake +++ b/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 diff --git a/docs/install.md b/docs/install.md index 8b32dc0..bb79a05 100644 --- a/docs/install.md +++ b/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 +``` + + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a5f29de..640cba3 100644 --- a/src/CMakeLists.txt +++ b/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)