Browse Source

CMakeLists now works with -DCMAKE_INSTALL_PREFIX to install on all platforms.

merge-requests/37/head
eidheim 10 years ago
parent
commit
88b2b1a404
  1. 9
      CMakeLists.txt
  2. 4
      docs/install.md
  3. 11
      src/CMakeLists.txt

9
CMakeLists.txt

@ -2,15 +2,6 @@ cmake_minimum_required (VERSION 2.8.4)
set(project_name clangmm) set(project_name clangmm)
project(${project_name}) 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) if(APPLE)
set(Boost_USE_STATIC_LIBS "YES") set(Boost_USE_STATIC_LIBS "YES")
set(CMAKE_MACOSX_RPATH 1) set(CMAKE_MACOSX_RPATH 1)

4
docs/install.md

@ -35,11 +35,11 @@ pacman -S git mingw-w64-[arch]-cmake make mingw-w64-[arch]-toolchain mingw-w64-[
```sh ```sh
git clone https://github.com/cppit/libclangmm.git git clone https://github.com/cppit/libclangmm.git
cd libclangmm cd libclangmm
cmake -G"MSYS Makefiles" . cmake -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/mingw[32 or 64] .
make make
make install make install
``` ```
**You might have to install the files manually.**
<!-- <!--
## Windows with Cygwin (https://www.cygwin.com/) ## Windows with Cygwin (https://www.cygwin.com/)
**Make sure the PATH environment variable does not include paths to non-Cygwin cmake, make and g++.** **Make sure the PATH environment variable does not include paths to non-Cygwin cmake, make and g++.**

11
src/CMakeLists.txt

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

Loading…
Cancel
Save