Browse Source

Cygwin-support added, please note that I have not yet tested the changes on OS X and Debian. Doing it now.

merge-requests/365/head
U-ole-PC\ole 10 years ago
parent
commit
d977cfa032
  1. 6
      CMakeLists.txt
  2. 57
      docs/install.md
  3. 45
      src/CMakeLists.txt
  4. 14
      src/cmake/Modules/FindLibClangmm.cmake
  5. 4
      src/window.cc

6
CMakeLists.txt

@ -1,13 +1,13 @@
cmake_minimum_required (VERSION 2.8.4) cmake_minimum_required (VERSION 2.8.4)
set(project_name juci) set(project_name juci)
set(module juci_to_python_api) #set(module juci_to_python_api)
#### TODO WINDOWS SUPPORT #### #### TODO WINDOWS SUPPORT ####
set(bin_install_path "/usr/local/bin") set(bin_install_path "/usr/local/bin")
set(lib_install_path "/usr/local/lib/python2.7/dist-packages/") #set(lib_install_path "/usr/local/lib/python2.7/dist-packages/")
##### #####
project (${project_name}) project (${project_name})
add_subdirectory("src") add_subdirectory("src")

57
docs/install.md

@ -1,22 +1,55 @@
# juCi++ # juCi++
## Installation guide ## ## Installation guide ##
Before installation, please install libclangmm see [installation guide](http://github.com/cppit/libclangmm/blob/master/docs/install.md) for installation. Before installation, please install libclangmm, see [installation guide](http://github.com/cppit/libclangmm/blob/master/docs/install.md).
## Debian ## Debian
First dependencies:
```sh ```sh
$ sudo apt-get install libboost-python-dev libboost-filesystem-dev libboost-log-dev libboost-test-dev sudo apt-get install pkg-config libboost-system-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libgtkmm-3.0-dev libgtksourceviewmm-3.0-dev
libboost-thread-dev libboost-system-dev libgtkmm-3.0-dev libgtksourceview2.0-dev libgtksourceviewmm-3.0-dev
libpython-dev libclang-dev make cmake gcc g++
``` ```
Install the project:
```sh ```sh
$ git clone http://github.com/cppit/jucipp.git juci git clone http://github.com/cppit/jucipp.git
$ cd juci cd jucipp
$ cmake . cmake .
$ make make
$ sudo make install sudo make install
``` ```
## OS X with Homebrew (http://brew.sh/)
```sh
brew install pkg-config boost gtkmm3 gtksourceviewmm3
```
```sh
git clone https://github.com/cppit/jucipp.git
cd jucipp
cmake .
make
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:
```
pkg-config libboost-devel libgtkmm3.0-devel libgtksourceviewmm3.0-devel xinit
```
Then run the following in the Cygwin Terminal:
```sh
git clone https://github.com/cppit/jucipp.git
cd jucipp
cmake .
make
make install
```
Note that we are currently working on a Windows-version without the need of an X-server.
## Run ## Run
```sh ```sh
$ juci juci
```
#Windows
```sh
startxwin /usr/local/bin/juci
``` ```

45
src/CMakeLists.txt

@ -7,6 +7,11 @@ if(APPLE)
set(CMAKE_MACOSX_RPATH 1) set(CMAKE_MACOSX_RPATH 1)
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig") set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig")
endif() endif()
if(CYGWIN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mwindows") #TODO: make juci work with -mwin32 to run without X-server
endif()
INCLUDE(FindPkgConfig) INCLUDE(FindPkgConfig)
set(validation true) set(validation true)
@ -21,7 +26,7 @@ function(install_help APPLE UNIX WINDOWS)
endif(APPLE) endif(APPLE)
endif(UNIX) endif(UNIX)
if(WINDOWS) if(WINDOWS)
message("choco install ${WINDOWS}") #message("choco install ${WINDOWS}") #Removed this for the time being
endif(WINDOWS) endif(WINDOWS)
endfunction(install_help) endfunction(install_help)
@ -38,10 +43,11 @@ validate(${LCL_FOUND} "clangmm" "clangmm" "clangmm")
find_package(LibClang) find_package(LibClang)
validate(${LIBCLANG_FOUND} "clang" "libclang-dev" "llvm") validate(${LIBCLANG_FOUND} "clang" "libclang-dev" "llvm")
find_package(PythonLibs 2.7) #find_package(PythonLibs 2.7)
validate(${PYTHONLIBS_FOUND} "python" "libpython-dev" "python") #validate(${PYTHONLIBS_FOUND} "python" "libpython-dev" "python")
find_package(Boost 1.55 COMPONENTS python thread log system filesystem REQUIRED) #find_package(Boost 1.55 COMPONENTS python thread log system filesystem REQUIRED)
find_package(Boost 1.55 COMPONENTS thread log system filesystem REQUIRED)
validate(${Boost_FOUND} "boost" "libboost-all-dev" "boost") validate(${Boost_FOUND} "boost" "libboost-all-dev" "boost")
pkg_check_modules(GTKMM gtkmm-3.0) # The name GTKMM is set here for the variables abouve pkg_check_modules(GTKMM gtkmm-3.0) # The name GTKMM is set here for the variables abouve
@ -66,8 +72,8 @@ if(${validation})
sourcefile.cc sourcefile.cc
window.cc window.cc
window.h window.h
api.h # api.h
api.cc # api.cc
notebook.cc notebook.cc
notebook.h notebook.h
entrybox.h entrybox.h
@ -83,13 +89,13 @@ if(${validation})
cmake.h cmake.h
cmake.cc) cmake.cc)
add_library(${module} SHARED # add_library(${module} SHARED
api # api
api_ext) # api_ext)
include_directories( include_directories(
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS} # ${PYTHON_INCLUDE_DIRS}
${GTKMM_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}
${GTKSVMM_INCLUDE_DIRS} ${GTKSVMM_INCLUDE_DIRS}
${LCL_INCLUDE_DIRS} ${LCL_INCLUDE_DIRS}
@ -99,15 +105,16 @@ if(${validation})
${GTKMM_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS}
${GTKSVMM_LIBRARY_DIRS} ${GTKSVMM_LIBRARY_DIRS}
${Boost_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS}
${PYTHON_INCLUDE_DIRS} # ${PYTHON_INCLUDE_DIRS}
${LCL_LIBRARY_DIRS} ${LCL_LIBRARY_DIRS}
${LIBCLANG_LIBRARY_DIRS}) ${LIBCLANG_LIBRARY_DIRS})
set_target_properties(${module} # set_target_properties(${module}
PROPERTIES PREFIX "" # PROPERTIES PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib/") # LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib/")
target_link_libraries(${module} ${PYTHON_LIBRARIES} ${Boost_LIBRARIES}) # target_link_libraries(${module} ${PYTHON_LIBRARIES} ${Boost_LIBRARIES})
# target_link_libraries(${module} ${Boost_LIBRARIES})
target_link_libraries(${project_name} target_link_libraries(${project_name}
${LIBCLANG_LIBRARIES} ${LIBCLANG_LIBRARIES}
@ -115,11 +122,13 @@ if(${validation})
${GTKMM_LIBRARIES} ${GTKMM_LIBRARIES}
${GTKSVMM_LIBRARIES} ${GTKSVMM_LIBRARIES}
${Boost_LIBRARIES} ${Boost_LIBRARIES}
${PYTHON_LIBRARIES}) # ${PYTHON_LIBRARIES}
)
install(TARGETS ${project_name} ${module} # install(TARGETS ${project_name} ${module}
install(TARGETS ${project_name}
RUNTIME DESTINATION ${bin_install_path} RUNTIME DESTINATION ${bin_install_path}
LIBRARY DESTINATION ${lib_install_path} # LIBRARY DESTINATION ${lib_install_path}
) )
endif(${validation}) endif(${validation})

14
src/cmake/Modules/FindLibClangmm.cmake

@ -5,12 +5,18 @@
find_package(PkgConfig) find_package(PkgConfig)
find_path(LCL_INCLUDE_DIR clangmm.h find_path(LCL_INCLUDE_DIR clangmm.h
HINTS "/usr/local/include/libclangmm/" HINTS /usr/local/include/libclangmm
) )
if(CYGWIN)
set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "cyg")
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} ".dll")
endif()
find_library(LCL_LIBRARY NAMES clangmm find_library(LCL_LIBRARY NAMES clangmm
HINTS "/usr/local/lib/" PATHS /usr/local/lib /usr/local/bin
) )
set(LCL_LIBRARIES ${LCL_LIBRARY} ) set(LCL_LIBRARIES ${LCL_LIBRARY} )
set(LCL_INCLUDE_DIRS ${LCL_INCLUDE_DIR} ) set(LCL_INCLUDE_DIRS ${LCL_INCLUDE_DIR} )

4
src/window.cc

@ -3,7 +3,7 @@
#include "singletons.h" #include "singletons.h"
#include "sourcefile.h" #include "sourcefile.h"
#include "config.h" #include "config.h"
#include "api.h" //#include "api.h"
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <iostream> //TODO: remove #include <iostream> //TODO: remove
@ -30,7 +30,7 @@ Window::Window() : box(Gtk::ORIENTATION_VERTICAL), notebook(directories), compil
add(box); add(box);
generate_keybindings(); generate_keybindings();
PluginApi(&this->notebook, &this->menu); //PluginApi(&this->notebook, &this->menu);
create_menu(); create_menu();
box.pack_start(menu.get_widget(), Gtk::PACK_SHRINK); box.pack_start(menu.get_widget(), Gtk::PACK_SHRINK);

Loading…
Cancel
Save