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] 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})