Merge pull request #153 from mjbudd77/master
GTK/SDL GUI added to cmake build
This commit is contained in:
commit
550d73b217
12
SConstruct
12
SConstruct
|
@ -98,16 +98,16 @@ else:
|
||||||
conf.env.Append(CCFLAGS = "-DHAVE_ASPRINTF")
|
conf.env.Append(CCFLAGS = "-DHAVE_ASPRINTF")
|
||||||
if env['SYSTEM_MINIZIP']:
|
if env['SYSTEM_MINIZIP']:
|
||||||
assert env.ParseConfig('pkg-config minizip --cflags --libs'), "please install: libminizip"
|
assert env.ParseConfig('pkg-config minizip --cflags --libs'), "please install: libminizip"
|
||||||
assert conf.CheckLibWithHeader('z', 'zlib.h', 'c', 'inflate;', 1), "please install: zlib"
|
assert env.ParseConfig('pkg-config zlib --cflags --libs'), "please install: zlib"
|
||||||
|
#assert conf.CheckLibWithHeader('z', 'zlib.h', 'c', 'inflate;', 1), "please install: zlib"
|
||||||
env.Append(CPPDEFINES=["_SYSTEM_MINIZIP"])
|
env.Append(CPPDEFINES=["_SYSTEM_MINIZIP"])
|
||||||
else:
|
else:
|
||||||
assert conf.CheckLibWithHeader('z', 'zlib.h', 'c', 'inflate;', 1), "please install: zlib"
|
assert env.ParseConfig('pkg-config zlib --cflags --libs'), "please install: zlib"
|
||||||
|
#assert conf.CheckLibWithHeader('z', 'zlib.h', 'c', 'inflate;', 1), "please install: zlib"
|
||||||
if env['SDL2']:
|
if env['SDL2']:
|
||||||
if not conf.CheckLib('SDL2'):
|
assert env.ParseConfig('pkg-config sdl2 --cflags --libs'), "please install: sdl2"
|
||||||
print('Did not find libSDL2 or SDL2.lib, exiting!')
|
|
||||||
Exit(1)
|
|
||||||
env.Append(CPPDEFINES=["_SDL2"])
|
env.Append(CPPDEFINES=["_SDL2"])
|
||||||
env.ParseConfig('pkg-config sdl2 --cflags --libs')
|
#env.ParseConfig('pkg-config sdl2 --cflags --libs')
|
||||||
else:
|
else:
|
||||||
if not conf.CheckLib('SDL'):
|
if not conf.CheckLib('SDL'):
|
||||||
print('Did not find libSDL or SDL.lib, exiting!')
|
print('Did not find libSDL or SDL.lib, exiting!')
|
||||||
|
|
|
@ -10,7 +10,9 @@ my $PKG_OUTPUT_FILE="fceux-$VERSION-$ARCH.deb";
|
||||||
|
|
||||||
# Start by auto figuring out dependencies of the executable.
|
# Start by auto figuring out dependencies of the executable.
|
||||||
# the rest of the package creation is trival.
|
# the rest of the package creation is trival.
|
||||||
my $SO_LIST=`objdump -x $INSTALL_PREFIX/usr/bin/fceux`;
|
my $SO_LIST="";
|
||||||
|
$SO_LIST=`objdump -x $INSTALL_PREFIX/usr/bin/fceux`;
|
||||||
|
$SO_LIST= $SO_LIST . `objdump -x $INSTALL_PREFIX/usr/bin/fceux-gtk`;
|
||||||
|
|
||||||
#print "$SO_LIST";
|
#print "$SO_LIST";
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,8 @@ pkg-config --cflags --libs minizip
|
||||||
#echo '****************************************'
|
#echo '****************************************'
|
||||||
#echo 'Install Dependency libgtk-3-dev'
|
#echo 'Install Dependency libgtk-3-dev'
|
||||||
#echo '****************************************'
|
#echo '****************************************'
|
||||||
#sudo apt-get --assume-yes install libgtk-3-dev
|
sudo apt-get --assume-yes install libgtk-3-dev
|
||||||
#pkg-config --cflags --libs gtk+-3.0
|
pkg-config --cflags --libs gtk+-3.0
|
||||||
#
|
#
|
||||||
## Install GTK+-3 Sourceview
|
## Install GTK+-3 Sourceview
|
||||||
#sudo apt-get --assume-yes install libgtksourceview-3.0-dev
|
#sudo apt-get --assume-yes install libgtksourceview-3.0-dev
|
||||||
|
@ -92,14 +92,24 @@ mkdir -p $INSTALL_PREFIX/usr;
|
||||||
#scons --clean
|
#scons --clean
|
||||||
#scons GTK3=1 SYSTEM_LUA=1 SYSTEM_MINIZIP=1 CREATE_AVI=1 install --prefix=$INSTALL_PREFIX/usr
|
#scons GTK3=1 SYSTEM_LUA=1 SYSTEM_MINIZIP=1 CREATE_AVI=1 install --prefix=$INSTALL_PREFIX/usr
|
||||||
echo "Num CPU: `nproc`";
|
echo "Num CPU: `nproc`";
|
||||||
mkdir build; cd build;
|
mkdir buildQT; cd buildQT;
|
||||||
#qmake PREFIX=$INSTALL_PREFIX/usr ..
|
|
||||||
cmake \
|
cmake \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX/usr \
|
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX/usr \
|
||||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
|
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
|
||||||
..
|
..
|
||||||
make -j `nproc`
|
make -j `nproc`
|
||||||
|
make install
|
||||||
|
|
||||||
|
cd ..;
|
||||||
|
mkdir buildGTK; cd buildGTK;
|
||||||
|
cmake \
|
||||||
|
-DGTK=1 \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX/usr \
|
||||||
|
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
|
||||||
|
..
|
||||||
|
make -j `nproc`
|
||||||
make install
|
make install
|
||||||
|
|
||||||
# Install Files
|
# Install Files
|
||||||
|
@ -134,6 +144,16 @@ else
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -e $INSTALL_PREFIX/usr/bin/fceux-gtk ]; then
|
||||||
|
echo '**************************************************************'
|
||||||
|
echo 'Printing Shared Object Dependencies for fceux-gtk Executable'
|
||||||
|
echo '**************************************************************'
|
||||||
|
ldd $INSTALL_PREFIX/usr/bin/fceux-gtk
|
||||||
|
else
|
||||||
|
echo "Error: Executable Failed to build: $INSTALL_PREFIX/usr/bin/fceux-gtk";
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
echo '**************************************************************'
|
echo '**************************************************************'
|
||||||
echo 'Printing To Be Packaged Files '
|
echo 'Printing To Be Packaged Files '
|
||||||
echo '**************************************************************'
|
echo '**************************************************************'
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
|
|
||||||
|
if ( ${GTK} )
|
||||||
|
set( APP_NAME fceux-gtk)
|
||||||
|
else()
|
||||||
|
set( APP_NAME fceux)
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
set(CMAKE_AUTOUIC ON)
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
endif()
|
||||||
set( APP_NAME fceux)
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(SOURCES ${SRC_CORE} ${SRC_DRIVERS_COMMON} ${SRC_DRIVERS_WIN})
|
set(SOURCES ${SRC_CORE} ${SRC_DRIVERS_COMMON} ${SRC_DRIVERS_WIN})
|
||||||
|
@ -27,14 +30,22 @@ else(WIN32)
|
||||||
# Use the built-in cmake find_package functions to find dependencies
|
# Use the built-in cmake find_package functions to find dependencies
|
||||||
# Use package PkgConfig to detect headers/library what find_package cannot find.
|
# Use package PkgConfig to detect headers/library what find_package cannot find.
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
find_package(Qt5 COMPONENTS Widgets OpenGL REQUIRED)
|
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB REQUIRED)
|
||||||
|
|
||||||
add_definitions( ${Qt5Widgets_DEFINITIONS} )
|
add_definitions( -Wall -Wno-write-strings -Wno-sign-compare -Wno-parentheses -Wno-unused-local-typedefs -fPIC )
|
||||||
include_directories( ${Qt5Widgets_INCLUDE_DIRS} )
|
|
||||||
|
|
||||||
add_definitions( -D__QT_DRIVER__ -Wall -Wno-write-strings -Wno-sign-compare -Wno-parentheses -Wno-unused-local-typedefs -fPIC -DQT_DEPRECATED_WARNINGS )
|
if ( ${GTK} )
|
||||||
|
pkg_check_modules( GTK3 REQUIRED gtk+-3.0)
|
||||||
|
pkg_check_modules( X11 REQUIRED x11)
|
||||||
|
add_definitions( ${GTK3_CFLAGS} ${X11_CFLAGS} )
|
||||||
|
add_definitions( -D_GTK -DOPENGL )
|
||||||
|
else(${GTK})
|
||||||
|
find_package(Qt5 COMPONENTS Widgets OpenGL REQUIRED)
|
||||||
|
add_definitions( ${Qt5Widgets_DEFINITIONS} )
|
||||||
|
include_directories( ${Qt5Widgets_INCLUDE_DIRS} )
|
||||||
|
add_definitions( -D__QT_DRIVER__ -DQT_DEPRECATED_WARNINGS )
|
||||||
|
endif()
|
||||||
|
|
||||||
# Check for libminizip
|
# Check for libminizip
|
||||||
pkg_check_modules( MINIZIP REQUIRED minizip)
|
pkg_check_modules( MINIZIP REQUIRED minizip)
|
||||||
|
@ -381,6 +392,24 @@ set(SRC_DRIVERS_COMMON
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/videolog/rgbtorgb.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/videolog/rgbtorgb.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if ( ${GTK} )
|
||||||
|
set(SRC_DRIVERS_SDL
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/cheat.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/config.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/debugger.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/glxwin.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/gui.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/input.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/memview.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/ramwatch.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/sdl.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/sdl-joystick.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/sdl-sound.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/sdl-throttle.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/sdl-video.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/sdl/unix-netplay.cpp
|
||||||
|
)
|
||||||
|
else()
|
||||||
set(SRC_DRIVERS_SDL
|
set(SRC_DRIVERS_SDL
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/main.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/main.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ConsoleWindow.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ConsoleWindow.cpp
|
||||||
|
@ -407,6 +436,7 @@ set(SRC_DRIVERS_SDL
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/sdl-throttle.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/sdl-throttle.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/unix-netplay.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/unix-netplay.cpp
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(SOURCES ${SRC_CORE} ${SRC_DRIVERS_COMMON} ${SRC_DRIVERS_SDL})
|
set(SOURCES ${SRC_CORE} ${SRC_DRIVERS_COMMON} ${SRC_DRIVERS_SDL})
|
||||||
|
|
||||||
|
@ -427,11 +457,27 @@ add_executable( ${APP_NAME} MACOSX_BUNDLE ${APP_ICON} ${SOURCES} ../resources.
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp)
|
${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp)
|
||||||
|
|
||||||
else()
|
else()
|
||||||
add_executable( ${APP_NAME} ${SOURCES} ../resources.qrc
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp)
|
if ( ${GTK} )
|
||||||
|
add_executable( ${APP_NAME} ${SOURCES}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp)
|
||||||
|
else()
|
||||||
|
add_executable( ${APP_NAME} ${SOURCES} ../resources.qrc
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries( fceux
|
if ( ${GTK} )
|
||||||
|
target_link_libraries( ${APP_NAME}
|
||||||
|
${GTK3_LDFLAGS} ${X11_LDFLAGS}
|
||||||
|
${OPENGL_LDFLAGS}
|
||||||
|
${SDL2_LDFLAGS}
|
||||||
|
${MINIZIP_LDFLAGS} ${ZLIB_LIBRARIES}
|
||||||
|
${LUA_LDFLAGS}
|
||||||
|
${SYS_LIBS}
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
target_link_libraries( ${APP_NAME}
|
||||||
${Qt5Widgets_LIBRARIES}
|
${Qt5Widgets_LIBRARIES}
|
||||||
${Qt5OpenGL_LIBRARIES}
|
${Qt5OpenGL_LIBRARIES}
|
||||||
${OPENGL_LDFLAGS}
|
${OPENGL_LDFLAGS}
|
||||||
|
@ -440,6 +486,7 @@ target_link_libraries( fceux
|
||||||
${LUA_LDFLAGS}
|
${LUA_LDFLAGS}
|
||||||
${SYS_LIBS}
|
${SYS_LIBS}
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "Qt/nes_shm.h"
|
#include "Qt/nes_shm.h"
|
||||||
#include "Qt/unix-netplay.h"
|
#include "Qt/unix-netplay.h"
|
||||||
#include "Qt/ConsoleWindow.h"
|
#include "Qt/ConsoleWindow.h"
|
||||||
|
#include "Qt/fceux_git_info.h"
|
||||||
|
|
||||||
#include "common/cheat.h"
|
#include "common/cheat.h"
|
||||||
#include "../../fceu.h"
|
#include "../../fceu.h"
|
||||||
|
@ -410,6 +411,8 @@ static void ShowUsage(const char *prog)
|
||||||
SDL_GetVersion(&v);
|
SDL_GetVersion(&v);
|
||||||
printf("Linked with SDL version %d.%d.%d\n", v.major, v.minor, v.patch);
|
printf("Linked with SDL version %d.%d.%d\n", v.major, v.minor, v.patch);
|
||||||
printf("Compiled with QT version %d.%d.%d\n", QT_VERSION_MAJOR, QT_VERSION_MINOR, QT_VERSION_PATCH );
|
printf("Compiled with QT version %d.%d.%d\n", QT_VERSION_MAJOR, QT_VERSION_MINOR, QT_VERSION_PATCH );
|
||||||
|
printf("git URL: %s\n", fceu_get_git_url() );
|
||||||
|
printf("git Rev: %s\n", fceu_get_git_rev() );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
// fceux_git_info.h
|
||||||
|
|
||||||
|
const char *fceu_get_git_url(void);
|
||||||
|
const char *fceu_get_git_rev(void);
|
|
@ -19,6 +19,7 @@
|
||||||
#include "memview.h"
|
#include "memview.h"
|
||||||
#include "ramwatch.h"
|
#include "ramwatch.h"
|
||||||
#include "debugger.h"
|
#include "debugger.h"
|
||||||
|
#include "fceux_git_info.h"
|
||||||
|
|
||||||
#ifdef _S9XLUA_H
|
#ifdef _S9XLUA_H
|
||||||
#include "../../fceulua.h"
|
#include "../../fceulua.h"
|
||||||
|
@ -1503,6 +1504,7 @@ static gboolean destroyMainWindowCB(
|
||||||
|
|
||||||
const char *Authors[] = {
|
const char *Authors[] = {
|
||||||
"Linux/SDL Developers:",
|
"Linux/SDL Developers:",
|
||||||
|
" mjbudd77",
|
||||||
" Lukas Sabota //punkrockguy318", " Soules", " Bryan Cain", " radsaq",
|
" Lukas Sabota //punkrockguy318", " Soules", " Bryan Cain", " radsaq",
|
||||||
" Shinydoofy",
|
" Shinydoofy",
|
||||||
"FceuX 2.0 Developers:",
|
"FceuX 2.0 Developers:",
|
||||||
|
@ -1523,11 +1525,16 @@ const char *Authors[] = {
|
||||||
|
|
||||||
void openAbout (void)
|
void openAbout (void)
|
||||||
{
|
{
|
||||||
|
char versionString[512];
|
||||||
|
|
||||||
GdkPixbuf *logo = gdk_pixbuf_new_from_xpm_data (icon_xpm);
|
GdkPixbuf *logo = gdk_pixbuf_new_from_xpm_data (icon_xpm);
|
||||||
|
|
||||||
|
sprintf( versionString, "%s\ngit URL: %s\ngit Rev: %s",
|
||||||
|
FCEU_VERSION_STRING, fceu_get_git_url(), fceu_get_git_rev() );
|
||||||
|
|
||||||
gtk_show_about_dialog (GTK_WINDOW (MainWindow),
|
gtk_show_about_dialog (GTK_WINDOW (MainWindow),
|
||||||
"program-name", "fceuX",
|
"program-name", "fceuX",
|
||||||
"version", FCEU_VERSION_STRING,
|
"version", versionString,
|
||||||
"copyright", "© 2016 FceuX development team",
|
"copyright", "© 2016 FceuX development team",
|
||||||
"license", "GPL-2; See COPYING",
|
"license", "GPL-2; See COPYING",
|
||||||
//"license-type", GTK_LICENSE_GPL_2_0,
|
//"license-type", GTK_LICENSE_GPL_2_0,
|
||||||
|
|
|
@ -51,6 +51,10 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||||
|
#define LSB_FIRST
|
||||||
|
#endif
|
||||||
|
|
||||||
// GLOBALS
|
// GLOBALS
|
||||||
extern Config *g_config;
|
extern Config *g_config;
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "fceux_git_info.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
@ -182,6 +184,8 @@ static void ShowUsage(char *prog)
|
||||||
printf("Compiled with GTK version %d.%d.%d\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION );
|
printf("Compiled with GTK version %d.%d.%d\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION );
|
||||||
//printf("Linked with GTK version %d.%d.%d\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION );
|
//printf("Linked with GTK version %d.%d.%d\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION );
|
||||||
#endif
|
#endif
|
||||||
|
printf("git URL: %s\n", fceu_get_git_url() );
|
||||||
|
printf("git Rev: %s\n", fceu_get_git_rev() );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue