mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-04 15:40:02 +00:00
get wxw3 building on linux
kind of hacky because currently, shared libpng is always expected to be used on darwin, libpng in externals is always used
This commit is contained in:
parent
20bb7a28b5
commit
6091774ade
@ -476,48 +476,52 @@ if(NOT DISABLE_WX)
|
|||||||
unset(wxWidgets_FOUND)
|
unset(wxWidgets_FOUND)
|
||||||
endif()
|
endif()
|
||||||
endif(wxWidgets_FOUND)
|
endif(wxWidgets_FOUND)
|
||||||
|
|
||||||
if(wxWidgets_FOUND)
|
|
||||||
include(${wxWidgets_USE_FILE})
|
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
# There is a bug in the FindGTK module in cmake version 2.8.2 that
|
# There is a bug in the FindGTK module in cmake version 2.8.2 that
|
||||||
# does not find gdk-pixbuf-2.0. On the other hand some 2.8.3
|
# does not find gdk-pixbuf-2.0. On the other hand some 2.8.3
|
||||||
# users have complained that pkg-config does not find
|
# users have complained that pkg-config does not find
|
||||||
# gdk-pixbuf-2.0. On yet another hand, cmake version 2.8.3 in
|
# gdk-pixbuf-2.0. On yet another hand, cmake version 2.8.3 in
|
||||||
# Ubuntu Natty does not find the glib libraries correctly.
|
# Ubuntu Natty does not find the glib libraries correctly.
|
||||||
# Ugly!!!
|
# Ugly!!!
|
||||||
execute_process(COMMAND lsb_release -c -s
|
execute_process(COMMAND lsb_release -c -s
|
||||||
OUTPUT_VARIABLE DIST_NAME
|
OUTPUT_VARIABLE DIST_NAME
|
||||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}
|
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}
|
||||||
VERSION_EQUAL 2.8.2 OR "${DIST_NAME}" STREQUAL "natty")
|
VERSION_EQUAL 2.8.2 OR "${DIST_NAME}" STREQUAL "natty")
|
||||||
check_lib(GTK2 gtk+-2.0 gtk.h REQUIRED)
|
check_lib(GTK2 gtk+-2.0 gtk.h REQUIRED)
|
||||||
else()
|
else()
|
||||||
include(FindGTK2)
|
include(FindGTK2)
|
||||||
if(GTK2_FOUND)
|
if(GTK2_FOUND)
|
||||||
include_directories(${GTK2_INCLUDE_DIRS})
|
include_directories(${GTK2_INCLUDE_DIRS})
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(wxWidgets_FOUND)
|
||||||
|
include(${wxWidgets_USE_FILE})
|
||||||
message("wxWidgets found, enabling GUI build")
|
message("wxWidgets found, enabling GUI build")
|
||||||
else(wxWidgets_FOUND)
|
else(wxWidgets_FOUND)
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
||||||
message(FATAL_ERROR "wxWidgets not found. It is required to build the GUI")
|
|
||||||
endif()
|
|
||||||
message("Using static wxWidgets from Externals")
|
message("Using static wxWidgets from Externals")
|
||||||
|
|
||||||
|
# These definitions and includes are used when building dolphin against wx,
|
||||||
|
# not when building wx itself (see wxw3 CMakeLists.txt for that)
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
add_definitions(-D__WXOSX_COCOA__)
|
add_definitions(-D__WXOSX_COCOA__)
|
||||||
include_directories(Externals/wxWidgets3)
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
include_directories(Externals/wxWidgets3/include)
|
add_definitions(-D__WXGTK__)
|
||||||
add_subdirectory(Externals/wxWidgets3)
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||||
set(wxWidgets_LIBRARIES "wx")
|
add_definitions(-D__WXMSW__)
|
||||||
else()
|
else()
|
||||||
include_directories(Externals/wxWidgets/include)
|
message(FATAL_ERROR "wxWidgets in Externals is not compatible with your platform")
|
||||||
add_subdirectory(Externals/wxWidgets)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include_directories(
|
||||||
|
Externals/wxWidgets3
|
||||||
|
Externals/wxWidgets3/include)
|
||||||
|
add_subdirectory(Externals/wxWidgets3)
|
||||||
set(wxWidgets_FOUND TRUE)
|
set(wxWidgets_FOUND TRUE)
|
||||||
|
set(wxWidgets_LIBRARIES "wx")
|
||||||
endif(wxWidgets_FOUND)
|
endif(wxWidgets_FOUND)
|
||||||
add_definitions(-DHAVE_WX=1)
|
add_definitions(-DHAVE_WX=1)
|
||||||
endif(NOT DISABLE_WX)
|
endif(NOT DISABLE_WX)
|
||||||
|
37
Externals/wxWidgets3/CMakeLists.txt
vendored
37
Externals/wxWidgets3/CMakeLists.txt
vendored
@ -847,12 +847,28 @@ set(SRCS
|
|||||||
${SRCS_GENERIC})
|
${SRCS_GENERIC})
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
add_definitions(-D__WXOSX_COCOA__)
|
||||||
set(SRCS
|
set(SRCS
|
||||||
${SRCS}
|
${SRCS}
|
||||||
${SRCS_GENERICOSX}
|
${SRCS_GENERICOSX}
|
||||||
${SRCS_OSX}
|
${SRCS_OSX}
|
||||||
${SRCS_UNIX})
|
${SRCS_UNIX})
|
||||||
|
include_directories(../libpng)
|
||||||
|
add_subdirectory(../libpng ../libpng)
|
||||||
|
set(LIBS
|
||||||
|
png
|
||||||
|
iconv
|
||||||
|
${APPKIT_LIBRARY}
|
||||||
|
${APPSERV_LIBRARY}
|
||||||
|
${ATB_LIBRARY}
|
||||||
|
${CARBON_LIBRARY}
|
||||||
|
${COCOA_LIBRARY}
|
||||||
|
${COREFUND_LIBRARY}
|
||||||
|
${CORESERV_LIBRARY}
|
||||||
|
${IOK_LIBRARY}
|
||||||
|
${QUICKTIME_LIBRARY})
|
||||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
|
add_definitions(-D__WXGTK__)
|
||||||
set(SRCS
|
set(SRCS
|
||||||
${SRCS}
|
${SRCS}
|
||||||
${SRCS_GENERICGTK}
|
${SRCS_GENERICGTK}
|
||||||
@ -860,31 +876,16 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|||||||
${SRCS_UNIX}
|
${SRCS_UNIX}
|
||||||
${SRCS_UNIXGTK})
|
${SRCS_UNIXGTK})
|
||||||
else()
|
else()
|
||||||
|
add_definitions(-D__WXMSW__)
|
||||||
set(SRCS
|
set(SRCS
|
||||||
${SRCS}
|
${SRCS}
|
||||||
${SRCS_MSW})
|
${SRCS_MSW})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(-D__WXOSX_COCOA__)
|
|
||||||
add_definitions(-DWXBUILDING)
|
add_definitions(-DWXBUILDING)
|
||||||
add_definitions(-Wno-deprecated-declarations)
|
add_definitions(-Wno-deprecated-declarations)
|
||||||
add_definitions(-Wno-shadow)
|
add_definitions(-Wno-shadow)
|
||||||
set(LIBS
|
|
||||||
iconv
|
|
||||||
${APPKIT_LIBRARY}
|
|
||||||
${APPSERV_LIBRARY}
|
|
||||||
${ATB_LIBRARY}
|
|
||||||
${CARBON_LIBRARY}
|
|
||||||
${COCOA_LIBRARY}
|
|
||||||
${COREFUND_LIBRARY}
|
|
||||||
${CORESERV_LIBRARY}
|
|
||||||
${IOK_LIBRARY}
|
|
||||||
${QUICKTIME_LIBRARY}
|
|
||||||
)
|
|
||||||
|
|
||||||
include_directories(../libpng)
|
enable_precompiled_headers(include/wx/wxprec.h src/common/dummy.cpp SRCS)
|
||||||
add_subdirectory(../libpng ../libpng)
|
add_library(wx STATIC ${PNG_SRCS} ${SRCS})
|
||||||
list(APPEND LIBS png)
|
|
||||||
|
|
||||||
add_library(wx STATIC ${SRCS})
|
|
||||||
target_link_libraries(wx ${LIBS})
|
target_link_libraries(wx ${LIBS})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user