From 52edfa4e57cde1e64ef04f21f100aa3a972bea25 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 21 Aug 2015 09:27:41 +0200 Subject: [PATCH 01/22] Cleanup and added OS X instructions --- docs/install.md | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/docs/install.md b/docs/install.md index 8b32dc0..59e99b8 100644 --- a/docs/install.md +++ b/docs/install.md @@ -1,13 +1,27 @@ # Installation guide # ## Debian/Ubuntu -```sh -$ sudo apt-get install libclang-dev make cmake gcc g++ git +``` +sudo apt-get install libclang-dev make cmake g++ git +``` + +``` +git clone https://github.com/cppit/libclangmm.git +cd libclangmm +cmake . +make +sudo make install ``` -```sh -$ git clone https://github.com/cppit/libclangmm.git clangmm -$ cd clangmm -$ make -$ sudo make install +## OS X with Homebrew (http://brew.sh/) +``` +brew install cmake --with-clang llvm +``` + +``` +git clone https://github.com/cppit/libclangmm.git +cd libclangmm +cmake . +make +make install ``` From 190a5feb2cdaf68cd42da802a7c0174189ac13b6 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 21 Aug 2015 09:33:09 +0200 Subject: [PATCH 02/22] Added $'s --- docs/install.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/install.md b/docs/install.md index 59e99b8..68f0d27 100644 --- a/docs/install.md +++ b/docs/install.md @@ -2,26 +2,26 @@ ## Debian/Ubuntu ``` -sudo apt-get install libclang-dev make cmake g++ git +$ sudo apt-get install libclang-dev make cmake g++ git ``` ``` -git clone https://github.com/cppit/libclangmm.git -cd libclangmm -cmake . -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/) ``` -brew install cmake --with-clang llvm +$ brew install cmake --with-clang llvm ``` ``` -git clone https://github.com/cppit/libclangmm.git -cd libclangmm -cmake . -make -make install +$ git clone https://github.com/cppit/libclangmm.git +$ cd libclangmm +$ cmake . +$ make +$ make install ``` From 109330db10b087846cde9796c83c5c60ae23bccc Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 21 Aug 2015 09:34:24 +0200 Subject: [PATCH 03/22] Added llvm version 3.6.2 --- cmake/Modules/FindLibClang.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 7eb20ddeb7b8c2ca5deaa060ea5c4a6bf59a8562 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 21 Aug 2015 09:36:57 +0200 Subject: [PATCH 04/22] Remove quickstart, best if people look at installation guide --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 538864e..52cf918 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,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. From da33e865405358b79faa9a52bb0517940c9d60e8 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 21 Aug 2015 09:41:17 +0200 Subject: [PATCH 05/22] Somewhat improved language --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 52cf918..e9fa6aa 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 From 7800ba0dfb4db10268e948a78d4b36e8a4de9250 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 21 Aug 2015 09:48:52 +0200 Subject: [PATCH 06/22] Removed $'s so one can copy and paste into terminal --- docs/install.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/install.md b/docs/install.md index 68f0d27..59e99b8 100644 --- a/docs/install.md +++ b/docs/install.md @@ -2,26 +2,26 @@ ## Debian/Ubuntu ``` -$ sudo apt-get install libclang-dev make cmake g++ git +sudo apt-get install libclang-dev make cmake g++ git ``` ``` -$ git clone https://github.com/cppit/libclangmm.git -$ cd libclangmm -$ cmake . -$ 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/) ``` -$ brew install cmake --with-clang llvm +brew install cmake --with-clang llvm ``` ``` -$ git clone https://github.com/cppit/libclangmm.git -$ cd libclangmm -$ cmake . -$ make -$ make install +git clone https://github.com/cppit/libclangmm.git +cd libclangmm +cmake . +make +make install ``` From 02be799f1ddee171fa5b53bb51789f1d9cf5cd7e Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 21 Aug 2015 09:50:25 +0200 Subject: [PATCH 07/22] Removed $'s so one can copy and paste into terminal --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e9fa6aa..172f9ba 100644 --- a/README.md +++ b/README.md @@ -12,22 +12,22 @@ See [installation guide](https://github.com/cppit/libclangmm/blob/master/docs/in # 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. -```sh +``` # enable_testing() # add_subdirectory(tests) ``` 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). From 5ea605bdf2c4a657ac4629fd3160e77c5b081e51 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 21 Aug 2015 09:51:40 +0200 Subject: [PATCH 08/22] sh is back --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 172f9ba..dee4f50 100644 --- a/README.md +++ b/README.md @@ -12,18 +12,18 @@ See [installation guide](https://github.com/cppit/libclangmm/blob/master/docs/in # 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. -``` +```sh # enable_testing() # add_subdirectory(tests) ``` Then simply: -``` +```sh cmake . make ctest ``` If you want an more detailed look at the tests run the binary instead -``` +```sh cmake . make cd tests From bec6c01a9ca48651cd4b12ddf392754e8555119f Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 21 Aug 2015 09:52:12 +0200 Subject: [PATCH 09/22] sh is back --- docs/install.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/install.md b/docs/install.md index 59e99b8..1d984a0 100644 --- a/docs/install.md +++ b/docs/install.md @@ -1,11 +1,11 @@ # Installation guide # ## Debian/Ubuntu -``` +```sh sudo apt-get install libclang-dev make cmake g++ git ``` -``` +```sh git clone https://github.com/cppit/libclangmm.git cd libclangmm cmake . @@ -14,11 +14,11 @@ 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 . From ce0ef4a7577ef78d6ff0f378a64c7805ae1c2a83 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 21 Aug 2015 10:27:55 +0200 Subject: [PATCH 10/22] Added Cygwin support. --- CMakeLists.txt | 6 +++++- src/CMakeLists.txt | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dab3e5d..c8f69c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,11 @@ cmake_minimum_required (VERSION 2.8.4) set(project_name clangmm) project(${project_name}) -set(library_path "/usr/local/lib/") +if(CYGWIN) + set(library_path "/usr/bin/") +else() + set(library_path "/usr/local/lib/") +endif() set(include_path "/usr/local/include/") if(APPLE) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a5f29de..f606241 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -49,6 +49,9 @@ add_library(${project_name} SHARED ${header_files} ${cc_files}) include_directories(${LIBCLANG_INCLUDE_DIRS}) target_link_libraries(${project_name} ${LIBCLANG_LIBRARIES}) - -install(TARGETS ${project_name} LIBRARY DESTINATION ${library_path}) +if(CYGWIN) + install(TARGETS ${project_name} RUNTIME DESTINATION ${library_path}) +else() + install(TARGETS ${project_name} LIBRARY DESTINATION ${library_path}) +endif() install(FILES ${header_files} DESTINATION ${include_path}/libclangmm) From b7e3bc7cefff745c0264f0dde958cac740e9b027 Mon Sep 17 00:00:00 2001 From: "U-olece-PC\\olece" Date: Fri, 21 Aug 2015 11:15:34 +0200 Subject: [PATCH 11/22] Now installs to /usr/local/bin on Cygwin. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c8f69c3..10c3e08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.8.4) set(project_name clangmm) project(${project_name}) if(CYGWIN) - set(library_path "/usr/bin/") + set(library_path "/usr/local/bin/") else() set(library_path "/usr/local/lib/") endif() From 6749ad0ea26b9335af0dab1dc795f36e1f209547 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 21 Aug 2015 12:21:50 +0200 Subject: [PATCH 12/22] Added Windows with Cygwin install documentation Not completely tested due to Windows update madness --- docs/install.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index 1d984a0..0178767 100644 --- a/docs/install.md +++ b/docs/install.md @@ -2,7 +2,7 @@ ## Debian/Ubuntu ```sh -sudo apt-get install libclang-dev make cmake g++ git +sudo apt-get install git cmake make g++ libclang-dev ``` ```sh @@ -25,3 +25,22 @@ cmake . make make install ``` + +## Windows with Cygwin (https://www.cygwin.com/) +Install https://github.com/transcode-open/apt-cyg: +```sh +lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg +install apt-cyg /bin +``` + +```sh +apt-cyg install git cmake make gcc-g++ libclang +``` + +```sh +git clone https://github.com/cppit/libclangmm.git +cd libclangmm +cmake . +make +make install +``` From fe9f2b0acf6b6930139bc8be9eeba1202b820b60 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 21 Aug 2015 14:19:22 +0200 Subject: [PATCH 13/22] apt-cyg did not seem to work --- docs/install.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/docs/install.md b/docs/install.md index 0178767..2ef3f4e 100644 --- a/docs/install.md +++ b/docs/install.md @@ -27,14 +27,9 @@ make install ``` ## Windows with Cygwin (https://www.cygwin.com/) -Install https://github.com/transcode-open/apt-cyg: -```sh -lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg -install apt-cyg /bin +Select and install the following packages from the Cygwin-installer: ``` - -```sh -apt-cyg install git cmake make gcc-g++ libclang +git cmake make gcc-g++ libclang-devel ``` ```sh From 9bdc070f8697bc3780172599408804131c7e7f19 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 21 Aug 2015 14:19:56 +0200 Subject: [PATCH 14/22] Update install.md --- docs/install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index 2ef3f4e..c2d8c64 100644 --- a/docs/install.md +++ b/docs/install.md @@ -31,7 +31,7 @@ Select and install the following packages from the Cygwin-installer: ``` git cmake make gcc-g++ libclang-devel ``` - +Then run: ```sh git clone https://github.com/cppit/libclangmm.git cd libclangmm From 60002a1340544ce8fb6d2a096cde245e68b4952d Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Fri, 21 Aug 2015 14:20:18 +0200 Subject: [PATCH 15/22] Update install.md --- docs/install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index c2d8c64..e8b85ca 100644 --- a/docs/install.md +++ b/docs/install.md @@ -31,7 +31,7 @@ Select and install the following packages from the Cygwin-installer: ``` git cmake make gcc-g++ libclang-devel ``` -Then run: +Then run the following in the Cygwin Terminal: ```sh git clone https://github.com/cppit/libclangmm.git cd libclangmm From 4405a1c1d4c351c0829b71bcd011a8ce3acaa1a0 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Sat, 22 Aug 2015 11:35:10 +0200 Subject: [PATCH 16/22] Update install.md --- docs/install.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/install.md b/docs/install.md index e8b85ca..eeff27b 100644 --- a/docs/install.md +++ b/docs/install.md @@ -27,6 +27,8 @@ 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 From 51d753d25491466374220f6e8e78fd6727f2855e Mon Sep 17 00:00:00 2001 From: "U-olece-PC\\olece" Date: Mon, 24 Aug 2015 15:25:53 +0200 Subject: [PATCH 17/22] Fixed cmakelists for Windows and updated doc (though make install seems not to work. --- CMakeLists.txt | 9 ++++++--- docs/install.md | 14 ++++++++++++++ src/CMakeLists.txt | 7 ++++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10c3e08..20f37a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,15 @@ cmake_minimum_required (VERSION 2.8.4) set(project_name clangmm) project(${project_name}) -if(CYGWIN) - set(library_path "/usr/local/bin/") + +if(MSYS) + string(TOLOWER "/$ENV{MSYSTEM}" CMAKE_INSTALL_PREFIX) + set(library_path "${CMAKE_INSTALL_PREFIX}/bin/") + set(include_path "${CMAKE_INSTALL_PREFIX}/include/") else() set(library_path "/usr/local/lib/") + set(include_path "/usr/local/include/") endif() -set(include_path "/usr/local/include/") if(APPLE) set(Boost_USE_STATIC_LIBS "YES") diff --git a/docs/install.md b/docs/install.md index eeff27b..70e54c6 100644 --- a/docs/install.md +++ b/docs/install.md @@ -26,6 +26,19 @@ 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 mingw-w64-[arch]-cmake mingw-w64-[arch]-toolchain mingw-w64-[arch]-clang +``` + +```sh +cmake -G"MSYS Makefiles" . +make +make install +``` + + \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f606241..56a3ed9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -48,8 +48,13 @@ set(cc_files add_library(${project_name} SHARED ${header_files} ${cc_files}) include_directories(${LIBCLANG_INCLUDE_DIRS}) + +if(MSYS) + set(LIBCLANG_LIBRARIES "${library_path}/clang.dll") +endif() target_link_libraries(${project_name} ${LIBCLANG_LIBRARIES}) -if(CYGWIN) + +if(MSYS) install(TARGETS ${project_name} RUNTIME DESTINATION ${library_path}) else() install(TARGETS ${project_name} LIBRARY DESTINATION ${library_path}) From 8c933910d3ae79cbf259644f52f905be82b14f37 Mon Sep 17 00:00:00 2001 From: "U-olece-PC\\olece" Date: Mon, 24 Aug 2015 15:27:48 +0200 Subject: [PATCH 18/22] Minor fix. --- docs/install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index 70e54c6..8f79622 100644 --- a/docs/install.md +++ b/docs/install.md @@ -26,7 +26,7 @@ make make install ``` -##Windows with MSYS2 https://msys2.github.io/ +##Windows with MSYS2 (https://msys2.github.io/) Install dependencies(replace [arch] with i686 or x86_64 depending on your MSYS2 install): ```sh pacman -S mingw-w64-[arch]-cmake mingw-w64-[arch]-toolchain mingw-w64-[arch]-clang From c13bffa002492614a006b55151b0f578486c23b7 Mon Sep 17 00:00:00 2001 From: "U-olece-PC\\olece" Date: Mon, 24 Aug 2015 15:35:24 +0200 Subject: [PATCH 19/22] Added comment to Windows make install. --- docs/install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index 8f79622..b167d7a 100644 --- a/docs/install.md +++ b/docs/install.md @@ -37,7 +37,7 @@ cmake -G"MSYS Makefiles" . make make install ``` - +**You might have to install the files manually.** \ No newline at end of file +--> From 88b2b1a40434e86162fe4ff83808a44e45182092 Mon Sep 17 00:00:00 2001 From: eidheim Date: Sat, 29 Aug 2015 10:38:15 +0200 Subject: [PATCH 21/22] CMakeLists now works with -DCMAKE_INSTALL_PREFIX to install on all platforms. --- CMakeLists.txt | 9 --------- docs/install.md | 4 ++-- src/CMakeLists.txt | 11 ++++------- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20f37a8..6a50a0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,15 +2,6 @@ cmake_minimum_required (VERSION 2.8.4) set(project_name clangmm) project(${project_name}) -if(MSYS) - string(TOLOWER "/$ENV{MSYSTEM}" CMAKE_INSTALL_PREFIX) - set(library_path "${CMAKE_INSTALL_PREFIX}/bin/") - set(include_path "${CMAKE_INSTALL_PREFIX}/include/") -else() - set(library_path "/usr/local/lib/") - set(include_path "/usr/local/include/") -endif() - if(APPLE) set(Boost_USE_STATIC_LIBS "YES") set(CMAKE_MACOSX_RPATH 1) diff --git a/docs/install.md b/docs/install.md index 345595a..bb79a05 100644 --- a/docs/install.md +++ b/docs/install.md @@ -35,11 +35,11 @@ pacman -S git mingw-w64-[arch]-cmake make mingw-w64-[arch]-toolchain mingw-w64-[ ```sh git clone https://github.com/cppit/libclangmm.git cd libclangmm -cmake -G"MSYS Makefiles" . +cmake -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/mingw[32 or 64] . make make install ``` -**You might have to install the files manually.** +