Browse Source

Simplified installation and integration of clang-format.

merge-requests/365/head
eidheim 10 years ago
parent
commit
0cb2c6cf2f
  1. 15
      docs/install.md
  2. 14
      src/config.cc

15
docs/install.md

@ -4,6 +4,7 @@
Install dependencies: Install dependencies:
```sh ```sh
sudo apt-get install git cmake make g++ libclang-dev pkg-config libboost-system-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libgtkmm-3.0-dev libgtksourceviewmm-3.0-dev aspell-en libaspell-dev sudo apt-get install git cmake make g++ libclang-dev pkg-config libboost-system-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libgtkmm-3.0-dev libgtksourceviewmm-3.0-dev aspell-en libaspell-dev
sudo apt-get install clang-format-3.6 || sudo apt-get install clang-format-3.5
``` ```
Get juCi++ source, compile and install: Get juCi++ source, compile and install:
@ -15,12 +16,6 @@ make
sudo make install sudo make install
``` ```
To use clang-format for auto-indentation of C++ files (replace \[version\] with an available clang-format version):
```sh
sudo apt-get install clang-format-[version]
sudo ln -s /usr/bin/clang-format-[version] /usr/local/bin/clang-format
```
## Ubuntu 14/Linux Mint 17 ## Ubuntu 14/Linux Mint 17
Install dependencies: Install dependencies:
```sh ```sh
@ -28,7 +23,7 @@ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update sudo apt-get update
sudo apt-get install g++-4.9 sudo apt-get install g++-4.9
sudo apt-get remove g++-4.8 sudo apt-get remove g++-4.8
sudo apt-get install git cmake make g++ libclang-3.6-dev pkg-config libboost-system1.55-dev libboost-thread1.55-dev libboost-filesystem1.55-dev libboost-log1.55-dev libgtkmm-3.0-dev libgtksourceviewmm-3.0-dev aspell-en libaspell-dev sudo apt-get install git cmake make g++ libclang-3.6-dev clang-format-3.6 pkg-config libboost-system1.55-dev libboost-thread1.55-dev libboost-filesystem1.55-dev libboost-log1.55-dev libgtkmm-3.0-dev libgtksourceviewmm-3.0-dev aspell-en libaspell-dev
``` ```
Get juCi++ source, compile and install: Get juCi++ source, compile and install:
@ -40,12 +35,6 @@ make
sudo make install sudo make install
``` ```
To use clang-format for auto-indentation of C++ files (replace \[version\] with an available clang-format version):
```sh
sudo apt-get install clang-format-[version]
sudo ln -s /usr/bin/clang-format-[version] /usr/local/bin/clang-format
```
## OS X with Homebrew (http://brew.sh/) ## OS X with Homebrew (http://brew.sh/)
Install dependencies (installing llvm may take some time): Install dependencies (installing llvm may take some time):
```sh ```sh

14
src/config.cc

@ -89,8 +89,20 @@ void Config::retrieve_config() {
window.default_size = {cfg.get<int>("default_window_size.width"), cfg.get<int>("default_window_size.height")}; window.default_size = {cfg.get<int>("default_window_size.width"), cfg.get<int>("default_window_size.height")};
terminal.make_command=cfg.get<std::string>("project.make_command"); terminal.make_command=cfg.get<std::string>("project.make_command");
terminal.cmake_command=cfg.get<std::string>("project.cmake_command"); terminal.cmake_command=cfg.get<std::string>("project.cmake_command");
terminal.clang_format_command=cfg.get<std::string>("project.clang_format_command", "clang-format");
terminal.history_size=cfg.get<int>("terminal_history_size"); terminal.history_size=cfg.get<int>("terminal_history_size");
terminal.clang_format_command=cfg.get<std::string>("project.clang_format_command", "clang-format");
#ifdef __linux
if(terminal.clang_format_command=="clang-format" &&
!boost::filesystem::exists("/usr/bin/clang-format") && !boost::filesystem::exists("/usr/local/bin/clang-format")) {
if(boost::filesystem::exists("/usr/bin/clang-format-3.7"))
terminal.clang_format_command="/usr/bin/clang-format-3.7";
else if(boost::filesystem::exists("/usr/bin/clang-format-3.6"))
terminal.clang_format_command="/usr/bin/clang-format-3.6";
else if(boost::filesystem::exists("/usr/bin/clang-format-3.5"))
terminal.clang_format_command="/usr/bin/clang-format-3.5";
}
#endif
} }
bool Config::check_config_file(const boost::property_tree::ptree &default_cfg, std::string parent_path) { bool Config::check_config_file(const boost::property_tree::ptree &default_cfg, std::string parent_path) {

Loading…
Cancel
Save