Updated the CMakeLists.txt files to be able to generate an NSIS installer for Windows.

Also some updates to the documentation and information files.
This commit is contained in:
Leon Styhre 2020-07-07 21:33:33 +02:00
parent fc482fbab8
commit 04d4658fc9
5 changed files with 149 additions and 108 deletions

1
.gitignore vendored
View file

@ -39,6 +39,7 @@ install_manifest.txt
_CPack_Packages _CPack_Packages
emulationstation-de*.deb emulationstation-de*.deb
emulationstation-de*.rpm emulationstation-de*.rpm
emulationstation-de*.exe
# TODO # TODO
TODO.md TODO.md

View file

@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.13)
project(emulationstation-de) project(emulationstation-de)
# Set this to ON to show verbose compiler output (e.g. compiler flags, include directories etc.) # Set this to ON to show verbose compiler output (e.g. compiler flags, include directories etc.)
set(CMAKE_VERBOSE_MAKEFILE OFF CACHE BOOL "Show verbose compiler output" FORCE) set(CMAKE_VERBOSE_MAKEFILE OFF CACHE BOOL "Show verbose compiler output" FORCE)
# Add local find modules to CMAKE path. # Add local find modules to CMAKE path.
LIST(APPEND CMAKE_MODULE_PATH list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/CMake/Utils ${CMAKE_CURRENT_SOURCE_DIR}/CMake/Utils
${CMAKE_CURRENT_SOURCE_DIR}/CMake/Packages) ${CMAKE_CURRENT_SOURCE_DIR}/CMake/Packages)
@ -58,7 +58,7 @@ else()
endif() endif()
# Skip package dependency checks if we're on Windows. # Skip package dependency checks if we're on Windows.
if (NOT WIN32) if(NOT WIN32)
find_package(CURL REQUIRED) find_package(CURL REQUIRED)
find_package(FreeImage REQUIRED) find_package(FreeImage REQUIRED)
find_package(Freetype REQUIRED) find_package(Freetype REQUIRED)
@ -93,26 +93,26 @@ endif()
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
# Check for compiler type and version and apply specific compiler settings. # Check for compiler type and version and apply specific compiler settings.
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
message("-- Compiler is Clang/LLVM") message("-- Compiler is Clang/LLVM")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CLANG_VERSION) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CLANG_VERSION)
if (CLANG_VERSION VERSION_LESS 6.0.0) if(CLANG_VERSION VERSION_LESS 6.0.0)
message(SEND_ERROR "You need at least Clang 6.0.0 to compile EmulationStation-DE!") message(SEND_ERROR "You need at least Clang 6.0.0 to compile EmulationStation-DE!")
endif() endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message("-- Compiler is GNU/GCC") message("-- Compiler is GNU/GCC")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpfullversion OUTPUT_VARIABLE G++_VERSION) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpfullversion OUTPUT_VARIABLE G++_VERSION)
if (G++_VERSION VERSION_LESS 4.8) if(G++_VERSION VERSION_LESS 4.8)
message(SEND_ERROR "You need at least GCC 4.8 to compile EmulationStation-DE!") message(SEND_ERROR "You need at least GCC 4.8 to compile EmulationStation-DE!")
endif() endif()
if (WIN32) if(WIN32)
set(CMAKE_CXX_FLAGS "-mwindows ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "-mwindows ${CMAKE_CXX_FLAGS}")
# set(CMAKE_CXX_FLAGS "-static-libstdc++ -static-libgcc ${CMAKE_CXX_FLAGS}") # set(CMAKE_CXX_FLAGS "-static-libstdc++ -static-libgcc ${CMAKE_CXX_FLAGS}")
endif() endif()
endif() endif()
# Set up compiler flags for debug or release builds. # Set up compiler flags for debug or release builds.
if (CMAKE_BUILD_TYPE MATCHES Debug) if(CMAKE_BUILD_TYPE MATCHES Debug)
# Enable the C++11 standard and disable optimizations as it's a debug build. # Enable the C++11 standard and disable optimizations as it's a debug build.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-attributes -O0") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-attributes -O0")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O0") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O0")
@ -120,7 +120,7 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
# If using Clang, then add additional debug data needed by GDB. # If using Clang, then add additional debug data needed by GDB.
# Comment this out if you're using LLDB for debugging as this flag makes # Comment this out if you're using LLDB for debugging as this flag makes
# the binary much larger and the application much slower. # the binary much larger and the application much slower.
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_DEBUG") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_DEBUG")
endif() endif()
else() else()
@ -137,7 +137,7 @@ else()
endif() endif()
# For Unix systems, assign the installation prefix to local $ES_INSTALL_PREFIX variable. # For Unix systems, assign the installation prefix to local $ES_INSTALL_PREFIX variable.
if (NOT WIN32) if(NOT WIN32)
add_definitions(-DES_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") add_definitions(-DES_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
endif() endif()
@ -146,7 +146,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
# Handle additional (required) include files for dependency packages. # Handle additional (required) include files for dependency packages.
if (WIN32) if(WIN32)
set(WIN32_INCLUDE_DIR "NOT_DEFINED" CACHE FILEPATH "") set(WIN32_INCLUDE_DIR "NOT_DEFINED" CACHE FILEPATH "")
if(NOT EXISTS ${WIN32_INCLUDE_DIR}) if(NOT EXISTS ${WIN32_INCLUDE_DIR})
message(SEND_ERROR "Can't find WIN32 include directory: ${WIN32_INCLUDE_DIR}") message(SEND_ERROR "Can't find WIN32 include directory: ${WIN32_INCLUDE_DIR}")
@ -165,56 +165,46 @@ set(COMMON_INCLUDE_DIRS
${SDL2_INCLUDE_DIR} ${SDL2_INCLUDE_DIR}
${VLC_INCLUDE_DIR} ${VLC_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/external ${CMAKE_CURRENT_SOURCE_DIR}/external
${CMAKE_CURRENT_SOURCE_DIR}/es-core/src ${CMAKE_CURRENT_SOURCE_DIR}/es-core/src)
)
if (WIN32) if(WIN32)
set(COMMON_INCLUDE_DIRS set(COMMON_INCLUDE_DIRS ${COMMON_INCLUDE_DIRS} ${WIN32_INCLUDE_DIR})
${COMMON_INCLUDE_DIRS}
${WIN32_INCLUDE_DIR})
endif() endif()
# Add libCEC include directory. # Add libCEC include directory.
if(DEFINED libCEC_FOUND) if(DEFINED libCEC_FOUND)
LIST(APPEND COMMON_INCLUDE_DIRS list(APPEND COMMON_INCLUDE_DIRS ${libCEC_INCLUDE_DIR})
${libCEC_INCLUDE_DIR})
endif() endif()
# Add ALSA for Linux include directory. # Add ALSA for Linux include directory.
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
LIST(APPEND COMMON_INCLUDE_DIRS list(APPEND COMMON_INCLUDE_DIRS ${ALSA_INCLUDE_DIRS})
${ALSA_INCLUDE_DIRS})
endif() endif()
if(DEFINED BCMHOST) if(DEFINED BCMHOST)
LIST(APPEND COMMON_INCLUDE_DIRS list(APPEND COMMON_INCLUDE_DIRS
"${CMAKE_FIND_ROOT_PATH}/opt/vc/include" "${CMAKE_FIND_ROOT_PATH}/opt/vc/include"
"${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vcos" "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vcos"
"${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vmcs_host/linux" "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vmcs_host/linux"
"${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vcos/pthreads") "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vcos/pthreads")
# Add Vero4k include directory. # Add Vero4k include directory.
elseif(DEFINED VERO4K) elseif(DEFINED VERO4K)
LIST(APPEND COMMON_INCLUDE_DIRS list(APPEND COMMON_INCLUDE_DIRS "${CMAKE_FIND_ROOT_PATH}/opt/vero3/include")
"${CMAKE_FIND_ROOT_PATH}/opt/vero3/include")
else() else()
# Add OpenGL include directory. # Add OpenGL include directory.
if(${GLSystem} MATCHES "Desktop OpenGL") if(${GLSystem} MATCHES "Desktop OpenGL")
LIST(APPEND COMMON_INCLUDE_DIRS list(APPEND COMMON_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
${OPENGL_INCLUDE_DIR})
else() else()
# Add OpenGL ES include directory. # Add OpenGL ES include directory.
LIST(APPEND COMMON_INCLUDE_DIRS list(APPEND COMMON_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR})
${OPENGLES_INCLUDE_DIR})
endif() endif()
endif() endif()
# Define libraries and directories. # Define libraries and directories.
if(DEFINED BCMHOST) if(DEFINED BCMHOST)
link_directories( link_directories("${CMAKE_FIND_ROOT_PATH}/opt/vc/lib")
"${CMAKE_FIND_ROOT_PATH}/opt/vc/lib")
elseif(DEFINED VERO4K) elseif(DEFINED VERO4K)
link_directories( link_directories("${CMAKE_FIND_ROOT_PATH}/opt/vero3/lib")
"${CMAKE_FIND_ROOT_PATH}/opt/vero3/lib")
endif() endif()
if (NOT WIN32) if (NOT WIN32)
@ -243,41 +233,25 @@ endif()
# Add libCEC libraries. # Add libCEC libraries.
if(DEFINED libCEC_FOUND) if(DEFINED libCEC_FOUND)
if(DEFINED BCMHOST) if(DEFINED BCMHOST)
LIST(APPEND COMMON_LIBRARIES list(APPEND COMMON_LIBRARIES vchiq_arm)
vchiq_arm)
endif() endif()
LIST(APPEND COMMON_LIBRARIES list(APPEND COMMON_LIBRARIES dl ${libCEC_LIBRARIES})
dl
${libCEC_LIBRARIES})
endif() endif()
# Add ALSA for Linux libraries. # Add ALSA for Linux libraries.
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
LIST(APPEND COMMON_LIBRARIES list(APPEND COMMON_LIBRARIES ${ALSA_LIBRARY})
${ALSA_LIBRARY})
endif() endif()
if(DEFINED BCMHOST) if(DEFINED BCMHOST)
LIST(APPEND COMMON_LIBRARIES list(APPEND COMMON_LIBRARIES bcm_host brcmEGL ${OPENGLES_LIBRARIES})
bcm_host
brcmEGL
${OPENGLES_LIBRARIES})
elseif(DEFINED VERO4K) elseif(DEFINED VERO4K)
LIST(APPEND COMMON_LIBRARIES list(APPEND COMMON_LIBRARIES EGL ${OPENGLES_LIBRARIES})
EGL
${OPENGLES_LIBRARIES})
else() else()
if(MSVC)
LIST(APPEND COMMON_LIBRARIES
winmm)
endif()
if(${GLSystem} MATCHES "Desktop OpenGL") if(${GLSystem} MATCHES "Desktop OpenGL")
LIST(APPEND COMMON_LIBRARIES list(APPEND COMMON_LIBRARIES ${OPENGL_LIBRARIES})
${OPENGL_LIBRARIES})
else() else()
LIST(APPEND COMMON_LIBRARIES list(APPEND COMMON_LIBRARIES EGL ${OPENGLES_LIBRARIES})
EGL
${OPENGLES_LIBRARIES})
endif() endif()
endif() endif()

View file

@ -177,7 +177,7 @@ sudo apt-get install rpm
### On Windows: ### On Windows:
This is a strange legacy operating system. However it's still popular, so we need to support it for the time being. This is a strange legacy operating system. However it's still popular, so we need to support it.
I did a brief evaluation of the Microsoft Visual C++ compiler (MSVC) but as far as I'm concerned it's an abomination so I won't cover it here and it won't be supported. I did a brief evaluation of the Microsoft Visual C++ compiler (MSVC) but as far as I'm concerned it's an abomination so I won't cover it here and it won't be supported.
@ -197,13 +197,13 @@ Make a copy of `mingw64/bin/mingw32-make` to `make` just for convenience and mak
I won't get into the details on how to configure Git, but there are many resources available online to support with this. The `Git Bash` shell is very useful though as it's somewhat reproducing a Unix environment using MinGW/MSYS. I won't get into the details on how to configure Git, but there are many resources available online to support with this. The `Git Bash` shell is very useful though as it's somewhat reproducing a Unix environment using MinGW/MSYS.
Install your editor of choice. As for VSCodium it's unfortunately broken or crippled under Windows, making some important extensions impossible to install. VSCode works fine, but make sure to disable all surveillance functionality (telemetry). Install your editor of choice. As for VSCodium it's unfortunately broken or crippled under Windows, making some important extensions impossible to install. VSCode can however be used instead.
It's strongly recommended to set line breaks to linefeed (Unix-style) directly in the editor, although it can also be configured in Git for conversion during commit. The source code for EmulationStation-DE only uses Unix-style line breaks. It's strongly recommended to set line breaks to Unix-style (linefeed only) directly in the editor, although it can also be configured in Git for conversion during commit. The source code for EmulationStation-DE only uses Unix-style line breaks.
**Enable pretty printing for GDB:** **Enable pretty printing for GDB:**
This is useful for displaying std::string values for example. This is useful for displaying `std::string` values for example.
Adjust your paths accordingly, the below are just examples of course. Adjust your paths accordingly, the below are just examples of course.
@ -225,7 +225,7 @@ If using VSCode, add the following line to launch.json:
An equivalent setup should be possible on other code editors as well. An equivalent setup should be possible on other code editors as well.
Note that most GDB builds for Windows have broken Python support so that pretty printing won't work. The MinGW installation recommended in the previous step seems to work fine though. Note that most GDB builds for Windows have broken Python support so that pretty printing won't work. The MinGW installation recommended in the previous step works fine though.
**Download the dependency packages:** **Download the dependency packages:**
@ -326,11 +326,15 @@ The files from the MinGW installation must correspond to the version used to com
For a release build: For a release build:
```
cmake -G "MinGW Makefiles" -DWIN32_INCLUDE_DIR=../include . cmake -G "MinGW Makefiles" -DWIN32_INCLUDE_DIR=../include .
```
Or for a debug build: Or for a debug build:
```
cmake -G "MinGW Makefiles" -DWIN32_INCLUDE_DIR=../include -DCMAKE_BUILD_TYPE=Debug . cmake -G "MinGW Makefiles" -DWIN32_INCLUDE_DIR=../include -DCMAKE_BUILD_TYPE=Debug .
```
For some reason defining the '../include' path doesn't work when running CMake from PowerShell (and no, changing to backslash doesn't help). Instead use Bash, by running from a `Git Bash` shell. For some reason defining the '../include' path doesn't work when running CMake from PowerShell (and no, changing to backslash doesn't help). Instead use Bash, by running from a `Git Bash` shell.
@ -343,6 +347,26 @@ Note that compilation time is much longer than on Unix, and linking time is exce
A worthwhile endeavour could be to setup a cross-compilation environment using WLS/WLS2 (Linux), but I have not tried it. A worthwhile endeavour could be to setup a cross-compilation environment using WLS/WLS2 (Linux), but I have not tried it.
**Creating an NSIS installer:**
To create an NSIS installer (Nullsoft Scriptable Install System) you need to first install the NSIS creation tool:
[NSIS](https://nsis.sourceforge.io/Download)
Simply install the application using it's installer.
After the installation has been completed, go to the emulationstation-de directory and run cpack to generate the NSIS installer:
```
$ cpack
CPack: Create package using NSIS
CPack: Install projects
CPack: - Run preinstall target for: emulationstation-de
CPack: - Install project: emulationstation-de []
CPack: Create package
CPack: - package: C:/Programming/emulationstation-de/emulationstation-de-1.0.0-win64.exe generated.
```
Configuring EmulationStation-DE Configuring EmulationStation-DE
=============================== ===============================
@ -477,6 +501,17 @@ Here's an overview of the file layout:
retroarch -L "~/my configs/retroarch/cores/snes9x_libretro.so" %ROM% --> retroarch -L "~/my configs/retroarch/cores/snes9x_libretro.so" %ROM% -->
<command>retroarch -L ~/.config/retroarch/cores/snes9x_libretro.so %ROM%</command> <command>retroarch -L ~/.config/retroarch/cores/snes9x_libretro.so %ROM%</command>
<!-- This is an example for Windows. The .exe extension is optional and both forward slashes and backslashes are allowed as
directory separators. As there is no standardized installation directory structure for this operating system, the %EMUPATH%
variable is used here to find the cores relative to the RetroArch binary. This binary must be in the PATH environmental variable
or otherwise the complete path to the retroarch.exe file needs to be defined. Batch scripts (.bat) are also supported. -->
<command>retroarch.exe -L %EMUPATH%\cores\snes9x_libretro.dll %ROM%</command>
<!-- Another example for Windows. As can be seen here, the absolut path to the emulator has been defined, and there are spaces
in the directory name, so it needs to be surrounded by quotation marks. As well the quotation marks are needed around the core
configuration as the %EMUPATH% will expand to the path of the emulator binary, which will of course also include the spaces. -->
<command>"C:\My Games\RetroArch\retroarch.exe" -L "%EMUPATH%\cores\snes9x_libretro.dll" %ROM%</command>
<!-- The platform(s) to use when scraping. You can see the full list of accepted platforms in src/PlatformIds.cpp. <!-- The platform(s) to use when scraping. You can see the full list of accepted platforms in src/PlatformIds.cpp.
It's case sensitive, but everything is lowercase. This tag is optional. It's case sensitive, but everything is lowercase. This tag is optional.
You can use multiple platforms too, delimited with any of the whitespace characters (", \r\n\t"), e.g.: "megadrive, genesis" --> You can use multiple platforms too, delimited with any of the whitespace characters (", \r\n\t"), e.g.: "megadrive, genesis" -->
@ -496,6 +531,8 @@ The following variables are expanded by ES for the `command` tag:
`%ROM_RAW%` - Replaced with the unescaped, absolute path to the selected ROM. If your emulator is picky about paths, you might want to use this instead of %ROM%, but enclosed in quotes. `%ROM_RAW%` - Replaced with the unescaped, absolute path to the selected ROM. If your emulator is picky about paths, you might want to use this instead of %ROM%, but enclosed in quotes.
`%EMUPATH%` - Replaced with the path to the emulator binary. This is expanded either using the PATH environmental variable of the operating system, or if an absolute emulator path is defined, this will be used instead. This variable is mostly useful to define the emulator core path for Windows, as this operating system does not have a standardized program installation directory structure.
For the `path` tag, the following variable is expanded by ES: For the `path` tag, the following variable is expanded by ES:
`%ROMPATH%` - Replaced with the path defined for the setting ROMDirectory in `es_settings.cfg`. `%ROMPATH%` - Replaced with the path defined for the setting ROMDirectory in `es_settings.cfg`.

View file

@ -12,8 +12,11 @@ v1.0.0
* Gamelist sorting now working as expected and is persistent throughout the application session * Gamelist sorting now working as expected and is persistent throughout the application session
* Full navigation sound support, configurable per theme * Full navigation sound support, configurable per theme
* New default theme rbsimple-DE bundled with the software, this theme is largely based on recalbox-multi by the Recalbox community * New default theme rbsimple-DE bundled with the software, this theme is largely based on recalbox-multi by the Recalbox community
* Added extensive es_systems.cfg templates for Unix and Windows
* Updated the application to compile and work on Microsoft Windows
* Seamless (almost) launch of games without showing the desktop when starting and returning from RetroArch and other emulators * Seamless (almost) launch of games without showing the desktop when starting and returning from RetroArch and other emulators
* Per-game launchstring override, so that different cores or emulators can be used on a per-game basis (saved to gamelist.xml) * Per-game launch command override, so that different cores or emulators can be used on a per-game basis (saved to gamelist.xml)
* Core location can be defined relative to the emulator binary using the %EMUPATH% varible in es_systems.cfg (mostly useful for Windows)
* Help system updated and expanded to the complete application (previously it was only partially implemented) * Help system updated and expanded to the complete application (previously it was only partially implemented)
* GUI-configurable option to sort favorite games on the top of the game lists (favorites marked with stars) * GUI-configurable option to sort favorite games on the top of the game lists (favorites marked with stars)
* Added new component GuiComplexTextEditPopup to handle changes to configuration file entries and similar * Added new component GuiComplexTextEditPopup to handle changes to configuration file entries and similar
@ -24,8 +27,8 @@ v1.0.0
* Refactoring, cleanup and documentation of the source code, removal of deprecated files etc. * Refactoring, cleanup and documentation of the source code, removal of deprecated files etc.
* All required fonts bundled with the application, no dependencies on the OS to provide them any longer * All required fonts bundled with the application, no dependencies on the OS to provide them any longer
* Made pugixml an external dependency instead of bundling it * Made pugixml an external dependency instead of bundling it
* Updated the cmake/cpack install and package build script to work as expected (can now generate .deb and .rpm installation packages) * Updated the CMake/CPack install and package build script to work as expected (can now generate .deb, .rpm and NSIS installation packages)
* Added support for Clang/LLVM, made the application build with no errors or warnings using this compiler * Added support for Clang/LLVM, made the application build with no errors or warnings using this compiler (Unix only)
* License files included for all the libraries and resources that are bundled with the application * License files included for all the libraries and resources that are bundled with the application
* Updated the MAME ROM index files to include ROMs up to MAME version 0.221 (and created scripts to easily generate these index files in the future) * Updated the MAME ROM index files to include ROMs up to MAME version 0.221 (and created scripts to easily generate these index files in the future)

View file

@ -100,65 +100,91 @@ set(ES_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/views/UIModeController.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/views/UIModeController.cpp
) )
#------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
# Define OS specific sources and headers. # Define OS specific sources and headers.
if(WIN32) if(WIN32)
LIST(APPEND ES_SOURCES LIST(APPEND ES_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/EmulationStation.rc)
${CMAKE_CURRENT_SOURCE_DIR}/src/EmulationStation.rc
)
endif() endif()
#-------------------------------------------------------------------------------
# Define target. # Define target.
include_directories(${COMMON_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/src) include_directories(${COMMON_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/src)
add_executable(emulationstation ${ES_SOURCES} ${ES_HEADERS}) add_executable(emulationstation ${ES_SOURCES} ${ES_HEADERS})
target_link_libraries(emulationstation ${COMMON_LIBRARIES} es-core) target_link_libraries(emulationstation ${COMMON_LIBRARIES} es-core)
#------------------------------------------------------------------------------- # Set up CPack for installation and package generation.
# Set up CPack install for `make install`. if(WIN32)
install(TARGETS emulationstation RUNTIME DESTINATION .)
install(FILES ../FreeImage.dll ../libcrypto-1_1-x64.dll ../libcurl-x64.dll ../libfreetype.dll
../libgcc_s_seh-1.dll ../libpugixml.dll ../libssl-1_1-x64.dll ../libstdc++-6.dll
../libvlc.dll ../libvlccore.dll ../libwinpthread-1.dll ../SDL2.dll DESTINATION .)
install(FILES ../LICENSE DESTINATION .)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/LICENSES DESTINATION .)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/themes DESTINATION .)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/resources DESTINATION .)
else()
install(TARGETS emulationstation RUNTIME
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/LICENSES
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/themes
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/resources
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation)
endif()
install(TARGETS emulationstation include(InstallRequiredSystemLibraries)
RUNTIME
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/LICENSES
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/themes
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/resources
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation)
INCLUDE(InstallRequiredSystemLibraries) #---------------------------------------------------------------------------------------------------
# CPack settings.
set(CPACK_PACKAGE_NAME "emulationstation-de")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An emulator front-end with controller navigation and theming support.")
set(CPACK_PACKAGE_DESCRIPTION "EmulationStation Desktop Edition is a fast and flexible front-end for browsing and launching games from your multi-platform retro game collection. It's intended to be used in conjunction with emulators such as the RetroArch cores.")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
SET(CPACK_PACKAGE_NAME "emulationstation-de") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Leon Styhre <leon@leonstyhre.com>")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An emulator front-end with controller navigation and theming support.") set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://gitlab.com/leonstyhre/emulationstation-de")
SET(CPACK_PACKAGE_DESCRIPTION "EmulationStation Desktop Edition is a fast, feature rich front-end for browsing and launching games from your multi-platform retro game collection. It's intended to be used in conjunction with emulators such as the RetroArch cores.") set(CPACK_DEBIAN_PACKAGE_SECTION "misc")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
#set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libsdl2-2.0-0, libfreeimage3, libfreetype6, libvlc5, libcurl4, libpugixml1v5, libasound2")
set(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS "debhelper (>= 8.0.0), cmake, g++ (>= 4.8), libsdl2-dev, libfreeimage-dev, libfreetype6-dev, libcurl4-openssl-dev, libpugixml-dev, rapidjson-dev, libasound2-dev, libvlc-dev, libgl1-mesa-dev")
SET(CPACK_RESOURCE_FILE LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
#SET(CPACK_RESOURCE_FILE README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") set(CPACK_RPM_PACKAGE_REQUIRES "libc6, libsdl2-2.0-0, libfreeimage3, libfreetype6, libvlc5, libcurl4, libpugixml1v5, libasound2")
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Leon Styhre <leon@leonstyhre.com>") set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://gitlab.com/leonstyhre/emulationstation-de") set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
SET(CPACK_DEBIAN_PACKAGE_SECTION "misc") set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/src/es_icon.ico")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) set(CPACK_NSIS_DISPLAY_NAME "EmulationStation Desktop Edition")
#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libsdl2-2.0-0, libfreeimage3, libfreetype6, libvlc5, libcurl4, libpugixml1v5, libasound2") set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_CURRENT_SOURCE_DIR}/es-app/src/es_icon.ico")
SET(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS "debhelper (>= 8.0.0), cmake, g++ (>= 4.8), libsdl2-dev, libfreeimage-dev, libfreetype6-dev, libcurl4-openssl-dev, libpugixml-dev, rapidjson-dev, libasound2-dev, libvlc-dev, libgl1-mesa-dev") set(CPACK_NSIS_WELCOME_TITLE "EmulationStation Desktop Edition Installer")
set(CPACK_NSIS_FINISH_TITLE "EmulationStation Desktop Edition Installation Completed")
set(CPACK_NSIS_MANIFEST_DPI_AWARE ON)
SET(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) set(CPACK_PACKAGE_VENDOR "Leon Styhre")
SET(CPACK_RPM_PACKAGE_REQUIRES "libc6, libsdl2-2.0-0, libfreeimage3, libfreetype6, libvlc5, libcurl4, libpugixml1v5, libasound2") set(CPACK_PACKAGE_VERSION "1.0.0")
SET(CPACK_RPM_PACKAGE_LICENSE "MIT") set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_VENDOR "https://gitlab.com/leonstyhre/emulationstation-de") if(WIN32)
SET(CPACK_PACKAGE_VERSION "1.0.0") set(CPACK_PACKAGE_INSTALL_DIRECTORY "EmulationStation")
SET(CPACK_PACKAGE_VERSION_MAJOR "1") set(CPACK_PACKAGE_EXECUTABLES "EmulationStation" "EmulationStation")
SET(CPACK_PACKAGE_VERSION_MINOR "0") else()
SET(CPACK_PACKAGE_VERSION_PATCH "0") set(CPACK_PACKAGE_INSTALL_DIRECTORY "emulationstation_${CMAKE_PACKAGE_VERSION}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "emulationstation_${CMAKE_PACKAGE_VERSION}") set(CPACK_PACKAGE_EXECUTABLES "emulationstation" "emulationstation")
SET(CPACK_PACKAGE_EXECUTABLES "emulationstation" "emulationstation") endif()
SET(CPACK_RPM_FILE_NAME "emulationstation-de-${CPACK_PACKAGE_VERSION}.rpm") set(CPACK_RPM_FILE_NAME "emulationstation-de-${CPACK_PACKAGE_VERSION}.rpm")
SET(CPACK_DEBIAN_FILE_NAME "emulationstation-de-${CPACK_PACKAGE_VERSION}.deb") set(CPACK_DEBIAN_FILE_NAME "emulationstation-de-${CPACK_PACKAGE_VERSION}.deb")
#SET(CPACK_GENERATOR "RPM")
SET(CPACK_GENERATOR "DEB")
INCLUDE(CPack) if(WIN32)
set(CPACK_GENERATOR "NSIS")
else()
#set(CPACK_GENERATOR "RPM")
set(CPACK_GENERATOR "DEB")
endif()
include(CPack)