Cleaned up the CMake configuration.

This commit is contained in:
Leon Styhre 2022-04-19 17:24:54 +02:00
parent 5861455f1f
commit 277a729a2d
4 changed files with 96 additions and 96 deletions

View file

@ -10,19 +10,22 @@
cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.13)
if(APPLE) if(APPLE)
# Set this to the operating system version you're building on, and also update # Set this to the minimum supported macOS version, and also update
# es-app/assets/EmulationStation-DE_Info.plist accordingly. # es-app/assets/EmulationStation-DE_Info.plist accordingly.
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "macOS deployment target") set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14 CACHE STRING "macOS deployment target")
# This optional variable is used for code signing the DMG installer. # This optional variable is used for code signing the DMG installer.
set(MACOS_CODESIGN_IDENTITY "" CACHE STRING "macOS code signing certificate identity") set(MACOS_CODESIGN_IDENTITY "" CACHE STRING "macOS code signing certificate identity")
endif() endif()
project(emulationstation-de) project(emulationstation-de)
# Application version, update this when there has been a new release.
set(ES_VERSION 2.0.0-alpha)
# 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)
# Package type to use for CPack on Linux. # Package type to use for CPack on Linux.
set(LINUX_CPACK_GENERATOR "DEB" CACHE STRING "CPack generator, DEB or RPM") set(LINUX_CPACK_GENERATOR DEB CACHE STRING "CPack generator, DEB or RPM")
# Add local find modules to the CMake path. # Add local find modules to the CMake path.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake/Utils list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake/Utils
@ -43,7 +46,7 @@ option(UBSAN "Set to ON to build with UndefinedBehaviorSanitizer" ${UBSAN})
if(CLANG_TIDY) if(CLANG_TIDY)
find_program(CLANG_TIDY_BINARY NAMES clang-tidy) find_program(CLANG_TIDY_BINARY NAMES clang-tidy)
if(CLANG_TIDY_BINARY STREQUAL "CLANG_TIDY_BINARY-NOTFOUND") if(CLANG_TIDY_BINARY MATCHES CLANG_TIDY_BINARY-NOTFOUND)
message("-- CLANG_TIDY was set but the clang-tidy binary was not found") message("-- CLANG_TIDY was set but the clang-tidy binary was not found")
else() else()
message("-- Building with the clang-tidy static analyzer") message("-- Building with the clang-tidy static analyzer")
@ -64,7 +67,7 @@ endif()
# Raspberry Pi setup. # Raspberry Pi setup.
# Raspberry Pi OS 32-bit (armv7l). # Raspberry Pi OS 32-bit (armv7l).
if(EXISTS "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/bcm_host.h") if(EXISTS ${CMAKE_FIND_ROOT_PATH}/opt/vc/include/bcm_host.h)
set(RPI ON) set(RPI ON)
set(RPI_32 ON) set(RPI_32 ON)
set(GLES ON) set(GLES ON)
@ -73,7 +76,7 @@ if(EXISTS "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/bcm_host.h")
endif() endif()
# Raspberry Pi OS 64-bit (aarch64). # Raspberry Pi OS 64-bit (aarch64).
if(EXISTS "/usr/include/bcm_host.h") if(EXISTS /usr/include/bcm_host.h)
set(RPI ON) set(RPI ON)
set(RPI_64 ON) set(RPI_64 ON)
set(GLES ON) set(GLES ON)
@ -86,7 +89,7 @@ endif()
if(EMSCRIPTEN) if(EMSCRIPTEN)
set(GLES ON) set(GLES ON)
set(CMAKE_EXECUTABLE_SUFFIX ".html") set(CMAKE_EXECUTABLE_SUFFIX .html)
endif() endif()
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
@ -104,7 +107,7 @@ set_property(CACHE GLSYSTEM PROPERTY STRINGS "Desktop OpenGL" "Embedded OpenGL")
# Package dependencies. # Package dependencies.
if(GLSYSTEM MATCHES "Desktop OpenGL") if(GLSYSTEM MATCHES "Desktop OpenGL")
set(OpenGL_GL_PREFERENCE "GLVND") set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
elseif(GLES AND NOT EMSCRIPTEN) elseif(GLES AND NOT EMSCRIPTEN)
find_package(OpenGLES2 REQUIRED) find_package(OpenGLES2 REQUIRED)
@ -136,19 +139,19 @@ if(CEC)
endif() endif()
# Add ALSA for Linux. # Add ALSA for Linux.
if(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES Linux)
find_package(ALSA REQUIRED) find_package(ALSA REQUIRED)
endif() endif()
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
# Compiler and linker settings. # Compiler and linker 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")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0.0) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0.0)
message(SEND_ERROR "You need at least Clang 5.0.0 to compile EmulationStation-DE") message(SEND_ERROR "You need at least Clang 5.0.0 to compile EmulationStation-DE")
endif() endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") elseif(CMAKE_CXX_COMPILER_ID MATCHES GNU)
message("-- Compiler is GNU/GCC") message("-- Compiler is GNU/GCC")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.1) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.1)
message(SEND_ERROR "You need at least GCC 7.1 to compile EmulationStation-DE") message(SEND_ERROR "You need at least GCC 7.1 to compile EmulationStation-DE")
@ -156,10 +159,10 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(WIN32) if(WIN32)
set(CMAKE_CXX_FLAGS "-mwindows ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "-mwindows ${CMAKE_CXX_FLAGS}")
endif() endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") elseif(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
message("-- Compiler is MSVC") message("-- Compiler is MSVC")
# If using the MSVC compiler on Windows, disable the built-in min() and max() macros. # If using the MSVC compiler on Windows, disable the built-in min() and max() macros.
add_definitions(-DNOMINMAX) add_compile_definitions(NOMINMAX)
endif() endif()
if(CMAKE_BUILD_TYPE) if(CMAKE_BUILD_TYPE)
@ -169,7 +172,7 @@ endif()
# Set up compiler and linker flags for debug, profiling or release builds. # Set up compiler and linker flags for debug, profiling or release builds.
if(CMAKE_BUILD_TYPE MATCHES Debug) if(CMAKE_BUILD_TYPE MATCHES Debug)
# Enable the C++17 standard and disable optimizations as it's a debug build. # Enable the C++17 standard and disable optimizations as it's a debug build.
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /Od /DEBUG:FULL") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /Od /DEBUG:FULL")
else() else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O0 -g3 -Wall -Wpedantic -Wsign-compare -Wnarrowing -Wmissing-field-initializers -Wunused-macros") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O0 -g3 -Wall -Wpedantic -Wsign-compare -Wnarrowing -Wmissing-field-initializers -Wunused-macros")
@ -179,12 +182,12 @@ if(CMAKE_BUILD_TYPE MATCHES Debug)
# Comment this out if you're using LLDB for debugging as this flag makes the binary # Comment this out if you're using LLDB for debugging as this flag makes the binary
# much larger and the application much slower. On macOS this setting is never enabled # much larger and the application much slower. On macOS this setting is never enabled
# as LLDB is the default debugger on this OS. # as LLDB is the default debugger on this OS.
if(NOT APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(NOT APPLE AND 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()
elseif(CMAKE_BUILD_TYPE MATCHES Profiling) elseif(CMAKE_BUILD_TYPE MATCHES Profiling)
# For the profiling build, we enable optimizations and supply the required profiler flags. # For the profiling build, we enable optimizations and supply the required profiler flags.
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /O2 /DEBUG:FULL") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /O2 /DEBUG:FULL")
else() else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2 -g3 -Wall -Wpedantic -Wsign-compare -Wnarrowing -Wmissing-field-initializers -Wunused-macros") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2 -g3 -Wall -Wpedantic -Wsign-compare -Wnarrowing -Wmissing-field-initializers -Wunused-macros")
@ -193,7 +196,7 @@ elseif(CMAKE_BUILD_TYPE MATCHES Profiling)
else() else()
# Enable the C++17 standard and enable optimizations as it's a release build. # Enable the C++17 standard and enable optimizations as it's a release build.
# This will also disable all assert() macros. Strip the binary too. # This will also disable all assert() macros. Strip the binary too.
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG /std:c++17 /O2 /DEBUG:NONE") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG /std:c++17 /O2 /DEBUG:NONE")
else() else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2 -DNDEBUG -Wall -Wpedantic -Wsign-compare -Wnarrowing -Wmissing-field-initializers -Wunused-macros") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2 -DNDEBUG -Wall -Wpedantic -Wsign-compare -Wnarrowing -Wmissing-field-initializers -Wunused-macros")
@ -227,7 +230,7 @@ endif()
if(ASAN) if(ASAN)
message("-- Building with AddressSanitizer") message("-- Building with AddressSanitizer")
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address")
else() else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
@ -236,7 +239,7 @@ endif()
if(TSAN) if(TSAN)
message("-- Building with ThreadSanitizer") message("-- Building with ThreadSanitizer")
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
message(FATAL_ERROR "-- ThreadSanitizer not available for MSVC") message(FATAL_ERROR "-- ThreadSanitizer not available for MSVC")
else() else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer")
@ -245,7 +248,7 @@ endif()
if(UBSAN) if(UBSAN)
message("-- Building with UndefinedBehaviorSanitizer") message("-- Building with UndefinedBehaviorSanitizer")
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
message(FATAL_ERROR "-- UndefinedBehaviorSanitizer not available for MSVC") message(FATAL_ERROR "-- UndefinedBehaviorSanitizer not available for MSVC")
else() else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-omit-frame-pointer") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-omit-frame-pointer")
@ -277,53 +280,53 @@ endif()
# Preprocessor directives. # Preprocessor directives.
if(GLES) if(GLES)
add_definitions(-DUSE_OPENGLES) add_compile_definitions(USE_OPENGLES)
endif() endif()
if(STEAM_DECK) if(STEAM_DECK)
add_definitions(-DSTEAM_DECK) add_compile_definitions(STEAM_DECK)
message("-- Building for the Valve Steam Deck") message("-- Building for the Valve Steam Deck")
endif() endif()
if(RPI) if(RPI)
add_definitions(-D_RPI_) add_compile_definitions(_RPI_)
endif() endif()
if(BUNDLED_CERTS) if(BUNDLED_CERTS)
add_definitions(-DUSE_BUNDLED_CERTIFICATES) add_compile_definitions(USE_BUNDLED_CERTIFICATES)
message("-- Building with bundled TLS/SSL certificates") message("-- Building with bundled TLS/SSL certificates")
endif() endif()
if(DEFINED libCEC_FOUND) if(DEFINED libCEC_FOUND)
add_definitions(-DHAVE_LIBCEC) add_compile_definitions(HAVE_LIBCEC)
endif() endif()
if(VIDEO_HW_DECODING) if(VIDEO_HW_DECODING)
add_definitions(-DVIDEO_HW_DECODING) add_compile_definitions(VIDEO_HW_DECODING)
endif() endif()
if(APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.14) if(APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.14)
add_definitions(-DLEGACY_MACOS) add_compile_definitions(LEGACY_MACOS)
endif() endif()
# GLM library options. # GLM library options.
add_definitions(-DGLM_FORCE_CXX17) add_compile_definitions(GLM_FORCE_CXX17)
add_definitions(-DGLM_FORCE_XYZW_ONLY) add_compile_definitions(GLM_FORCE_XYZW_ONLY)
# For Unix systems, assign the installation prefix. If it's not explicitly set, # For Unix systems, assign the installation prefix. If it's not explicitly set,
# we use /usr on Linux, /usr/pkg on NetBSD and /usr/local on FreeBSD and OpenBSD. # we use /usr on Linux, /usr/pkg on NetBSD and /usr/local on FreeBSD and OpenBSD.
if(NOT WIN32 AND NOT APPLE) if(NOT WIN32 AND NOT APPLE)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
if(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES Linux)
set(CMAKE_INSTALL_PREFIX "/usr" CACHE INTERNAL "CMAKE_INSTALL_PREFIX") set(CMAKE_INSTALL_PREFIX /usr CACHE INTERNAL CMAKE_INSTALL_PREFIX)
elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD") elseif(CMAKE_SYSTEM_NAME MATCHES NetBSD)
set(CMAKE_INSTALL_PREFIX "/usr/pkg" CACHE INTERNAL "CMAKE_INSTALL_PREFIX") set(CMAKE_INSTALL_PREFIX /usr/pkg CACHE INTERNAL CMAKE_INSTALL_PREFIX)
else() else()
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE INTERNAL "CMAKE_INSTALL_PREFIX") set(CMAKE_INSTALL_PREFIX /usr/local CACHE INTERNAL CMAKE_INSTALL_PREFIX)
endif() endif()
endif() endif()
message("-- Installation prefix is set to " ${CMAKE_INSTALL_PREFIX}) message("-- Installation prefix is set to " ${CMAKE_INSTALL_PREFIX})
add_definitions(-DES_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") add_compile_definitions(ES_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
endif() endif()
# For Windows, set the minimum OS version to Windows 7. # For Windows, set the minimum OS version to Windows 7.
@ -381,7 +384,7 @@ if(DEFINED libCEC_FOUND)
endif() endif()
# For Linux, add the ALSA include directory. # For Linux, add the ALSA include directory.
if(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES Linux)
list(APPEND COMMON_INCLUDE_DIRS ${ALSA_INCLUDE_DIRS}) list(APPEND COMMON_INCLUDE_DIRS ${ALSA_INCLUDE_DIRS})
endif() endif()
@ -409,7 +412,7 @@ if(APPLE)
${PROJECT_SOURCE_DIR}/libpugixml.a ${PROJECT_SOURCE_DIR}/libpugixml.a
${PROJECT_SOURCE_DIR}/libSDL2-2.0.dylib) ${PROJECT_SOURCE_DIR}/libSDL2-2.0.dylib)
elseif(WIN32) elseif(WIN32)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set(COMMON_LIBRARIES ${PROJECT_SOURCE_DIR}/avcodec.lib set(COMMON_LIBRARIES ${PROJECT_SOURCE_DIR}/avcodec.lib
${PROJECT_SOURCE_DIR}/avfilter.lib ${PROJECT_SOURCE_DIR}/avfilter.lib
${PROJECT_SOURCE_DIR}/avformat.lib ${PROJECT_SOURCE_DIR}/avformat.lib
@ -507,7 +510,7 @@ if(DEFINED libCEC_FOUND)
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 ${ALSA_LIBRARY}) list(APPEND COMMON_LIBRARIES ${ALSA_LIBRARY})
endif() endif()
@ -515,7 +518,7 @@ endif()
if(BCMHOST) if(BCMHOST)
list(APPEND COMMON_LIBRARIES bcm_host vchiq_arm) list(APPEND COMMON_LIBRARIES bcm_host vchiq_arm)
if(RPI_32) if(RPI_32)
link_directories("${CMAKE_FIND_ROOT_PATH}/opt/vc/lib") link_directories(${CMAKE_FIND_ROOT_PATH}/opt/vc/lib)
endif() endif()
endif() endif()
@ -534,9 +537,9 @@ set(EXECUTABLE_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE)
set(LIBRARY_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE) set(LIBRARY_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE)
# Add each component. # Add each component.
add_subdirectory("external") add_subdirectory(external)
add_subdirectory("es-core") add_subdirectory(es-core)
add_subdirectory("es-app") add_subdirectory(es-app)
# Make sure rlottie is built before es-core and set lottie2gif to not be built. # Make sure rlottie is built before es-core and set lottie2gif to not be built.
add_dependencies(es-core rlottie) add_dependencies(es-core rlottie)

View file

@ -7,7 +7,7 @@
# Also contains the application packaging configuration. # Also contains the application packaging configuration.
# #
project("emulationstation-de") project(emulationstation-de)
set(ES_HEADERS set(ES_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemsManager.h ${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemsManager.h
@ -125,7 +125,7 @@ endif()
# Setup for installation and package generation. # Setup for installation and package generation.
if(WIN32) if(WIN32)
install(TARGETS EmulationStation RUNTIME DESTINATION .) install(TARGETS EmulationStation RUNTIME DESTINATION .)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
install(FILES ../avcodec-59.dll install(FILES ../avcodec-59.dll
../avfilter-8.dll ../avfilter-8.dll
../avformat-59.dll ../avformat-59.dll
@ -216,7 +216,7 @@ elseif(APPLE)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses DESTINATION ../Resources) install(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses DESTINATION ../Resources)
else() else()
install(TARGETS emulationstation RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) install(TARGETS emulationstation RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
if(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES Linux)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/emulationstation.6.gz install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/emulationstation.6.gz
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man6) DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man6)
else() else()
@ -244,47 +244,44 @@ include(InstallRequiredSystemLibraries)
#--------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------
# General CPack settings. # General CPack settings.
set(CPACK_PACKAGE_NAME "emulationstation-de") set(CPACK_PACKAGE_NAME emulationstation-de)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Emulator frontend") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Emulator frontend")
set(CPACK_PACKAGE_DESCRIPTION "EmulationStation Desktop Edition (ES-DE) is a frontend for browsing and launching games from your multi-platform game collection. set(CPACK_PACKAGE_DESCRIPTION "EmulationStation Desktop Edition (ES-DE) is a frontend for browsing and launching games from your multi-platform game collection.")
set(CPACK_PACKAGE_VERSION ${ES_VERSION})
It's intended to be used in conjunction with emulators such as the RetroArch cores.")
if(APPLE) if(APPLE)
# Shorter line length license file to be able to fit inside the drag-and-drop installer window without introducing extra line breaks. # Shorter line length license file to be able to fit inside the drag-and-drop installer window without introducing extra line breaks.
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_LICENSE_macOS") set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_LICENSE_macOS)
elseif(WIN32) elseif(WIN32)
# The installer window looks a bit different on Windows so a specific file for this OS is required. # The installer window looks a bit different on Windows so a specific file for this OS is required.
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_LICENSE_Windows") set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_LICENSE_Windows)
else() else()
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE)
endif() endif()
set(CPACK_PACKAGE_VENDOR "Leon Styhre") set(CPACK_PACKAGE_VENDOR "Leon Styhre")
# Update this when there has been a new release. # Use the shorter x64 descriptor for the x86_64/AMD64 architecture.
set(CPACK_PACKAGE_VERSION "2.0.0-alpha") if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES x86_64 OR CMAKE_HOST_SYSTEM_PROCESSOR MATCHES AMD64)
set(CPU_ARCHITECTURE x64)
# Use the shorter x64 descriptor if on the x86_64/AMD64 architecture.
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL AMD64)
set(CPU_ARCHITECTURE "x64")
else() else()
set(CPU_ARCHITECTURE "${CMAKE_HOST_SYSTEM_PROCESSOR}") set(CPU_ARCHITECTURE ${CMAKE_HOST_SYSTEM_PROCESSOR})
endif() endif()
# Settings per operating system and generator type. # Settings per operating system and generator type.
if(APPLE) if(APPLE)
set(CPACK_GENERATOR "Bundle") set(CPACK_GENERATOR Bundle)
if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.14) if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.14)
set(CPACK_PACKAGE_FILE_NAME "EmulationStation-DE-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE}_legacy") set(CPACK_PACKAGE_FILE_NAME EmulationStation-DE-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE}_legacy)
set(CPACK_DMG_VOLUME_NAME "EmulationStation Desktop Edition ${CPACK_PACKAGE_VERSION}_legacy") set(CPACK_DMG_VOLUME_NAME "EmulationStation Desktop Edition ${CPACK_PACKAGE_VERSION}_legacy")
else() else()
set(CPACK_PACKAGE_FILE_NAME "EmulationStation-DE-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE}") set(CPACK_PACKAGE_FILE_NAME EmulationStation-DE-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE})
set(CPACK_DMG_VOLUME_NAME "EmulationStation Desktop Edition ${CPACK_PACKAGE_VERSION}") set(CPACK_DMG_VOLUME_NAME "EmulationStation Desktop Edition ${CPACK_PACKAGE_VERSION}")
endif() endif()
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE.icns") set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE.icns)
set(CPACK_DMG_DS_STORE "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_DS_Store") set(CPACK_DMG_DS_STORE ${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_DS_Store)
set(CPACK_BUNDLE_NAME "EmulationStation Desktop Edition") set(CPACK_BUNDLE_NAME "EmulationStation Desktop Edition")
set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE.icns") set(CPACK_BUNDLE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE.icns)
set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_Info.plist") set(CPACK_BUNDLE_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_Info.plist)
if(MACOS_CODESIGN_IDENTITY) if(MACOS_CODESIGN_IDENTITY)
set(CPACK_BUNDLE_APPLE_CERT_APP "Developer ID Application: ${MACOS_CODESIGN_IDENTITY}") set(CPACK_BUNDLE_APPLE_CERT_APP "Developer ID Application: ${MACOS_CODESIGN_IDENTITY}")
if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER 10.13) if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER 10.13)
@ -292,47 +289,47 @@ if(APPLE)
endif() endif()
endif() endif()
elseif(WIN32) elseif(WIN32)
set(CPACK_GENERATOR "NSIS") set(CPACK_GENERATOR NSIS)
set(CPACK_PACKAGE_FILE_NAME "EmulationStation-DE-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE}") set(CPACK_PACKAGE_FILE_NAME EmulationStation-DE-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "EmulationStation-DE") set(CPACK_PACKAGE_INSTALL_DIRECTORY EmulationStation-DE)
set(CPACK_PACKAGE_EXECUTABLES "EmulationStation" "EmulationStation") set(CPACK_PACKAGE_EXECUTABLES EmulationStation EmulationStation)
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") set(CPACK_NSIS_INSTALL_ROOT ${PROGRAMFILES64})
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") set(CPACK_NSIS_EXECUTABLES_DIRECTORY .)
set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation.ico") set(CPACK_NSIS_MUI_ICON ${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation.ico)
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON) set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
set(CPACK_NSIS_DISPLAY_NAME "EmulationStation Desktop Edition ${CPACK_PACKAGE_VERSION}") set(CPACK_NSIS_DISPLAY_NAME "EmulationStation Desktop Edition ${CPACK_PACKAGE_VERSION}")
set(CPACK_NSIS_PACKAGE_NAME "EmulationStation Desktop Edition") set(CPACK_NSIS_PACKAGE_NAME "EmulationStation Desktop Edition")
set(CPACK_NSIS_INSTALLED_ICON_NAME "EmulationStation.exe") set(CPACK_NSIS_INSTALLED_ICON_NAME EmulationStation.exe)
set(CPACK_NSIS_WELCOME_TITLE "EmulationStation Desktop Edition Installer") set(CPACK_NSIS_WELCOME_TITLE "EmulationStation Desktop Edition Installer")
set(CPACK_NSIS_FINISH_TITLE "EmulationStation Desktop Edition Installation Completed") set(CPACK_NSIS_FINISH_TITLE "EmulationStation Desktop Edition Installation Completed")
set(CPACK_NSIS_MANIFEST_DPI_AWARE ON) set(CPACK_NSIS_MANIFEST_DPI_AWARE ON)
set(CPACK_NSIS_MENU_LINKS "https://es-de.org" "ES-DE Website" "https://es-de.org/#Donations" "Please Donate") set(CPACK_NSIS_MENU_LINKS "https://es-de.org" "ES-DE Website" "https://es-de.org/#Donations" "Please Donate")
else() else()
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)
if(LINUX_CPACK_GENERATOR STREQUAL "DEB") if(LINUX_CPACK_GENERATOR MATCHES DEB)
set(CPACK_GENERATOR "DEB") set(CPACK_GENERATOR DEB)
endif() endif()
set(CPACK_DEBIAN_FILE_NAME "emulationstation-de-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE}.deb") set(CPACK_DEBIAN_FILE_NAME emulationstation-de-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE}.deb)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Leon Styhre <info@es-de.org>") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Leon Styhre <info@es-de.org>")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://es-de.org") set(CPACK_DEBIAN_PACKAGE_HOMEPAGE https://es-de.org)
set(CPACK_DEBIAN_PACKAGE_SECTION "games") set(CPACK_DEBIAN_PACKAGE_SECTION games)
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") set(CPACK_DEBIAN_PACKAGE_PRIORITY optional)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
if(LINUX_CPACK_GENERATOR STREQUAL "RPM") if(LINUX_CPACK_GENERATOR MATCHES RPM)
set(CPACK_GENERATOR "RPM") set(CPACK_GENERATOR RPM)
endif() endif()
set(CPACK_RPM_FILE_NAME "emulationstation-de-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE}.rpm") set(CPACK_RPM_FILE_NAME emulationstation-de-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE}.rpm)
set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
set(CPACK_RPM_PACKAGE_LICENSE "MIT") set(CPACK_RPM_PACKAGE_LICENSE MIT)
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "${CMAKE_INSTALL_PREFIX}") list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION ${CMAKE_INSTALL_PREFIX})
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "${CMAKE_INSTALL_PREFIX}/bin") list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION ${CMAKE_INSTALL_PREFIX}/bin)
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "${CMAKE_INSTALL_PREFIX}/share") list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION ${CMAKE_INSTALL_PREFIX}/share)
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "${CMAKE_INSTALL_PREFIX}/share/man") list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION ${CMAKE_INSTALL_PREFIX}/share/man)
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "${CMAKE_INSTALL_PREFIX}/share/man/man6") list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION ${CMAKE_INSTALL_PREFIX}/share/man/man6)
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "${CMAKE_INSTALL_PREFIX}/share/metainfo") list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION ${CMAKE_INSTALL_PREFIX}/share/metainfo)
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "${CMAKE_INSTALL_PREFIX}/share/pixmaps") list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION ${CMAKE_INSTALL_PREFIX}/share/pixmaps)
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "${CMAKE_INSTALL_PREFIX}/share/applications") list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION ${CMAKE_INSTALL_PREFIX}/share/applications)
endif() endif()
include(CPack) include(CPack)

View file

@ -6,7 +6,7 @@
# CMake configuration for es-core. # CMake configuration for es-core.
# #
project("core") project(core)
set(CORE_HEADERS set(CORE_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/src/AsyncHandle.h ${CMAKE_CURRENT_SOURCE_DIR}/src/AsyncHandle.h

View file

@ -23,7 +23,7 @@ unset(CMAKE_CXX_FLAGS)
unset(CMAKE_EXE_LINKER_FLAGS) unset(CMAKE_EXE_LINKER_FLAGS)
if(EMSCRIPTEN) if(EMSCRIPTEN)
set(CMAKE_CXX_FLAGS "-pthread") set(CMAKE_CXX_FLAGS -pthread)
endif() endif()
add_subdirectory("rlottie" EXCLUDE_FROM_ALL) add_subdirectory(rlottie EXCLUDE_FROM_ALL)