From 9c8252bef4994bf609c09a068ba75d06eef00815 Mon Sep 17 00:00:00 2001 From: Sit Melai Date: Sun, 29 Jan 2017 18:04:24 +0100 Subject: [PATCH] Ajout de linking (pas beau, mais je ne sais mieux faire) pour gtk, pour compiler patchman terminal sur unix --- code/CMakeModules/FindGTK2.cmake | 30 +++++++ code/nel/src/misc/gtk_displayer.cpp | 2 +- .../src/patchman_service/CMakeLists.txt | 88 ++++++++++++++++++- .../src/patchman_service/service_main.h | 1 + 4 files changed, 119 insertions(+), 2 deletions(-) diff --git a/code/CMakeModules/FindGTK2.cmake b/code/CMakeModules/FindGTK2.cmake index e3e91ed21..0ea5ce82c 100644 --- a/code/CMakeModules/FindGTK2.cmake +++ b/code/CMakeModules/FindGTK2.cmake @@ -41,6 +41,7 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) ${_GTK2IncDir} /usr/include/gtk-2.0 /usr/local/include/gtk-2.0 + /opt/local/include/gtk-2.0 /opt/include/gtk-2.0 /opt/gnome/include/gtk-2.0 /sw/include/gtk-2.0 @@ -63,6 +64,7 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) /opt/gnome/lib64/glib-2.0/include /opt/gnome/lib/glib-2.0/include /opt/lib/glib-2.0/include + /opt/local/lib/glib-2.0/include /usr/lib64/glib-2.0/include /usr/lib/glib-2.0/include /sw/lib/glib-2.0/include @@ -77,6 +79,7 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) ${_GLIB2IncDir} ${_GMODULE2IncDir} /opt/include/glib-2.0 + /opt/local/include/glib-2.0 /opt/gnome/include/glib-2.0 /usr/include/glib-2.0 /sw/include/glib-2.0 @@ -93,6 +96,7 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) /opt/gnome/lib/gtk-2.0/include /opt/gnome/lib64/gtk-2.0/include /opt/lib/gtk-2.0/include + /opt/local/lib/gtk-2.0/include /usr/lib/gtk-2.0/include /usr/lib64/gtk-2.0/include /sw/lib/gtk-2.0/include @@ -108,6 +112,7 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) /opt/gnome/lib/gtk-2.0/include /opt/gnome/lib64/gtk-2.0/include /opt/lib/gtk-2.0/include + /opt/local/include/gdk-pixbuf-2.0 /usr/lib/gtk-2.0/include /usr/lib64/gtk-2.0/include /sw/lib/gtk-2.0/include @@ -140,6 +145,7 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) /opt/gnome/include/libglade-2.0 /usr/include/libglade-2.0 /opt/include/libglade-2.0 + /opt/local/include/libglade-2.0 /sw/include/libglade-2.0 ) gtk2_debug_message("GTK2_GLADE_INCLUDE_DIR is ${GTK2_GLADE_INCLUDE_DIR}") @@ -154,6 +160,7 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) /usr/include/pango-1.0 /opt/gnome/include/pango-1.0 /opt/include/pango-1.0 + /opt/local/include/pango-1.0 /sw/include/pango-1.0 ) gtk2_debug_message("GTK2_PANGO_INCLUDE_DIR is ${GTK2_PANGO_INCLUDE_DIR}") @@ -170,6 +177,7 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) /usr/include/cairo /opt/include /opt/include/cairo + /opt/local/include/cairo /sw/include /sw/include/cairo ) @@ -185,6 +193,7 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) /opt/gnome/include/atk-1.0 /usr/include/atk-1.0 /opt/include/atk-1.0 + /opt/local/include/atk-1.0 /sw/include/atk-1.0 ) gtk2_debug_message("GTK2_ATK_INCLUDE_DIR is ${GTK2_ATK_INCLUDE_DIR}") @@ -232,6 +241,27 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) /opt/lib /sw/lib ) + + if (NOT GTK2_GDK_PIXBUF_LIBRARY) + # May need .dylib on Mac + SET(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib) + find_library(GTK2_GDK_PIXBUF_LIBRARY + NAMES + gdk_pixbuf-2.0.0 + PATHS + ${_GDK2LinkDir} + /usr/lib + /usr/local/lib + /usr/openwin/lib + /usr/X11R6/lib + /opt/gnome/lib + /opt/lib + /sw/lib + ) + SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES}) + endif (NOT GTK2_GDK_PIXBUF_LIBRARY) + gtk2_debug_message("GTK2_GDK_PIXBUF_LIBRARY is ${GTK2_GDK_PIXBUF_LIBRARY}") find_library(GTK2_GMODULE_LIBRARY diff --git a/code/nel/src/misc/gtk_displayer.cpp b/code/nel/src/misc/gtk_displayer.cpp index 0c581b2e5..937431356 100644 --- a/code/nel/src/misc/gtk_displayer.cpp +++ b/code/nel/src/misc/gtk_displayer.cpp @@ -60,7 +60,7 @@ static GtkWidget *hrootbox = NULL, *scrolled_win2 = NULL; // Functions // -CGtkDisplayer (const char *displayerName) : CWindowDisplayer(displayerName) +CGtkDisplayer::CGtkDisplayer (const char *displayerName) : CWindowDisplayer(displayerName) { needSlashR = false; createLabel ("@Clear|CLEAR"); diff --git a/code/ryzom/server/src/patchman_service/CMakeLists.txt b/code/ryzom/server/src/patchman_service/CMakeLists.txt index a4a4f4c2a..4161ac666 100644 --- a/code/ryzom/server/src/patchman_service/CMakeLists.txt +++ b/code/ryzom/server/src/patchman_service/CMakeLists.txt @@ -22,7 +22,92 @@ ADD_EXECUTABLE(ryzom_patchman_service WIN32 ${SRC}) INCLUDE_DIRECTORIES(${RZ_SERVER_SRC_DIR} ${MYSQL_INCLUDE_DIR} ${NEL_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(ryzom_patchman_service +IF (APPLE) + FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation ) + FIND_LIBRARY(CORETEXT_LIBRARY CoreText ) + FIND_LIBRARY(GLIB2_LIBRARY glib-2.0 ) + FIND_LIBRARY(GIO2_LIBRARY gio-2.0 ) + FIND_LIBRARY(CAIRO_LIBRARY cairo ) + FIND_LIBRARY(X11_LIBRARY X11 ) + FIND_LIBRARY(XCB_LIBRARY xcb ) + FIND_LIBRARY(XCURSOR_LIBRARY Xcursor ) + FIND_LIBRARY(XCB_RENDER_LIBRARY xcb-render ) + FIND_LIBRARY(LDAP_R_LIBRARY ldap_r ) + FIND_LIBRARY(LDAP_LIBRARY ldap ) + FIND_LIBRARY(FREETYPE_LIBRARY freetype ) + FIND_LIBRARY(XFIXES_LIBRARY Xfixes ) + FIND_LIBRARY(XRENDER_LIBRARY Xrender ) + FIND_LIBRARY(PIXMAN_LIBRARY pixman-1 ) + FIND_LIBRARY(INTL_LIBRARY intl ) + FIND_LIBRARY(XI_LIBRARY Xi ) + FIND_LIBRARY(COREGRAPHICS_LIBRARY CoreGraphics ) + FIND_LIBRARY(XRANDR_LIBRARY Xrandr ) + FIND_LIBRARY(XDAMAGE_LIBRARY Xdamage ) + FIND_LIBRARY(FFI_LIBRARY ffi ) + FIND_LIBRARY(XEXT_LIBRARY Xext ) + FIND_LIBRARY(XFT_LIBRARY Xft ) + FIND_LIBRARY(PANGOFT2_LIBRARY pangoft2-1.0 ) + SET(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib) + FIND_LIBRARY(FONTCONFIG_LIBRARY fontconfig ) + FIND_LIBRARY(HARFBUZZ_LIBRARY harfbuzz ) + FIND_LIBRARY(RESOLV_LIBRARY resolv ) + SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES}) + FIND_LIBRARY(CORESERVICES_LIBRARY CoreServices ) + FIND_LIBRARY(XCOMPOSITE_LIBRARY Xcomposite ) + FIND_LIBRARY(XINERAMA_LIBRARY Xinerama ) + FIND_LIBRARY(X11_XCB_LIBRARY X11-xcb ) + FIND_LIBRARY(COCOA_LIBRARY Cocoa ) + FIND_LIBRARY(XAU_LIBRARY Xau ) + FIND_LIBRARY(XDMCP_LIBRARY Xdmcp ) + FIND_LIBRARY(BZ2_LIBRARY bz2 ) + + TARGET_LINK_LIBRARIES(ryzom_patchman_service + ryzom_adminmodules + ryzom_gameshare + ryzom_servershare + nelmisc + nelnet + nelpacs + nelgeorges + nelligo + ${COREFOUNDATION_LIBRARY} + ${CORETEXT_LIBRARY} + ${GLIB2_LIBRARY} + ${GIO2_LIBRARY} + ${CAIRO_LIBRARY} + ${X11_LIBRARY} + ${XCB_LIBRARY} + ${XCURSOR_LIBRARY} + ${XCB_RENDER_LIBRARY} + ${LDAP_LIBRARY} + ${LDAPR_LIBRARY} + ${FREETYPE_LIBRARY} + ${XFIXES_LIBRARY} + ${XRENDER_LIBRARY} + ${PIXMAN_LIBRARY} + ${INTL_LIBRARY} + ${XI_LIBRARY} + ${COREGRAPHICS_LIBRARY} + ${XRANDR_LIBRARY} + ${XDAMAGE_LIBRARY} + ${FFI_LIBRARY} + ${XEXT_LIBRARY} + ${XFT_LIBRARY} + ${PANGOFT2_LIBRARY} + ${FONTCONFIG_LIBRARY} + ${HARFBUZZ_LIBRARY} + ${RESOLV_LIBRARY} + ${CORESERVICES_LIBRARY} + ${XCOMPOSITE_LIBRARY} + ${XINERAMA_LIBRARY} + ${X11_XCB_LIBRARY} + ${COCOA_LIBRARY} + ${XAU_LIBRARY} + ${XDMCP_LIBRARY} + ${BZ2_LIBRARY}) +ELSE (APPLE) + TARGET_LINK_LIBRARIES(ryzom_patchman_service ryzom_adminmodules ryzom_gameshare ryzom_servershare @@ -31,6 +116,7 @@ TARGET_LINK_LIBRARIES(ryzom_patchman_service nelpacs nelgeorges nelligo) +ENDIF (APPLE) NL_DEFAULT_PROPS(ryzom_patchman_service "Ryzom, Services: Patch Manager Service (PMS)") NL_ADD_RUNTIME_FLAGS(ryzom_patchman_service) diff --git a/code/ryzom/server/src/patchman_service/service_main.h b/code/ryzom/server/src/patchman_service/service_main.h index 7c4f884c1..628efde10 100644 --- a/code/ryzom/server/src/patchman_service/service_main.h +++ b/code/ryzom/server/src/patchman_service/service_main.h @@ -25,6 +25,7 @@ #include "nel/net/service.h" + //----------------------------------------------------------------------------- // class CServiceClass //-----------------------------------------------------------------------------