|
From: David H. <no...@so...> - 2013-12-14 16:44:50
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "codelite".
The branch, master has been updated
via 1020fc18d53be1cda38a2fe2fd69915bdab7b2f5 (commit)
from d1f188f23ede39b900f9f2a495d53802f5070b19 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceforge.net/p/codelite/codelitegit/ci/1020fc18d53be1cda38a2fe2fd69915bdab7b2f5
commit 1020fc18d53be1cda38a2fe2fd69915bdab7b2f5
Author: dghart <da...@4P...>
Date: Fri Nov 1 12:06:14 2013 +0000
Make CodeLite build and work when wxGTK uses gtk3
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1fec260..8f16002 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,8 @@ cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
#######################################################################################################################################################################
+#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") No, this breaks finding gtk2, so set this locally
+
#############################################
## Defaults
#############################################
@@ -73,22 +75,28 @@ set( CL_WX_CONFIG wx-config )
if (UNIX)
execute_process(COMMAND which ${CL_WX_CONFIG} OUTPUT_VARIABLE WX_TOOL OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT WX_TOOL)
- message(FATAL_ERROR
+ message(FATAL_ERROR
"\nNo functional wx_config script was found in your PATH.\nIs the wxWidgets development package installed?"
)
else()
- execute_process(COMMAND ${WX_TOOL} --version OUTPUT_VARIABLE WX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
- string(SUBSTRING "${WX_VERSION}" "0" "1" wxMAJOR_VERSION)
- string(SUBSTRING "${WX_VERSION}" "2" "1" wxMINOR_VERSION)
- string(SUBSTRING "${WX_VERSION}" "4" "1" wxRELEASE_NUMBER)
- if ( wxMAJOR_VERSION LESS 3 AND (wxMINOR_VERSION LESS 9 OR wxRELEASE_NUMBER LESS 5) )
+ execute_process(COMMAND ${WX_TOOL} --version OUTPUT_VARIABLE WX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+ string(SUBSTRING "${WX_VERSION}" "0" "1" wxMAJOR_VERSION)
+ string(SUBSTRING "${WX_VERSION}" "2" "1" wxMINOR_VERSION)
+ string(SUBSTRING "${WX_VERSION}" "4" "1" wxRELEASE_NUMBER)
+ if ( wxMAJOR_VERSION LESS 3 AND (wxMINOR_VERSION LESS 9 OR wxRELEASE_NUMBER LESS 5) )
message(FATAL_ERROR
"\nI'm afraid your wxWidgets version is too old.\nBuilding CodeLite requires at least wxWidgets-2.9.5"
)
- endif()
+ endif()
endif()
message("-- wx-config used is: ${WX_TOOL}")
message("-- wxWidgets version is: ${WX_VERSION}")
+ if (NOT APPLE)
+ # Is the wx we are using built on gtk2 or 3?
+ execute_process(COMMAND ${WX_TOOL} --selected_config OUTPUT_VARIABLE WX_GTK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+ string(SUBSTRING "${WX_GTK_VERSION}" "3" "1" GTK_VERSION)
+ message("-- gtk version is: ${GTK_VERSION}")
+ endif()
endif (UNIX)
########################################
diff --git a/DatabaseExplorer/CMakeLists.txt b/DatabaseExplorer/CMakeLists.txt
index 3b2a64f..646dccd 100644
--- a/DatabaseExplorer/CMakeLists.txt
+++ b/DatabaseExplorer/CMakeLists.txt
@@ -27,12 +27,24 @@ endif ( WITH_MYSQL )
## On UNIX we require GTK
if (UNIX AND NOT APPLE)
- find_package(GTK2)
- if (GTK2_FOUND)
- include_directories(${GTK2_INCLUDE_DIRS})
- else (GTK2_FOUND)
- message(FATAL_ERROR "Could not locate GTK.")
- endif (GTK2_FOUND)
+ if (GTK_VERSION EQUAL 3)
+ set(OLD_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) # Cache the current value
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
+ find_package(GTK3)
+ set(CMAKE_MODULE_PATH ${OLD_CMAKE_MODULE_PATH}) # Reset, else the official path isn't used again :/
+ if (GTK3_FOUND)
+ include_directories(${GTK3_INCLUDE_DIRS})
+ else (GTK3_FOUND)
+ message(FATAL_ERROR "Could not locate GTK.")
+ endif (GTK3_FOUND)
+ else()
+ find_package(GTK2)
+ if (GTK2_FOUND)
+ include_directories(${GTK2_INCLUDE_DIRS})
+ else (GTK2_FOUND)
+ message(FATAL_ERROR "Could not locate GTK.")
+ endif (GTK2_FOUND)
+ endif()
endif (UNIX AND NOT APPLE)
diff --git a/LiteEditor/CMakeLists.txt b/LiteEditor/CMakeLists.txt
index c5ada98..6f262a5 100644
--- a/LiteEditor/CMakeLists.txt
+++ b/LiteEditor/CMakeLists.txt
@@ -22,12 +22,24 @@ include_directories("${CL_SRC_ROOT}/Plugin" "${CL_SRC_ROOT}/sdk/wxsqlite3/includ
## On UNIX we require GTK
if (UNIX AND NOT APPLE)
- find_package(GTK2)
- if (GTK2_FOUND)
- include_directories(${GTK2_INCLUDE_DIRS})
- else (GTK2_FOUND)
- message(FATAL_ERROR "Could not locate GTK.")
- endif (GTK2_FOUND)
+ if (GTK_VERSION EQUAL 3)
+ set(OLD_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) # Cache the current value
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
+ find_package(GTK3)
+ set(CMAKE_MODULE_PATH ${OLD_CMAKE_MODULE_PATH}) # Reset, else the official path isn't used again :/
+ if (GTK3_FOUND)
+ include_directories(${GTK3_INCLUDE_DIRS})
+ else (GTK3_FOUND)
+ message(FATAL_ERROR "Could not locate GTK.")
+ endif (GTK3_FOUND)
+ else()
+ find_package(GTK2)
+ if (GTK2_FOUND)
+ include_directories(${GTK2_INCLUDE_DIRS})
+ else (GTK2_FOUND)
+ message(FATAL_ERROR "Could not locate GTK.")
+ endif (GTK2_FOUND)
+ endif()
endif (UNIX AND NOT APPLE)
add_definitions(-fPIC)
@@ -70,9 +82,11 @@ endif (UNIX)
if(GTK2_FOUND)
target_link_libraries(codelite ${LINKER_OPTIONS} ${GTK2_LIBRARIES} ${wxWidgets_LIBRARIES} ${CLANG_LIBRARY} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite -lplugin ${ADDITIONAL_LIBRARIES})
-else (GTK2_FOUND)
+elseif (GTK3_FOUND)
+ target_link_libraries(codelite ${LINKER_OPTIONS} ${GTK3_LIBRARIES} ${wxWidgets_LIBRARIES} ${CLANG_LIBRARY} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite -lplugin ${ADDITIONAL_LIBRARIES})
+else()
target_link_libraries(codelite ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} ${CLANG_LIBRARY} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite -lplugin ${ADDITIONAL_LIBRARIES})
-endif(GTK2_FOUND)
+endif()
##################################################################
## Install
diff --git a/LiteEditor/autoversion.cpp b/LiteEditor/autoversion.cpp
index 67fc9b3..4014de2 100644
--- a/LiteEditor/autoversion.cpp
+++ b/LiteEditor/autoversion.cpp
@@ -1,7 +1,7 @@
-#ifndef CL_GIT_REVISION
-#define CL_GIT_REVISION
-
-#include <wx/string.h>
-const wxChar* clGitRevision = wxT("5.4");
-
-#endif
+#ifndef CL_GIT_REVISION
+#define CL_GIT_REVISION
+
+#include <wx/string.h>
+const wxChar* clGitRevision = wxT("5.4");
+#endif
+
diff --git a/Plugin/CMakeLists.txt b/Plugin/CMakeLists.txt
index 7b4e1ba..7692628 100644
--- a/Plugin/CMakeLists.txt
+++ b/Plugin/CMakeLists.txt
@@ -27,12 +27,24 @@ endif ( USE_PCH )
## On UNIX we require GTK
if (UNIX AND NOT APPLE)
- find_package(GTK2)
- if (GTK2_FOUND)
- include_directories(${GTK2_INCLUDE_DIRS})
- else (GTK2_FOUND)
- message(FATAL_ERROR "Could not locate GTK.")
- endif (GTK2_FOUND)
+ if (GTK_VERSION EQUAL 3)
+ set(OLD_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) # Cache the current value
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
+ find_package(GTK3)
+ set(CMAKE_MODULE_PATH ${OLD_CMAKE_MODULE_PATH}) # Reset, else the official path isn't used again :/
+ if (GTK3_FOUND)
+ include_directories(${GTK3_INCLUDE_DIRS})
+ else (GTK3_FOUND)
+ message(FATAL_ERROR "Could not locate GTK.")
+ endif (GTK3_FOUND)
+ else()
+ find_package(GTK2)
+ if (GTK2_FOUND)
+ include_directories(${GTK2_INCLUDE_DIRS})
+ else (GTK2_FOUND)
+ message(FATAL_ERROR "Could not locate GTK.")
+ endif (GTK2_FOUND)
+ endif()
endif (UNIX AND NOT APPLE)
@@ -56,8 +68,10 @@ FILE(GLOB SRCS "*.cpp")
add_library(plugin SHARED ${SRCS})
if(GTK2_FOUND)
target_link_libraries(plugin ${LINKER_OPTIONS} ${GTK2_LIBRARIES} ${wxWidgets_LIBRARIES} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite)
-else (GTK2_FOUND)
+elseif (GTK3_FOUND)
+ target_link_libraries(plugin ${LINKER_OPTIONS} ${GTK3_LIBRARIES} ${wxWidgets_LIBRARIES} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite)
+else()
target_link_libraries(plugin ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite)
-endif(GTK2_FOUND)
+endif()
install(TARGETS plugin DESTINATION ${PLUGINS_DIR})
diff --git a/Plugin/drawingutils.cpp b/Plugin/drawingutils.cpp
index 73c6f7b..aa31a13 100644
--- a/Plugin/drawingutils.cpp
+++ b/Plugin/drawingutils.cpp
@@ -357,6 +357,12 @@ wxColor DrawingUtils::GetPanelBgColour()
if( !intitialized ) {
// try to get the background colour from a menu
GtkWidget *menu = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+#ifdef __WXGTK3__
+ GdkRGBA col;
+ GtkStyleContext* context = gtk_widget_get_style_context( menu );
+ gtk_style_context_get_background_color(context, GTK_STATE_FLAG_NORMAL, &col);
+ bgColour = wxColour(col);
+#else
GtkStyle *def = gtk_rc_get_style( menu );
if(!def)
def = gtk_widget_get_default_style();
@@ -365,6 +371,7 @@ wxColor DrawingUtils::GetPanelBgColour()
GdkColor col = def->bg[GTK_STATE_NORMAL];
bgColour = wxColour(col);
}
+#endif
gtk_widget_destroy( menu );
intitialized = true;
}
@@ -383,6 +390,12 @@ wxColor DrawingUtils::GetTextCtrlTextColour()
if( !intitialized ) {
// try to get the text colour from a textctrl
GtkWidget *textCtrl = gtk_text_view_new();
+#ifdef __WXGTK3__
+ GdkRGBA col;
+ GtkStyleContext* context = gtk_widget_get_style_context( textCtrl );
+ gtk_style_context_get_color(context, GTK_STATE_FLAG_NORMAL, &col);
+ textColour = wxColour(col);
+#else
GtkStyle *def = gtk_rc_get_style( textCtrl );
if(!def)
def = gtk_widget_get_default_style();
@@ -391,6 +404,7 @@ wxColor DrawingUtils::GetTextCtrlTextColour()
GdkColor col = def->text[GTK_STATE_NORMAL];
textColour = wxColour(col);
}
+#endif
gtk_widget_destroy( textCtrl );
intitialized = true;
}
@@ -409,6 +423,12 @@ wxColor DrawingUtils::GetMenuTextColour()
if( !intitialized ) {
// try to get the text colour from a menu
GtkWidget *menuBar = gtk_menu_new();
+#ifdef __WXGTK3__
+ GdkRGBA col;
+ GtkStyleContext* context = gtk_widget_get_style_context( menuBar );
+ gtk_style_context_get_color(context, GTK_STATE_FLAG_NORMAL, &col);
+ textColour = wxColour(col);
+#else
GtkStyle *def = gtk_rc_get_style( menuBar );
if(!def)
def = gtk_widget_get_default_style();
@@ -417,6 +437,7 @@ wxColor DrawingUtils::GetMenuTextColour()
GdkColor col = def->text[GTK_STATE_NORMAL];
textColour = wxColour(col);
}
+#endif
gtk_widget_destroy( menuBar );
intitialized = true;
}
@@ -435,6 +456,12 @@ wxColor DrawingUtils::GetMenuBarBgColour()
if( !intitialized ) {
// try to get the background colour from a menu
GtkWidget *menuBar = gtk_menu_bar_new();
+#ifdef __WXGTK3__
+ GdkRGBA col;
+ GtkStyleContext* context = gtk_widget_get_style_context( menuBar );
+ gtk_style_context_get_background_color(context, GTK_STATE_FLAG_NORMAL, &col);
+ textColour = wxColour(col);
+#else
GtkStyle *def = gtk_rc_get_style( menuBar );
if(!def)
def = gtk_widget_get_default_style();
@@ -443,6 +470,7 @@ wxColor DrawingUtils::GetMenuBarBgColour()
GdkColor col = def->bg[GTK_STATE_NORMAL];
textColour = wxColour(col);
}
+#endif
gtk_widget_destroy( menuBar );
intitialized = true;
}
diff --git a/Plugin/gtk_notebook_ex.cpp b/Plugin/gtk_notebook_ex.cpp
index 7d4781b..5ee7bab 100644
--- a/Plugin/gtk_notebook_ex.cpp
+++ b/Plugin/gtk_notebook_ex.cpp
@@ -553,8 +553,11 @@ void Notebook::GTKAddCloseButtonAndReorderable(int idx)
// so re-order it to position 0, which in a GTK_PACK_END box means the far right
gtk_box_reorder_child(GTK_BOX(pg->m_box), pgInfo->m_button, 0);
gtk_box_set_spacing (GTK_BOX(pg->m_box), 5);
-
+#ifdef __WXGTK3__
+ g_signal_connect (pgInfo->m_button, "clicked", G_CALLBACK (OnNotebookButtonClicked), pgInfo);
+#else
gtk_signal_connect (GTK_OBJECT (pgInfo->m_button), "clicked", GTK_SIGNAL_FUNC (OnNotebookButtonClicked), pgInfo);
+#endif
m_gtk_page_info[page] = pgInfo;
GTKShowCloseButton(idx);
}
diff --git a/cmake/Modules/FindGLIB2.cmake b/cmake/Modules/FindGLIB2.cmake
new file mode 100644
index 0000000..942b045
--- /dev/null
+++ b/cmake/Modules/FindGLIB2.cmake
@@ -0,0 +1,217 @@
+# - Try to find GLib2
+# Once done this will define
+#
+# GLIB2_FOUND - system has GLib2
+# GLIB2_INCLUDE_DIRS - the GLib2 include directory
+# GLIB2_LIBRARIES - Link these to use GLib2
+#
+# HAVE_GLIB_GREGEX_H glib has gregex.h header and
+# supports g_regex_match_simple
+#
+# Copyright (c) 2006 Andreas Schneider <ma...@cy...>
+# Copyright (c) 2006 Philippe Bernery <phi...@gm...>
+# Copyright (c) 2007 Daniel Gollub <dg...@su...>
+# Copyright (c) 2007 Alban Browaeys <pr...@ya...>
+# Copyright (c) 2008 Michael Bell <mic...@we...>
+# Copyright (c) 2008 Bjoern Ricks <bjo...@go...>
+#
+# Redistribution and use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+
+IF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
+ # in cache already
+ SET(GLIB2_FOUND TRUE)
+ELSE (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
+
+ INCLUDE(FindPkgConfig)
+
+ ## Glib
+ IF ( GLIB2_FIND_REQUIRED )
+ SET( _pkgconfig_REQUIRED "REQUIRED" )
+ ELSE ( GLIB2_FIND_REQUIRED )
+ SET( _pkgconfig_REQUIRED "" )
+ ENDIF ( GLIB2_FIND_REQUIRED )
+
+ IF ( GLIB2_MIN_VERSION )
+ PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0>=${GLIB2_MIN_VERSION} )
+ ELSE ( GLIB2_MIN_VERSION )
+ PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0 )
+ ENDIF ( GLIB2_MIN_VERSION )
+ IF ( PKG_CONFIG_FOUND )
+ IF ( GLIB2_FOUND )
+ SET ( GLIB2_CORE_FOUND TRUE )
+ ELSE ( GLIB2_FOUND )
+ SET ( GLIB2_CORE_FOUND FALSE )
+ ENDIF ( GLIB2_FOUND )
+ ENDIF ( PKG_CONFIG_FOUND )
+
+ # Look for glib2 include dir and libraries w/o pkgconfig
+ IF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
+ FIND_PATH(
+ _glibconfig_include_DIR
+ NAMES
+ glibconfig.h
+ PATHS
+ /opt/gnome/lib64
+ /opt/gnome/lib
+ /opt/lib/
+ /opt/local/lib
+ /sw/lib/
+ /usr/lib64
+ /usr/lib
+ /usr/local/include
+ ${CMAKE_LIBRARY_PATH}
+ PATH_SUFFIXES
+ glib-2.0/include
+ )
+
+ FIND_PATH(
+ _glib2_include_DIR
+ NAMES
+ glib.h
+ PATHS
+ /opt/gnome/include
+ /opt/local/include
+ /sw/include
+ /usr/include
+ /usr/local/include
+ PATH_SUFFIXES
+ glib-2.0
+ )
+
+ #MESSAGE(STATUS "Glib headers: ${_glib2_include_DIR}")
+
+ FIND_LIBRARY(
+ _glib2_link_DIR
+ NAMES
+ glib-2.0
+ glib
+ PATHS
+ /opt/gnome/lib
+ /opt/local/lib
+ /sw/lib
+ /usr/lib
+ /usr/local/lib
+ )
+ IF ( _glib2_include_DIR AND _glib2_link_DIR )
+ SET ( _glib2_FOUND TRUE )
+ ENDIF ( _glib2_include_DIR AND _glib2_link_DIR )
+
+
+ IF ( _glib2_FOUND )
+ SET ( GLIB2_INCLUDE_DIRS ${_glib2_include_DIR} ${_glibconfig_include_DIR} )
+ SET ( GLIB2_LIBRARIES ${_glib2_link_DIR} )
+ SET ( GLIB2_CORE_FOUND TRUE )
+ ELSE ( _glib2_FOUND )
+ SET ( GLIB2_CORE_FOUND FALSE )
+ ENDIF ( _glib2_FOUND )
+
+ # Handle dependencies
+ # libintl
+ IF ( NOT LIBINTL_FOUND )
+ FIND_PATH(LIBINTL_INCLUDE_DIR
+ NAMES
+ libintl.h
+ PATHS
+ /opt/gnome/include
+ /opt/local/include
+ /sw/include
+ /usr/include
+ /usr/local/include
+ )
+
+ FIND_LIBRARY(LIBINTL_LIBRARY
+ NAMES
+ intl
+ PATHS
+ /opt/gnome/lib
+ /opt/local/lib
+ /sw/lib
+ /usr/local/lib
+ /usr/lib
+ )
+
+ IF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
+ SET (LIBINTL_FOUND TRUE)
+ ENDIF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
+ ENDIF ( NOT LIBINTL_FOUND )
+
+ # libiconv
+ IF ( NOT LIBICONV_FOUND )
+ FIND_PATH(LIBICONV_INCLUDE_DIR
+ NAMES
+ iconv.h
+ PATHS
+ /opt/gnome/include
+ /opt/local/include
+ /opt/local/include
+ /sw/include
+ /sw/include
+ /usr/local/include
+ /usr/include
+ PATH_SUFFIXES
+ glib-2.0
+ )
+
+ FIND_LIBRARY(LIBICONV_LIBRARY
+ NAMES
+ iconv
+ PATHS
+ /opt/gnome/lib
+ /opt/local/lib
+ /sw/lib
+ /usr/lib
+ /usr/local/lib
+ )
+
+ IF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
+ SET (LIBICONV_FOUND TRUE)
+ ENDIF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
+ ENDIF ( NOT LIBICONV_FOUND )
... 191 lines suppressed ...
hooks/post-receive
--
codelite
|