From d00e4509529eceb3f9e702423994c88d87a4d1b9 Mon Sep 17 00:00:00 2001 From: Tarn Burton Date: Thu, 25 Feb 2016 12:06:19 -0500 Subject: [PATCH 1/8] Wrapped include of `JSONCPP_INCLUDE_DIRS` in if statement to protected against empty. Added `cadabra_server` install target. --- client_server/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client_server/CMakeLists.txt b/client_server/CMakeLists.txt index b5e9bd53f8..45d315fcc2 100644 --- a/client_server/CMakeLists.txt +++ b/client_server/CMakeLists.txt @@ -30,7 +30,9 @@ message("-- Found JSONCPP include dir: ${JSONCPP_INCLUDE_DIRS}") message("-- Found JSONCPP library dir: ${JSONCPP_LIBRARY_DIRS}") message("-- Found JSONCPP libraries : ${JSONCPP_LIBRARIES}") include_directories("${Boost_INCLUDE_DIRS}" ${PYTHON_INCLUDE_DIR}) +if(JSONCPP_INCLUDE_DIRS) include_directories("${JSONCPP_INCLUDE_DIRS}") +endif(JSONCPP_INCLUDE_DIRS) pkg_check_modules(UUID uuid REQUIRED) include_directories("${UUID_INCLUDE_DIRS}") @@ -71,5 +73,6 @@ set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for lib install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cadabra-server DESTINATION bin) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cadabra2html DESTINATION bin) install(TARGETS cadabra_client LIBRARY DESTINATION "${INSTALL_LIB_DIR}") +install(TARGETS cadabra_server LIBRARY DESTINATION "${INSTALL_LIB_DIR}") From 565934888f486681dfa5e8a201fc7c15179ac429 Mon Sep 17 00:00:00 2001 From: Tarn Burton Date: Thu, 25 Feb 2016 12:13:21 -0500 Subject: [PATCH 2/8] Stored `argv[2]` to `std::string` to fix depreciation message on gcc. --- client_server/regexp_tester.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client_server/regexp_tester.cc b/client_server/regexp_tester.cc index 4b248dff96..c1e09c6b48 100644 --- a/client_server/regexp_tester.cc +++ b/client_server/regexp_tester.cc @@ -13,7 +13,8 @@ int main(int argc, char **argv) try { std::regex match(argv[1]); std::smatch res; - if(std::regex_search(std::string(argv[2]), res, match)) { + std::string arg = argv[2]; + if(std::regex_search(arg, res, match)) { for(unsigned int i=0; i Date: Thu, 25 Feb 2016 12:16:35 -0500 Subject: [PATCH 3/8] Default python on Arch is python3 so `find_program` doesn't really work. Explicitly set `Python_ADDITIONAL_VERSION` to 2.7, used cmake's `find_package` and then called pythong using `PYTHON_EXECUTABLE` --- core/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 248a5f44ec..4fd465fafb 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -19,7 +19,8 @@ set(Boost_USE_STATIC_LIBS OFF) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) find_package(Boost 1.45.0 COMPONENTS python) -find_program(PYTHON "python" REQUIRED) +set(Python_ADDITIONAL_VERSIONS 2.7) +find_package(PythonInterp REQUIRED) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5) @@ -156,11 +157,11 @@ set(IMAGES #set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in") #set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py") #configure_file(${SETUP_PY_IN} ${SETUP_PY}) -#install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install)") +#install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} install)") # import site; print site.getsitepackages()[0] -execute_process(COMMAND ${PYTHON} -c "import site; print site.getsitepackages()[0];" +execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import site; print site.getsitepackages()[0];" OUTPUT_VARIABLE python_site_path OUTPUT_STRIP_TRAILING_WHITESPACE) message("-- Python site path at ${python_site_path}") From 3e1e9d6380fcdf882b13c875ee8697964b0c3f24 Mon Sep 17 00:00:00 2001 From: Tarn Burton Date: Thu, 25 Feb 2016 12:24:21 -0500 Subject: [PATCH 4/8] Don't need jsoncpp prefix. --- client_server/Snoop.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client_server/Snoop.cc b/client_server/Snoop.cc index aacc9bef2c..6e4f05a1c4 100644 --- a/client_server/Snoop.cc +++ b/client_server/Snoop.cc @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include From 7be4528db1bec4ef44edf26d3e050ffb027a4910 Mon Sep 17 00:00:00 2001 From: Tarn Burton Date: Thu, 25 Feb 2016 12:24:49 -0500 Subject: [PATCH 5/8] GCC needs `shared_ptr` wrapped in boost namespace. --- core/PythonCdb.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/PythonCdb.cc b/core/PythonCdb.cc index f39891b44d..b8bac4c2a3 100644 --- a/core/PythonCdb.cc +++ b/core/PythonCdb.cc @@ -6,13 +6,17 @@ // This now works on both Linux and OS X El Capitan, but your mileage may vary. // -#ifdef __clang__ - #ifdef __linux__ +#if (defined(__clang__) && defined(__linux__)) || defined(__GNUG__) +#ifdef __GNUG__ +namespace boost { +#endif template T *get_pointer(std::shared_ptr p) { return p.get(); } +#ifdef __GNUG__ +} #endif #endif From b3ad7a29ae343a8ad756d06355b6793e59e23387 Mon Sep 17 00:00:00 2001 From: Tarn Burton Date: Thu, 25 Feb 2016 12:25:49 -0500 Subject: [PATCH 6/8] Added install for texengine. --- frontend/common/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/common/CMakeLists.txt b/frontend/common/CMakeLists.txt index f3629a6a83..7fd8ce972b 100644 --- a/frontend/common/CMakeLists.txt +++ b/frontend/common/CMakeLists.txt @@ -25,8 +25,11 @@ if(CMAKE_COMPILER_IS_GNUCXX) endif() # Create library +set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries") include_directories(".") add_library(texengine SHARED TeXEngine.cc lodepng.cc exec-stream.cc) target_link_libraries(texengine ${Boost_LIBRARIES} pthread) add_executable(test_tex test_tex.cc) target_link_libraries(test_tex texengine) +install(TARGETS texengine LIBRARY DESTINATION "${INSTALL_LIB_DIR}") + From 2fb69222bd9a5cc23c3de9935e6846f7423703cf Mon Sep 17 00:00:00 2001 From: Tarn Burton Date: Thu, 25 Feb 2016 12:26:05 -0500 Subject: [PATCH 7/8] Wrapped `JSONCPP_INCLUDE_DIRS` in if statement. --- frontend/gtkmm/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/gtkmm/CMakeLists.txt b/frontend/gtkmm/CMakeLists.txt index 0ebd42c9f3..2861c5fc87 100644 --- a/frontend/gtkmm/CMakeLists.txt +++ b/frontend/gtkmm/CMakeLists.txt @@ -14,7 +14,9 @@ include_directories(${GTKMM3_INCLUDE_DIRS}) link_directories(${GTKMM3_LIBRARY_DIRS}) add_definitions(${GTKMM3_CFLAGS_OTHER}) pkg_check_modules(JSONCPP jsoncpp REQUIRED) # libjsoncpp-dev +if(JSONCPP_INCLUDE_DIRS) include_directories("${JSONCPP_INCLUDE_DIRS}") +endif(JSONCPP_INCLUDE_DIRS) link_directories(${JSONCPP_LIBRARY_DIRS}) find_package(Boost 1.45.0 COMPONENTS system) set(Boost_USE_STATIC_LIBS OFF) From 1a80f79ede676d724f71897508078535962e8cf1 Mon Sep 17 00:00:00 2001 From: Tarn Burton Date: Thu, 25 Feb 2016 12:26:46 -0500 Subject: [PATCH 8/8] Gnome doesn't have cinnamon settings and I believe that cinnamon watches the gnome settings already. --- frontend/gtkmm/NotebookWindow.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/gtkmm/NotebookWindow.cc b/frontend/gtkmm/NotebookWindow.cc index d969b1c3a4..e0b5445bf6 100644 --- a/frontend/gtkmm/NotebookWindow.cc +++ b/frontend/gtkmm/NotebookWindow.cc @@ -25,7 +25,7 @@ NotebookWindow::NotebookWindow() #ifdef __APPLE__ scale = 1.0; #else - settings = Gio::Settings::create("org.cinnamon.desktop.interface"); + settings = Gio::Settings::create("org.gnome.desktop.interface"); scale = settings->get_double("text-scaling-factor"); #endif engine.latex_packages.push_back("breqn");