File fix-use-system-sqlite3.patch of Package codelite
diff -rupN codelite-8.1/cmake/Modules/FindSqlite3.cmake codelite-8.1-new/cmake/Modules/FindSqlite3.cmake
--- codelite-8.1/cmake/Modules/FindSqlite3.cmake 1970-01-01 01:00:00.000000000 +0100
+++ codelite-8.1-new/cmake/Modules/FindSqlite3.cmake 2015-10-10 17:42:47.659742053 +0200
@@ -0,0 +1,26 @@
+if(UNIX AND NOT APPLE)
+ find_library(SQLITE3_LIBRARY
+ NAMES libsqlite3.so
+ HINTS
+ /usr/local/lib
+ /usr/lib
+ /usr/lib/x86_64-linux-gnu
+ )
+
+ find_path(SQLITE3_INCLUDE_DIR NAMES sqlite3.h
+ HINTS
+ /usr/local/include
+ /usr/include
+ /usr/include/sqlite3
+ )
+ if (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
+ set(SQLITE3_FOUND TRUE)
+ endif()
+
+ if(NOT SQLITE3_FOUND)
+ message(FATAL_ERROR " **** Could not find Sqlite3. Please install libsqlite3-dev package **** ")
+ else()
+ message("-- SQLITE3_INCLUDE_DIR: " ${SQLITE3_INCLUDE_DIR})
+ message("-- SQLITE3_LIBRARY: " ${SQLITE3_LIBRARY})
+ endif()
+endif()
diff -rupN codelite-8.1/CMakeLists.txt codelite-8.1-new/CMakeLists.txt
--- codelite-8.1/CMakeLists.txt 2015-08-01 08:16:28.000000000 +0200
+++ codelite-8.1-new/CMakeLists.txt 2015-10-10 17:47:34.419733580 +0200
@@ -29,7 +29,6 @@ cmake_minimum_required(VERSION 2.8 FATAL
#################################################################################################################################################################
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
-include(FindLibClang)
#############################################
## Defaults
@@ -46,6 +45,13 @@ else()
set( CL_SRC_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) # which seems to be the same, at least in this situation
endif()
+include(FindLibClang)
+include(FindSqlite3)
+if(NOT SQLITE3_FOUND)
+ set(SQLITE3_INCLUDE_DIR ${CL_SRC_ROOT}/sqlite3)
+ set(SQLITE3_LIBRARY "-lsqlite3lib")
+endif()
+
set( USE_CLANG 1 )
set( IS_FREEBSD 0 )
set( BUILD_WXC 0 )
@@ -440,7 +446,7 @@ endif(WITH_SFTP)
if (UNIX AND NOT APPLE)
SET(CMAKE_INSTALL_RPATH ${PLUGINS_DIR})
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
- SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ #SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif(UNIX AND NOT APPLE)
if ( WITH_PCH )
@@ -459,7 +465,11 @@ if ( APPLE )
add_definitions( -mmacosx-version-min=10.8 )
endif()
-add_subdirectory(sqlite3)
+
+if(APPLE OR NOT SQLITE3_FOUND)
+ # On Linux, we use the distro's libsqlite3
+ add_subdirectory(sqlite3)
+endif()
add_subdirectory(sdk/wxsqlite3)
add_subdirectory(sdk/wxshapeframework)
add_subdirectory(sdk/databaselayer)
@@ -530,11 +540,12 @@ add_subdirectory(WebTools)
##
## Setup the proper dependencies
##
-if ( USE_PCH )
- add_dependencies(sqlite3lib ${CL_PCH_TARGET})
-endif ( USE_PCH )
-
-add_dependencies(wxsqlite3 sqlite3lib)
+if(APPLE OR NOT SQLITE3_FOUND)
+ if ( USE_PCH )
+ add_dependencies(sqlite3lib ${CL_PCH_TARGET})
+ endif ( USE_PCH )
+ add_dependencies(wxsqlite3 sqlite3lib)
+endif()
add_dependencies(databaselayersqlite wxsqlite3)
add_dependencies(wxshapeframework wxsqlite3)
add_dependencies(libcodelite wxshapeframework databaselayersqlite wxsqlite3)
diff -rupN codelite-8.1/CodeLite/CMakeLists.txt codelite-8.1-new/CodeLite/CMakeLists.txt
--- codelite-8.1/CodeLite/CMakeLists.txt 2015-08-01 08:16:28.000000000 +0200
+++ codelite-8.1-new/CodeLite/CMakeLists.txt 2015-10-10 17:42:47.660742053 +0200
@@ -105,7 +105,7 @@ if (UNIX AND NOT APPLE )
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
-L"${CL_LIBPATH}"
- sqlite3lib
+ ${SQLITE3_LIBRARY}
wxsqlite3
${LIBSSH_LIB}
${ADDITIONAL_LIBRARIES})
diff -rupN codelite-8.1/sdk/databaselayer/CMakeLists.txt codelite-8.1-new/sdk/databaselayer/CMakeLists.txt
--- codelite-8.1/sdk/databaselayer/CMakeLists.txt 2015-08-01 08:16:28.000000000 +0200
+++ codelite-8.1-new/sdk/databaselayer/CMakeLists.txt 2015-10-10 17:42:47.661742053 +0200
@@ -33,7 +33,11 @@ if ( APPLE )
endif()
-FILE(GLOB SRCS "src/dblayer/Sqlite*.cpp" "src/dblayer/Database*.cpp" "src/dblayer/Prepared*.cpp" "src/sqlite3/*.c")
+if(APPLE)
+ FILE(GLOB SRCS "src/dblayer/Sqlite*.cpp" "src/dblayer/Database*.cpp" "src/dblayer/Prepared*.cpp" "src/sqlite3/*.c")
+else()
+ FILE(GLOB SRCS "src/dblayer/Sqlite*.cpp" "src/dblayer/Database*.cpp" "src/dblayer/Prepared*.cpp")
+endif()
if ( WITH_MYSQL )
find_library(LIBMYSQLCLIENT NAMES mysql mysqlclient mariadb mariadbclient)
@@ -57,7 +61,10 @@ endif ( WITH_MYSQL )
# Define the output
add_library(databaselayersqlite SHARED ${SRCS} ${MYSQL_SRCS})
-target_link_libraries(databaselayersqlite ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES})
+target_link_libraries(databaselayersqlite
+ ${LINKER_OPTIONS}
+ ${SQLITE3_LIBRARY}
+ ${wxWidgets_LIBRARIES})
if(APPLE)
install(TARGETS databaselayersqlite DESTINATION ${CMAKE_BINARY_DIR}/codelite.app/Contents/MacOS/)
diff -rupN codelite-8.1/sdk/wxsqlite3/CMakeLists.txt codelite-8.1-new/sdk/wxsqlite3/CMakeLists.txt
--- codelite-8.1/sdk/wxsqlite3/CMakeLists.txt 2015-08-01 08:16:28.000000000 +0200
+++ codelite-8.1-new/sdk/wxsqlite3/CMakeLists.txt 2015-10-10 17:42:47.661742053 +0200
@@ -20,7 +20,7 @@ if ( USE_PCH )
add_definitions(-include "${CL_PCH_FILE}")
add_definitions(-Winvalid-pch)
endif ( USE_PCH )
-include_directories(./include ../../sqlite3)
+include_directories(./include ${SQLITE3_INCLUDE_DIR})
if (UNIX AND NOT APPLE)
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" )
@@ -38,7 +38,7 @@ set(SRCS src/wxsqlite3.cpp)
# Define the output
add_library(wxsqlite3 SHARED ${SRCS})
-target_link_libraries(wxsqlite3 ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} -L"${CL_LIBPATH}" -lsqlite3lib)
+target_link_libraries(wxsqlite3 ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} -L"${CL_LIBPATH}" ${SQLITE3_LIBRARY})
if (NOT MINGW)
if(APPLE)
diff -rupN codelite-8.1/ZoomNavigator/zoomnavigator.cpp codelite-8.1-new/ZoomNavigator/zoomnavigator.cpp
--- codelite-8.1/ZoomNavigator/zoomnavigator.cpp 2015-08-01 08:16:28.000000000 +0200
+++ codelite-8.1-new/ZoomNavigator/zoomnavigator.cpp 2015-10-10 17:42:47.662742053 +0200
@@ -45,7 +45,7 @@
static ZoomNavigator* thePlugin = NULL;
#define CHECK_CONDITION( cond ) if ( !cond ) return;
-const char* ZOOM_PANE_TITLE = _("Zoom Navigator");
+const wxString ZOOM_PANE_TITLE = _("Zoom Navigator");
//Define the plugin entry point
extern "C" EXPORT IPlugin *CreatePlugin(IManager *manager)
diff -rupN codelite-8.1/ZoomNavigator/zoomnavigator.h codelite-8.1-new/ZoomNavigator/zoomnavigator.h
--- codelite-8.1/ZoomNavigator/zoomnavigator.h 2015-08-01 08:16:28.000000000 +0200
+++ codelite-8.1-new/ZoomNavigator/zoomnavigator.h 2015-10-10 17:42:47.663742053 +0200
@@ -39,7 +39,7 @@
#include <set>
#include "cl_command_event.h"
-extern const char* ZOOM_PANE_TITLE;
+extern const wxString ZOOM_PANE_TITLE;
class ZoomNavUpdateTimer;