Browse Source

Added cmake_command to config.json so that one can use the MinGW toolchain in Windows if that is wanted. Also now shows all files in directory (some files like cmake.cc got hidden before).

merge-requests/365/head
eidheim 10 years ago
parent
commit
aa50a94a00
  1. 2
      src/CMakeLists.txt
  2. 2
      src/cmake.cc
  3. 1
      src/config.cc
  4. 7
      src/files.h
  5. 1
      src/terminal.h

2
src/CMakeLists.txt

@ -9,7 +9,7 @@ if(APPLE)
endif()
if(CYGWIN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mwindows") #TODO: make juci work with -mwin32 to run without X-server
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mwindows")
endif()
INCLUDE(FindPkgConfig)

2
src/cmake.cc

@ -47,7 +47,7 @@ CMake::CMake(const boost::filesystem::path &path) {
bool CMake::create_compile_commands(const boost::filesystem::path &path) {
Singleton::terminal()->print("Creating "+path.string()+"/compile_commands.json\n");
//TODO: Windows...
if(Singleton::terminal()->execute("cmake . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON", path)==EXIT_SUCCESS)
if(Singleton::terminal()->execute(Singleton::Config::terminal()->cmake_command+" . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON", path)==EXIT_SUCCESS)
return true;
return false;
}

1
src/config.cc

@ -16,6 +16,7 @@ MainConfig::MainConfig() {
Singleton::Config::window()->theme_variant=cfg.get<std::string>("gtk_theme.variant");
Singleton::Config::terminal()->make_command=cfg.get<std::string>("project.make_command");
Singleton::Config::terminal()->cmake_command=cfg.get<std::string>("project.cmake_command");
}
void MainConfig::find_or_create_config_files() {

7
src/files.h

@ -62,18 +62,13 @@ const std::string configjson =
" \"force_kill_last_running\": \"<primary><shift>Escape\"\n"
" },\n"
" \"project\": {\n"
" \"cmake_command\": \"cmake\",\n"
" \"make_command\": \"make\"\n"
" },\n"
" \"directoryfilter\": {\n"
" \"ignore\": [\n"
" \"cmake\",\n"
" \"#\",\n"
" \"~\",\n"
" \".idea\",\n"
" \".so\"\n"
" ],\n"
" \"exceptions\": [\n"
" \"cmakelists.txt\"\n"
" ]\n"
" }\n"
"}\n";

1
src/terminal.h

@ -13,6 +13,7 @@ class Terminal : public Gtk::TextView {
public:
class Config {
public:
std::string cmake_command;
std::string make_command;
};

Loading…
Cancel
Save