summaryrefslogtreecommitdiff
path: root/plugins/dfnet
diff options
context:
space:
mode:
authoriCatButler <i.am.catbutler@gmail.com>2018-03-19 07:39:08 +0000
committerGitHub <noreply@github.com>2018-03-19 07:39:08 +0000
commit6f76041029393c6823973a29426b28c8c2d0b064 (patch)
tree13c1bb5215c2510a7c430b59bc22df666cd2fbf3 /plugins/dfnet
parent768332417644451d38ce1a737465656c7cc75de3 (diff)
parent128d6afb179756513860187cf5e31d84d6d8cac4 (diff)
downloadpcsxr-6f76041029393c6823973a29426b28c8c2d0b064.tar.gz
Merge pull request #7 from loathingKernel/sync-with-codeplex
Sync with codeplex
Diffstat (limited to 'plugins/dfnet')
-rw-r--r--plugins/dfnet/CMakeLists.txt60
-rwxr-xr-xplugins/dfnet/Makefile.am42
2 files changed, 60 insertions, 42 deletions
diff --git a/plugins/dfnet/CMakeLists.txt b/plugins/dfnet/CMakeLists.txt
new file mode 100644
index 00000000..b768a5f1
--- /dev/null
+++ b/plugins/dfnet/CMakeLists.txt
@@ -0,0 +1,60 @@
+message(STATUS "* Configuring dfnet")
+
+include(GlibCompileResourcesSupport)
+
+#deps
+
+find_package(GLib REQUIRED)
+if(NOT GLib_FOUND)
+ message(FATAL_ERROR "GLIB2 library not found")
+endif(NOT GLib_FOUND)
+include_directories(${GLib_INCLUDE_DIRS})
+
+find_package(GTK3 REQUIRED)
+if(NOT GTK3_FOUND)
+ message(FATAL_ERROR "GTK3 library not found")
+endif(NOT GTK3_FOUND)
+include_directories(${GTK3_INCLUDE_DIRS})
+set(GTK_LIBRARIES ${GTK3_LIBRARY} ${GDK3_LIBRARY} ${GDKPixbuf_LIBRARY} ${Pango_LIBRARY} ${Cairo_LIBRARY} ${GObject_LIBRARY} ${GLib_LIBRARY} ${GIO_LIBRARY})
+
+
+#defs
+add_definitions(-DLOCALE_DIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}/locale/" -DPSEMU_DATA_DIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}/psemu" -DDEF_PLUGIN_DIR="${CMAKE_INSTALL_FULL_LIBDIR}/games/psemu")
+
+#sources
+set(PLUGIN_SRCS
+ cfg.c
+ dfnet.c
+ unix.c
+)
+
+set(GUI_SRCS
+ gui.c
+)
+
+
+#resources
+set(RESOURCE_LIST
+ ${CMAKE_CURRENT_SOURCE_DIR}/dfnet.ui
+)
+
+
+compile_gresources(RESOURCE_FILE
+ XML_OUT
+ TYPE EMBED_C
+ PREFIX /org/pcsxr/dfnet
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
+ RESOURCES ${RESOURCE_LIST})
+
+add_custom_target(dfnet_resource DEPENDS ${RESOURCE_FILE})
+
+include_directories(${CMAKE_SOURCE_DIR}/libpcsxcore)
+add_library(DFNet MODULE ${PLUGIN_SRCS})
+
+
+add_executable(cfgDFNet ${GUI_SRCS} ${RESOURCE_FILE})
+add_dependencies(cfgDFNet dfnet_resource)
+target_link_libraries(cfgDFNet ${GTK_LIBRARIES})
+
+install(TARGETS DFNet LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/games/psemu)
+install(TARGETS cfgDFNet RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/games/psemu)
diff --git a/plugins/dfnet/Makefile.am b/plugins/dfnet/Makefile.am
deleted file mode 100755
index f0a53ea0..00000000
--- a/plugins/dfnet/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-bindir = @libdir@/games/psemu/
-libdir = @libdir@/games/psemu/
-
-lib_LTLIBRARIES = libDFNet.la
-
-libDFNet_la_SOURCES = dfnet.c dfnet.h unix.c cfg.c
-libDFNet_la_LDFLAGS = -module -avoid-version
-
-AM_CPPFLAGS = -DLOCALE_DIR=\"${datadir}/locale/\" \
- -DDATADIR=\"${datadir}/psemu/\" \
- $(GTK3_CFLAGS) \
- -I$(top_srcdir)/libpcsxcore -I../../include
-
-bin_PROGRAMS = cfgDFNet
-cfgDFNet_SOURCES = gui.c GtkResources.c GtkResources.h
-cfgDFNet_LDADD = $(GTK3_LIBS)
-
-# gresource.xml is dynamically generated in CMake. Mirror that here in a static way.
-define gresource_xml =
-<?xml version="1.0" encoding="UTF-8"?>
-<gresources>
- <gresource prefix="/org/pcsxr/dfnet">
- <file>dfnet.ui</file>
- </gresource>
-</gresources>
-endef
-
-dfnet.gresource.xml:
- $(file >$@,$(gresource_xml))
-dfnet_gresource: dfnet.gresource.xml
- $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/$<)
-GtkResources.c: dfnet.gresource.xml $(dfnet_gresource)
- $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name dfnet $<
-GtkResources.h: dfnet.gresource.xml $(dfnet_gresource)
- $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header --c-name dfnet $<
-
-
-#glade_DATA = dfnet.ui
-#gladedir = $(datadir)/psemu/
-EXTRA_DIST = $(glade_DATA)
-
-CLEANFILES = dfnet.gresource.xml GtkResources.c GtkResources.h